www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 54] New: GC corruption of TLS memory

http://bugzilla.gdcproject.org/show_bug.cgi?id=54


           Summary: GC corruption of TLS memory
    Classification: Unclassified
           Product: GDC
           Version: development
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: Normal
         Component: gdc
        AssignedTo: ibuclaw gdcproject.org
        ReportedBy: pdewacht gmail.com


This occured while trying to get Debian's val-and-rick package to work with GDC
trunk. When compiling the package with the -O flag, I got the following memory
layout:

(gdb) p &_tlsstart
$18 = (<thread local variable, no debug info> *) 0x7ffff7ef07c4
(gdb) p &_tlsend
$19 = (<thread local variable, no debug info> *) 0x7ffff7ef0f38
(gdb) find &_tlsstart, &_tlsend, 'abagames.vr.shape.BitmapShape.letters()' 
0x7ffff7ef0878

Note that _tlsstart is not aligned on an 8-byte boundary. The GC's mark routine
walks from _tlsstart to _tlsend in pointer-sized (8 byte) steps, so it misses
all properly aligned pointers in this range. As a result in-use objects such as
that BitmapShape instance are deleted.

-- 
Configure bugmail: http://bugzilla.gdcproject.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
May 23 2013