-
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
Fix detached pthread failures #779
Comments
mmap11 LTP test hang may be related to this. |
/tests/languages/nodejsThe failing nodejs detached thread is https://github.com/nodejs/node/blob/1be7bbdc3b533759072cfc3d13766511197e3d01/src/inspector_agent.cc#L77-L92. This is created here - https://github.com/nodejs/node/blob/1be7bbdc3b533759072cfc3d13766511197e3d01/src/inspector_agent.cc#L121. Pretty much the first thing the thread does is a futex wait syscall, and in doing so segfaults. inline void* StartIoThreadMain(void* unused) {
for (;;) {
uv_sem_wait(&start_io_thread_semaphore);
... Depending on whether LKL_DEBUG is turned on this fails differently. With LKL_DEBUG:This fails at the first
Failing instruction being -
Without LKL_DEBUG:The futex wait syscall is actually run, causing the thread to yield. While yielding back to the lthread scheduler it segfaults trying to write a rbp relative address.
The failing instruction is -
|
/tests/basic/pthread_detachHere sgx-lkl goes into a context switch loop between
The app main thread in this case seems to be sleeping on a futex.
|
@vtikoo This may mean that the LKL termination sequence hasn't been triggered despite the fact that all application threads have exited. |
@prp is the LKL termination sequence triggered only by the app main thread exiting? |
Hmm, termination should be triggered by any application thread exiting: https://github.com/lsds/lkl/blob/e041aa71e03a142ecef542c005b07d13e2a3b722/arch/lkl/kernel/threads.c#L89 |
Going by the stack traces above, it looks like the application main thread hasn't exited and is sleeping on a futex. This is causing LKL to have no runnable tasks after the last detached pthread exits. |
PR #403 is disabling these two tests:
/tests/basic/pthread_detach
/tests/languages/nodejs
These are disabled due to issues in detached pthreads support.
The text was updated successfully, but these errors were encountered: