-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async signals aren't always delivered as expected #209
Labels
Milestone
Comments
davidchisnall
added a commit
that referenced
this issue
May 26, 2020
We currently have two implementations of futexes, one provided by Linux (which was not being built) and one in `src/enclave`. The `src/enclave` version was incomplete (for example, not implementing `FUTEX_WAKE_OP`) and was under-tested. After this change: - The `enclave_futex` implementation is used only for the LKL host ops. - The Linux futex is used for everything in userspace. This should now give us parity with Linux for futex operations (and ensure that we pick up new ones when they are added upstream, for example the proposed operation to wait on multiple futexes). This does not fix #209, but hopefully simplifies the fix because there should now be only one way for a userspace thread to block. It appears as if the thread is blocking correctly in userspace and the scheduler is receiving ticks, but is not waking up the blocking thread. Fixes #180 Fixes #305
SeanTAllen
pushed a commit
that referenced
this issue
May 26, 2020
We currently have two implementations of futexes, one provided by Linux (which was not being built) and one in `src/enclave`. The `src/enclave` version was incomplete (for example, not implementing `FUTEX_WAKE_OP`) and was under-tested. After this change: - The `enclave_futex` implementation is used only for the LKL host ops. - The Linux futex is used for everything in userspace. This should now give us parity with Linux for futex operations (and ensure that we pick up new ones when they are added upstream, for example the proposed operation to wait on multiple futexes). This does not fix #209, but hopefully simplifies the fix because there should now be only one way for a userspace thread to block. It appears as if the thread is blocking correctly in userspace and the scheduler is receiving ticks, but is not waking up the blocking thread. Fixes #180 Fixes #305
Also part of #709 |
10 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Asynchronous signals such as those that will be delivered by using the system calls
alarm
andsetitimer
are not delivered as expected.This can result in unexpected behavior from applications, for example, busybox ping. It will use alarm to wait to send it's ping and during that time isn't executing system calls so it hangs in sgx-lkl after the first ping is sent.
@letmaik first reported this issue. It can be recreated by changing the
CC_APP
andCC_APP_CMDLINE
options in the curl test to:Attached is a zip file with 3 different variations on how ping could be written that can help diagnosing. Those that rely on a timer will fail unless the timer is less than the amount of time it takes to receive a packet back from the pinged host. If a packet is received after the timer timeout, then another ping will be sent. Otherwise it hangs.
This behavior might be related to
https://github.com/lsds/lkl/blob/21cd7e192cf2a97ea69230b9c0c34da15d157579/arch/lkl/kernel/syscalls.c#L195
where it appears that signals are only handled on syscalls. However, there is more investigation to be done there.
ping-examples.zip
My suspicion is that if we checked for signals in
futex_tick
or somewhere in the main scheduler loop, that this issue would go away but that hasn't been verified and that might be addressing a symptom rather than underlying cause. More investigation is needed.The text was updated successfully, but these errors were encountered: