Segfault on simple program?

nazriel spam at dzfl.pl
Tue Jun 11 02:31:36 PDT 2013


On Friday, 31 May 2013 at 17:14:46 UTC, Shriramana Sharma wrote:
> import std.stdio ;
>
> void foo ( int[] array ) {
> 	foreach ( i ; array ) { writeln ( i ) ; }
> }
>
> void main () {
> 	foo ( [ 1, 2, 3 ] ) ;
> }
>
> On both DMD 2.062 and 2.063 this compiles OK but causes a 
> segfault.
> I'm running Kubuntu Raring 64-bit. Any hints?

If you can attach your test-case program that segfaults compiled 
on that Kubuntu x86_64 I would be grateful.

It will allow to see if it is OS problem, hardware problem or it 
is DMD that is producing bad code in some specific scenarios.

Also it is easier to debug and reverse program when binary is 
given.
Thanks in advance.


More information about the Digitalmars-d-learn mailing list