www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.ide
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics



D.gnu - strange behaviour with out of bounds exception and tango

I am not totally sure this is a gdc bug, but there are strong hints that it is.
The out-of bounds exception seem to garble the stack in a fully 
reproducible way on darwin (10.4 intel, gdc r 209), and to crash on 
Linux x86.
gdc Linux x86_64 and DMD x86 work.

a sample file showing this behaviour is:
-------------
// a good place to set the breakpoint is genobj.d:968
// (post garbling), and lifetime.d:99 (and later lifetime.d:103)
// (pre garbling)
module hello_tango;
void main(char [][] argv)
{
    int []a=new int[10];
    a.length=5;
    int b=a[6];
}
-----------

With tango it fails, the corresponding tango ticket is
	http://www.dsource.org/projects/tango/ticket/1094

I suspect that this is connected with the part of the code that 
extracts filename and line number for the array exception (or, but more 
unlikely, with the last-call optimization, or inlining that removes the 
_d_array_bounds call from the stack).

Unfortunately I wasn't able to reproduce the bug with phobos, but I 
still suspect that it is compiler related.

Does this pass the "bug-reporteable" threshold?

Fawzi
May 09 2008