Bug 109283 - G++ Internal Error: Seg Fault, easily repeatable
G++ Internal Error: Seg Fault, easily repeatable
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2003-11-06 10:20 EST by Maciej Żenczykowski
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version: 3.3.2-2
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-02 14:26:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Maciej Żenczykowski 2003-11-06 10:20:30 EST
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 10:24:16 EST
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 12:46:38 EST
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 12:57:13 EST
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 15:41:19 EST
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
#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 15:10:13 EST
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.