Skip to content

We don't escape sched_yield busy loops with use_preload_libc=false (or if the code makes a direct syscall) #2681

@sporksmith

Description

@sporksmith

Our seccomp filter currently always passes through the sched_yield syscall to avoid recursing in the shim's own spin lock.

If we don't intercept sched_yield via LD_PRELOAD, e.g. because use_preload_libc is false or because the managed code makes a direct syscall, this causes us to execute the syscall natively instead of emulating it. In some cases this is ok, but it breaks our ability to escape busy loops using model_unblocked_syscall_latency.

Removing the sched_yield exception in our seccomp filter, in shim_seccomp_init, seemed to work OK for me locally, but I wouldn't be surprised if there was a race condition s.t. it caused occasional failures in practice.

The right fix is probably to add a better mechanism for shadow_spinlock to ensure its sched_yield executes natively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugError or flaw producing unexpected results

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions