Bug 1105791 - g++: internal compiler error: Segmentation fault (program cc1plus)
Summary: g++: internal compiler error: Segmentation fault (program cc1plus)
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 20
Hardware: i686
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-07 19:26 UTC by don
Modified: 2014-06-24 16:01 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-06-24 16:01:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
bug.cpp (810 bytes, text/plain)
2014-06-07 19:26 UTC, don
no flags Details
bug-expects-success.cpp (1.31 KB, text/plain)
2014-06-11 14:10 UTC, don
no flags Details

Description don 2014-06-07 19:26:04 UTC
Description of problem:
internal compiler error: Segmentation fault (program cc1plus)

Version-Release number of selected component (if applicable):
gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC)

How reproducible:
Always

Steps to Reproduce:
g++ bug.cpp

Actual results:
Segmentation fault

Expected results:
In this case, a valid error message. There may be other programs which are correct code and segfault like this - in which case, success would be expected.

Comment 1 don 2014-06-07 19:26:44 UTC
Created attachment 903155 [details]
bug.cpp

Comment 2 don 2014-06-10 17:59:48 UTC
The stack trace appears to be infinite recursion in:

walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, pointer_set_t*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, pointer_set_t*)) ()

(The start of the stack is inaccessible in gdb, as gdb requires many gigabytes of memory to process it.)

Comment 3 don 2014-06-11 14:10:19 UTC
Created attachment 907682 [details]
bug-expects-success.cpp

I was able to construct a file where successful compilation is expected, but it still segfaults in the same way as the original file.  The stack trace looks the same at the end, so presumably it's the same underlying bug.

`gcc -c bug-expects-success.cpp` will succeed if you lower the "200" number(s) inside the file.

Comment 4 Jakub Jelinek 2014-06-24 16:01:15 UTC
I've filed it upstream as http://gcc.gnu.org/PR61592 , for the time being the answer is just don't do something so silly, i.e. don't use non-POD types in very large arrays.


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