Bug 23350 – Nondeterministic test failure in std.concurrency
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2022-09-20T16:53:13Z
Last change time
2022-09-20T22:57:06Z
Assigned to
No Owner
Creator
Paul Backus
Comments
Comment #0 by snarwin+bugzilla — 2022-09-20T16:53:13Z
std.concurrency's test suite will sometimes fail due to a segfault in a static module destructor. [1]
So far, this failure has been observed on 64-bit Linux, and resulted in the following stack trace (demangled):
---
generated/linux/release/64/unittest/libphobos2-ut.so(extern (C) nothrow @nogc void core.runtime.runModuleUnitTests().unittestSegvHandler(int, core.sys.posix.signal.siginfo_t*, void*)+0x2d)[0x7f7bf0cc19c1]
/lib/x86_64-linux-gnu/libc.so.6(+0x354c0)[0x7f7bec8334c0]
generated/linux/release/64/unittest/libphobos2-ut.so(nothrow ref @property std.concurrency.ThreadInfo std.concurrency.thisInfo()+0x22)[0x7f7bef4f1ede]
generated/linux/release/64/unittest/libphobos2-ut.so(void std.concurrency._staticDtor_L266_C1()+0x9)[0x7f7bef4f1ef1]
generated/linux/release/64/unittest/libphobos2-ut.so(void std.concurrency.__moddtor()+0x9)[0x7f7bef530641]
generated/linux/release/64/unittest/libphobos2-ut.so(void rt.minfo.runModuleFuncsRev!(rt.minfo.ModuleGroup.runTlsDtors().__lambda1).runModuleFuncsRev(const(immutable(object.ModuleInfo)*)[])+0x46)[0x7f7bf0d05132]
generated/linux/release/64/unittest/libphobos2-ut.so(void rt.minfo.ModuleGroup.runTlsDtors()+0x21)[0x7f7bf0d04b1d]
generated/linux/release/64/unittest/libphobos2-ut.so(int rt.minfo.rt_moduleTlsDtor().__foreachbody1(ref rt.sections_elf_shared.DSO)+0x1d)[0x7f7bf0d04ed9]
generated/linux/release/64/unittest/libphobos2-ut.so(int rt.sections_elf_shared.DSO.opApplyReverse(scope int delegate(ref rt.sections_elf_shared.DSO))+0x6a)[0x7f7bf0d0681e]
generated/linux/release/64/unittest/libphobos2-ut.so(rt_moduleTlsDtor+0x15)[0x7f7bf0d04eb9]
generated/linux/release/64/unittest/libphobos2-ut.so(thread_entryPoint+0x1c4)[0x7f7bf0cf432c]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f7bec3e46ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f7bec90551d]
---
[1] https://github.com/dlang/phobos/blob/v2.100.2/std/concurrency.d#L266-L269
Comment #1 by dlang-bot — 2022-09-20T22:57:06Z
dlang/phobos pull request #8579 "Fix Issue 23350 - Nondeterministic test failure in std.concurrency" was merged into master:
- 50b01938644da671badbddf95a20ad9d3214935e by Paul Backus:
Fix Issue 23350 - Nondeterministic test failure in std.concurrency
Previously, a TOCTOU bug in threadInfo could result in a null
dereference if 'scheduler' was changed to null between the evaluation of
the 'if' condition and the call to scheduler.threadInfo.
https://github.com/dlang/phobos/pull/8579