Skip to content
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

threadleaktest hang on E2K #418

Closed
ivmai opened this issue Jan 21, 2022 · 3 comments
Closed

threadleaktest hang on E2K #418

ivmai opened this issue Jan 21, 2022 · 3 comments

Comments

@ivmai
Copy link
Owner

ivmai commented Jan 21, 2022

Source: master (c5c7c53)
Host: Linux/e2k
Occurrence: rare (~1/20)
How to build: ./configure --disable-thread-local-alloc && make -j check
Related issue: #411

Reason: malloc (in GC_get_procedure_stack) is called from a signal which is invoked while executing calloc() called from pthread_create.

@ivmai
Copy link
Owner Author

ivmai commented Jan 21, 2022

Stack trace:

(gdb) bt
#0  0x000045d86a381700 in __lll_lock_wait_private () from /lib64/libc.so.6
#1  0x000045d86a185a40 in malloc () from /lib64/libc.so.6
#2  0x000045d869f0e0f0 in GC_get_procedure_stack () from /export/home/ivmai/bdwgc/.libs/libgc.so.1
#3  0x000045d869f0f4d8 in GC_suspend_handler_inner () from /export/home/ivmai/bdwgc/.libs/libgc.so.1
#4  0x000045d869f0e8a0 in GC_with_callee_saves_pushed () from /export/home/ivmai/bdwgc/.libs/libgc.so.1
#5  0x000045d869f0f060 in GC_suspend_handler () from /export/home/ivmai/bdwgc/.libs/libgc.so.1
#6  <signal handler called>
#7  0x000045d86a192550 in calloc () from /lib64/libc.so.6
#8  0x000045d869e47a80 in _dl_allocate_tls () from /lib64/ld-linux.so.2
#9  0x000045d869fb1098 in allocate_stack () from /lib64/libpthread.so.0
#10 0x000045d869fb93d0 in pthread_create@@GLIBC_2.1 () from /lib64/libpthread.so.0
#11 0x000045d869f23da8 in GC_pthread_create () from /export/home/ivmai/bdwgc/.libs/libgc.so.1
#12 0x0000000000010f10 in main ()

@ivmai
Copy link
Owner Author

ivmai commented Jan 21, 2022

Potential solution: determine the buffer size in GC_get _procedure_stack (called from signal) but call malloc from a thread which holds the GC lock.

Relates also to #413

@ivmai
Copy link
Owner Author

ivmai commented Mar 11, 2022

Fixed by 990dcdb (#411)

@ivmai ivmai closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant