www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5579] New: Segfault on first call to GC after starting new thread

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5579

           Summary: Segfault on first call to GC after starting new thread
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com



The following code segfaults on about 50% of runs.  This happens in both 32-bit
and 64-bit Linux and on Windows, regardless of how the -O, -inline, and
-release flags are set.

import core.memory, core.thread;

void doNothing() {}

void main() {
    auto t = new Thread(&doNothing);
    t.start;
    GC.collect();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 14 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5579


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



21:31:23 PST ---
It faults on this code in druntime/src/rt/lifetime.d:
==================================
// we expect this to be called with the lock in place
extern(C) void rt_processGCMarks(void[] tls)
{
    // called after the mark routine to eliminate block cache data when it
    // might be ready to sweep

    debug(PRINTF) printf("processing GC Marks, %x\n", tls.ptr);
    auto cache = *cast(BlkInfo **)(tls.ptr + __blkcache_offset);
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
=================================
Both tls.ptr and __blkcache_offset are NULL.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 14 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5579


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



22:24:29 PST ---
https://github.com/D-Programming-Language/druntime/commit/bc731e9e66a4560ebb1a1a893f0abdaeb1fbee55

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