www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - SIGSEGV in rt_finalize

reply Rory Mcguire <rjmcguire gm_no_ail.com> writes:
Hi guys,

I have a 265 line program that gets a segmentation fault if I don't comment 
out this while loop(I am not using delete or anything like it):
/+      while (lines.length > 0 && line.length > 3 && line[3]=='-') {
            line ~= lines[0];
            lines = lines[1..$];
        }+/

Any Ideas on how to track this one down?

Backtrace:
[Thread 0xf753cb70 (LWP 10053) exited]

Program received signal SIGSEGV, Segmentation fault.
0x08067798 in rt_finalize ()
(gdb) bt
#0  0x08067798 in rt_finalize ()
#1  0x0806603d in _D2gc3gcx3Gcx11fullcollectMFPvZk ()
#2  0x08065c3e in _D2gc3gcx3Gcx16fullcollectshellMFZk ()
#3  0x08064e69 in _D2gc3gcx2GC18fullCollectNoStackMFZv ()
#4  0x08063b60 in gc_term ()
#5  0x08053b60 in _D2rt6dmain24mainUiPPaZi6runAllMFZv ()
#6  0x08053a69 in _D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv ()
#7  0x08053a18 in main ()


-Rory
Jul 28 2010
parent reply "Steven Schveighoffer" <schveiguy yahoo.com> writes:
On Wed, 28 Jul 2010 11:45:59 -0400, Rory Mcguire <rjmcguire gm_no_ail.com>  
wrote:

 Hi guys,

 I have a 265 line program that gets a segmentation fault if I don't  
 comment
 out this while loop(I am not using delete or anything like it):
 /+      while (lines.length > 0 && line.length > 3 && line[3]=='-') {
             line ~= lines[0];
             lines = lines[1..$];
         }+/

 Any Ideas on how to track this one down?

No, please post the whole code, or a reduced example. What compiler version/platform? -Steve
Jul 29 2010
parent Rory Mcguire <rjmcguire gm_no_ail.com> writes:
Steven Schveighoffer wrote:

 On Wed, 28 Jul 2010 11:45:59 -0400, Rory Mcguire <rjmcguire gm_no_ail.com>
 wrote:
 
 Hi guys,

 I have a 265 line program that gets a segmentation fault if I don't
 comment
 out this while loop(I am not using delete or anything like it):
 /+      while (lines.length > 0 && line.length > 3 && line[3]=='-') {
             line ~= lines[0];
             lines = lines[1..$];
         }+/

 Any Ideas on how to track this one down?

No, please post the whole code, or a reduced example. What compiler version/platform? -Steve

I'll try make a reduced example.
Jul 29 2010