[Issue 4150] New: std.signal causes memory corruption and heisenbugs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun May 2 20:33:26 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4150

           Summary: std.signal causes memory corruption and heisenbugs
           Product: D
           Version: 2.041
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: nfxjfg at gmail.com


--- Comment #0 from nfxjfg at gmail.com 2010-05-02 20:33:25 PDT ---
Created an attachment (id=621)
test program

The attached program shows that std.signal sometimes emits signals on objects
free'd by the GC. Essentially, this can lead to memory corruption and
heisenbugs.

Note that the test program isn't really deterministic. On my Core 2 Duo, it
takes some seconds until the assertion fails. Sometimes it segfaults as well.

Looking into std.signal, there are several problems:
- Signal.emit doesn't check if the objects are still alive (probably the cause
for this bug)
- it calls rt_detachDisposeEvent on a possibly dead object in Signal.~this (may
be the cause for the segfault)
- it silently assumes the context ptr of a delegate is a D object (unrelated to
this bug)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list