www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1385] New: Stack Overflow when compiling large file

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

           Summary: Stack Overflow when compiling large file
           Product: D
           Version: 2.003
          Platform: PC
               URL: http://mainia.de/large_parser.d
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: jascha mainia.de


DMD crashes with a stack overflow when compiling this file:
http://mainia.de/large_parser.d

It's probably caused by a large array literal.

Smaller parsers compile fine, for example:
http://mainia.de/small_parser.d
(this one needs http://mainia.de/container.d)


-- 
Jul 30 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1385






This doesn't happen if the array literals are initializers.
In large_parser.d the large array literals appeared in the constructor - DMD
crashes. The following example uses them as const initializers and it compiles
without problems:
http://mainia.de/large_parser2.d


-- 
Jul 31 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1385






Created an attachment (id=332)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=332&action=view)
Reduced test case

Reduced test case.  Clearly shows it's caused by the large array literal. On my
system, the smallest array literal which caused a stack overflow was 10776
elements. Needs to be inside a function.

void main() {
ubyte[] data = [
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
...
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0];
}
---
Stack overflow.


-- 
Apr 21 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1385


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |clugdbug yahoo.com.au
         Resolution|                            |FIXED





Fixed DMD2.030 and 1.045

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