[Issue 13416] frequent auto-tester hangs in core.thread on freebsd 32 and 64

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Nov 22 14:52:04 PST 2014


https://issues.dlang.org/show_bug.cgi?id=13416

Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at dawg.eu

--- Comment #4 from Martin Nowak <code at dawg.eu> ---
That's a dead-lock in the pthread library.
Both pthread_attr_get_np and pthread_kill lock the same thread mutex.

_pthread_attr_get_np:
https://github.com/freebsd/freebsd/blob/428b45aa532260e8c6ddf0217ec31db2234d29a8/lib/libthr/thread/thr_attr.c#L154
_pthread_kill:
https://github.com/freebsd/freebsd/blob/428b45aa532260e8c6ddf0217ec31db2234d29a8/lib/libthr/thread/thr_kill.c#L64

_thr_find_thread:
https://github.com/freebsd/freebsd/blob/428b45aa532260e8c6ddf0217ec31db2234d29a8/lib/libthr/thread/thr_list.c#L351

We should try to use pthread_suspend_np or pthread_suspend_all_np instead.
Without a signal handler we'd still need to obtain the stack top.
There seems to be a function on OpenBSD pthread_stackseg_np, not sure how to do
it on FreeBSD.

--


More information about the Digitalmars-d-bugs mailing list