www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8232] New: Segmentation fault in rt_finalize_gc()

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

           Summary: Segmentation fault in rt_finalize_gc()
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: marian.povolny gmail.com



11:01:29 PDT ---
Created an attachment (id=1114)
Code causing segmentation fault

The 42 lines in the attached file cause a segmentation fault, while parsing a
larger textual file. For example, I used the following file, but unzipped it
first:

ftp://ftp.wormbase.org/pub/wormbase/species/m_hapla/gff/m_hapla.current.annotations.gff3.gz

Here is what I get in gdb:

Program received signal SIGSEGV, Segmentation fault.
0x080a26b0 in rt_finalize_gc ()
(gdb) where












(gdb)

The code uses only the safe subset of D, therefore the worst that should happen
is an exception. But here I have a segfault.

Me and two others were not able to reduce this code further. Small changes make
this segfault go away. For example, it occurs only if the array size in the new
statement is 8177 or greater. If it's less, there is no segfault. Replacing
"line ~= current_chunk[0..newline_index];" with "line = line ~
current_chunk[0..newline_index];" will also make the segfault go away.

The segfault occurs in both 32bit and 64bit builds on Linux, using DMD v2.059.

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