-
Notifications
You must be signed in to change notification settings - Fork 89
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
Signals not delivered to correct thread #644
Comments
Ok, the above problem goes away when we remove the syscall bypass for The problem then is that the signal is always delivered to the thread calling The reason is that the code in LKL's For the pending signal to be associated with the correct thread, I suspect that we need to follow the x86 signal handling code, which first creates a stack frame and then invokes the kernel signal delivery. This may pull in more x86 architecture code into LKL. |
I don't think that we need a proper stack frame to have the correct behaviour, we just need to wake up the correct thread and allow it to pull the pending signal off the stack on syscall return. Currently, we are handling all signals for any task on syscall return. |
@davidchisnall I'm not sure. I think that the correct code path for signal handling is to create a stack frame and associate the pending signal with the correct thread (which can be done on the syscall return path -- for x86 it's done during a user/kernel space transition). The pending signal will then be picked up by the scheduler. I think that the problem with our current implementation is that it just calls the signal handler directly. |
The |
This is fixed as of #830 with the test re-enabled in 539b65a /datadrive/kegordo/sept17/sgx-lkl/build/sgx-lkl-run-oe --hw-debug sgxlkl-miniroot-fs.img /ltp/testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01 tst_test.c:1117: INFO: Timeout per run is 0h 00m 20s tst_test.c:1136: INFO: No fork support rt_sigqueueinfo01.c:37: PASS: Received correct signal and data! rt_sigqueueinfo01.c:78: PASS: rt_sigqueueinfo() was successful! [ 0.117755] reboot: Restarting system |
The following test uses
rt_sigqueueinfo
to send a signal to a thread: vtikoo@7e539eeWhen running the test directly, it succeeds:
When run with SGX-LKL, it fails as follows:
The problem seems to be that the assigned tid for the main thread is inconsistent with the pid.
(cc: @vtikoo @davidchisnall)
The text was updated successfully, but these errors were encountered: