Bug 2952 – Segfault on exit when using array ops with arrays of doubles larger than 8 elements
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2009-05-07T18:53:00Z
Last change time
2014-04-18T09:12:04Z
Keywords
wrong-code
Assigned to
nobody
Creator
lmb
Comments
Comment #0 by lmb — 2009-05-07T18:53:09Z
This program causes a segmentation fault when exiting:
void main()
{
double[9] array;
array[] *= 2;
}
Curious things:
1. The program seems to actually execute correctly. I mean, adding more code to the program, including other array operations and printing the contents of 'array' results in the expected behavior -- but it keeps segfaulting on exit.
2. Replacing 'double' with 'float', 'real', 'int' (and possibly others) makes the program work correctly.
3. Using an array with less than 9 elements makes the program work correctly.
Comment #1 by clugdbug — 2009-05-25T01:25:16Z
This applies also to Windows, and to D1.
Comment #2 by clugdbug — 2009-05-25T03:02:40Z
I have fixed this but can't post it to the runtime source since dsource is down.