Bug 109283 - G++ Internal Error: Seg Fault, easily repeatable
Summary: G++ Internal Error: Seg Fault, easily repeatable
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-11-06 15:20 UTC by Maciej Żenczykowski
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version: 3.3.2-2
Clone Of:
Environment:
Last Closed: 2004-10-02 18:26:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
g++ -save-temps z.cpp (52.02 KB, application/octet-stream)
2003-11-07 20:41 UTC, Maciej Żenczykowski
no flags Details

Description Maciej Żenczykowski 2003-11-06 15:20:30 UTC
Component: gcc-3.3.2-1
Reproducible: Always

Description of problem:
$ g++ --version
g++ (GCC) 3.3.2 20031022 (Red Hat Linux 3.3.2-1)

$ g++ sshfs.cpp
g++: Internal error: Segmentation fault (program cc1plus)

this is on file lufs-0.9.7/filesystems/sshfs/sshfs.cpp
from http://lufs.sourceforge.net

Comment 1 Jakub Jelinek 2003-11-06 15:24:16 UTC
In that case g++ should have stored preprocessed output to a temporary
file and told you where it is.  Please attach it here.
If it did not create this file, please preprocess it yourself
(g++ -save-temps sshfs.cpp) and attach sshfs.ii it creates.

Comment 2 Maciej Żenczykowski 2003-11-06 17:46:38 UTC
I've distilled the problem down to the following:

#include <string>                                                    
                                
                                                                     
                                
using namespace std;                                                 
                                
                                                                     
                                
struct S { string str; } v;                                          
                                
                                                                     
                                
int main (void) {                                                    
                                
  v = (struct S){string("str")};                                     
                                
}                                                                    
                                

Hope this is enough.

Comment 3 Maciej Żenczykowski 2003-11-06 17:57:13 UTC
Indeed even this is enough:

#include <string>                                                    
                                
using namespace std;                                                 
                                
string string_var;                                                   
                                
struct S { string str; } v;                                          
                                
int main () { v = (struct S){string_var}; }                          
                                


Comment 4 Maciej Żenczykowski 2003-11-07 20:41:19 UTC
Created attachment 95804 [details]
g++ -save-temps z.cpp

The z.ii file created by g++ -save-temps z.cpp (which segfaults with an empty
z.s)
#include <string>
using namespace std;
string string_var;
struct S { string str; } v;
int main() { v = (struct S){string_var}; }

Comment 5 Jakub Jelinek 2003-11-08 20:10:13 UTC
This looks badly like http://gcc.gnu.org/PR12726
Will be fixed in gcc-3.3.2-2.


Note You need to log in before you can comment on or make changes to this bug.