Bug 37904 - internal compiler error: Segmentation fault (C++ destructor)
Summary: internal compiler error: Segmentation fault (C++ destructor)
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-23 18:58 UTC by John Roden
Modified: 2009-10-05 03:05 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux
Target: i686-pc-linux
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Test Case -- preprocessed code (94.83 KB, text/plain)
2008-10-23 19:01 UTC, John Roden
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Roden 2008-10-23 18:58:51 UTC
The g++ compiler reports the error "internal compiler error: Segmentation fault" when the attached (reduced) file is compiled. The fault seems to depend on inclusion of a destructor (last (only) method in the file).  If the destructor is omitted, the file compiles.  The error originally occurred when a single space was added to a string -- the attached, preprocessed, file was reduced from the original by a process of elimination.

g++ version info:
     g++ (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)

I have not been able to test this on a later version of the compiler.  

Attached file:

     gcc_fault_example.ii    (preprocessed)
Comment 1 John Roden 2008-10-23 19:01:09 UTC
Created attachment 16533 [details]
Test Case -- preprocessed code
Comment 2 Richard Biener 2008-10-24 11:44:03 UTC
Works for me with 4.3.0, 4.3.1 and 4.3.2.  What options did you use to get
the segfault?
Comment 3 John Roden 2008-10-24 14:43:25 UTC
I think I have mis-stated this bug as a compiler fault.  When I tried to 
reproduce it just now it did not happen again.  The reason appears to be that I 
restarted my machine.

The environment is Fedora 9 running in a VMware virtual machine (VMware Server
VMX 1.0.6.26355; Server Console 1.0.6 build 91891) under Microsoft Windows 
Vista (SP1 + later updates). It had been running for about a week when the 
problem occurred. It happened again and again yesterday but exactly the same 
code now works perfectly.  It looks as if something happened in the VMware 
machine. (It did not occur to me to try a restart).

I think you can change the status to "works for me" and close the bug report.

For the record, the fault occurred with the simple command line:

    g++ -c /tmp/gcc_fault_example.ii

Thanks for the rapid response.
 
Comment 4 Andrew Pinski 2009-10-05 03:05:00 UTC
So mentioned close as works for me.