Bug 9606 – `std.signal` implementation is fundamentally incorrect

Status
NEW
Severity
critical
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-27T04:02:34Z
Last change time
2024-12-01T16:16:41Z
Keywords
wrong-code
Assigned to
No Owner
Creator
Denis Shelomovskii
Depends on
4151
Blocks
4150
See also
https://issues.dlang.org/show_bug.cgi?id=16203
Moved to GitHub: phobos#9956 →

Comments

Comment #0 by verylonglogin.reg — 2013-02-27T04:02:34Z
`std.signal` implementation is written like it is called from a single thread or explicitly synchronized. The reality is on objects collecting GC calls dispose events of finalizing object from its thread. So `unhook` can be called in a middle of `emit`, `connect`, or `disconnect` freezed in other thread.
Comment #1 by verylonglogin.reg — 2013-02-27T04:03:21Z
As we can't lock GC (at least in `emit`) some sort of lock-free programming should be used here.
Comment #2 by verylonglogin.reg — 2013-02-27T06:03:54Z
A think-less fix just to prevent nasty random failures: https://github.com/D-Programming-Language/phobos/pull/1179
Comment #3 by verylonglogin.reg — 2013-03-16T05:00:58Z
Added issue 4151 as a dependency as weak reference looks as the right way to fix this.
Comment #4 by robert.schadek — 2024-12-01T16:16:41Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9956 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB