Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 123547 - C++ crash with segmentation violation
C++ crash with segmentation violation
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2004-05-19 05:47 EDT by Göran Uddeborg
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-01-04 08:20:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Test case triggering the crash. (265 bytes, text/plain)
2004-05-19 05:50 EDT, Göran Uddeborg
no flags Details

  None (edit)
Description Göran Uddeborg 2004-05-19 05:47:52 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.4.2)

Description of problem:
When compiling the test case, the compiler crashes with an internal
error/segmentation fault.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. c++ -c an.cc

Additional info:
Comment 1 Göran Uddeborg 2004-05-19 05:50:58 EDT
Created attachment 100323 [details]
Test case triggering the crash.
Comment 2 Jakub Jelinek 2004-05-25 05:22:11 EDT
This is crash on invalid input, so lowering priority.
Comment 3 Göran Uddeborg 2004-05-25 06:00:46 EDT
> This is crash on invalid input

True.  In the original case it was quite hard to see what was invalid
though! :-)
Comment 4 Jakub Jelinek 2005-01-04 08:20:54 EST
Self-contained testcase:
struct A { void foo (); };
struct B {
  enum E { EE };
  struct C { A c; void foo () { c.foo(); }; };
  E bar ();

B::E B::bar () {}

This is really fixed for good just with the new parser in GCC 3.4+.  Particular problem is lastiddecl handling and that in case of syntax errors it gets out
of sync from the actual identifier node.
A quick hack like:
--- gcc/cp/semantics.c     2005-01-04 10:25:30.000000000 +0100
+++ gcc/cp/semantics.c 2005-01-04 14:06:56.385999603 +0100
@@ -1965,6 +1965,8 @@ enter_scope_of (sr)
   tree scope = TREE_OPERAND (sr, 0);

+  if (scope == NULL || scope == error_mark_node)
+    return;
   if (TREE_CODE (scope) == NAMESPACE_DECL)
       push_decl_namespace (scope);

gets rid of the ICE, but is IMHO not suitable for RHEL3.

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