Bug 205919 - ICE related to std::vector<std::vector<...> > >
Summary: ICE related to std::vector<std::vector<...> > >
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc
Version: 4.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-09-10 05:30 UTC by Hui Li
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version: RHSA-2007-0220
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-05-01 17:08:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
This is the preprocessed output. (2.13 MB, text/text)
2006-09-10 05:36 UTC, Hui Li
no flags Details
Reduced testcase (262 bytes, text/x-c++src)
2006-10-26 06:21 UTC, Alexandre Oliva
no flags Details
Patch that fixes the bug (2.44 KB, patch)
2006-10-26 07:09 UTC, Alexandre Oliva
no flags Details | Diff
Safer patch that fixes the bug (853 bytes, patch)
2006-10-27 06:36 UTC, Alexandre Oliva
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2007:0220 0 normal SHIPPED_LIVE Moderate: gcc security and bug fix update 2007-05-01 17:07:43 UTC

Description Hui Li 2006-09-10 05:30:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; zh-cn) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3

Description of problem:
This bug seems to relate to accessing elements of a std::vector<std::vector<some_type> > > object using 
double subscripting [...][...].  However, when I tried with a simplified code, the falure didn't reproduce, so I 
guess vector of vector is just part of the reason of this bug.

Version-Release number of selected component (if applicable):
gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)

How reproducible:
Always


Steps to Reproduce:
1. Just compile the proprocessed code.

Actual Results:
internal compiler error: Segmentation fault

where accessing element of std::vector<std::vector<some_type> > > using [...][...] failed.

Expected Results:


Additional info:
I found a simple work-around, i.e. to separate the [...][..] into two steps. For example, let V be of the type 
std::vector<std::vector<some_type> > >, instead of writing V[i][j], writing

const std::vector<some_type>& w = V[i];
w[j];

solved the problem.

Comment 1 Hui Li 2006-09-10 05:36:56 UTC
Created attachment 135915 [details]
This is the preprocessed output.

Comment 2 Alexandre Oliva 2006-10-26 06:21:20 UTC
Created attachment 139437 [details]
Reduced testcase

Comment 3 Alexandre Oliva 2006-10-26 07:09:00 UTC
Created attachment 139441 [details]
Patch that fixes the bug

This backport fixes the ICE in both the reduced and the original testcases.  I
had to cherry-pick only a few portions of the original patch, and the most
important change (the removal of the obsolete new-type-id) isn't appropriate
for GCC 3.4 because it wasn't obsolete then.  I've tried to overcome the
problem with a simplification that I hope will work, but my testing isn't
complete yet and I'm not entirely familiar with the workings of this old
new-type-id construct.	I'd appreciate a second pair of g++-familiar eyeballs
on this change.

Comment 4 Alexandre Oliva 2006-10-27 06:36:12 UTC
Created attachment 139556 [details]
Safer patch that fixes the bug

This patch is much safer and fixes the problem just the same.

Comment 10 Red Hat Bugzilla 2007-05-01 17:08:11 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2007-0220.html



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