Bug 1027003

Summary: g++ seg-faults on syntax error in vector<vector<T>> initializer
Product: Red Hat Enterprise Linux 6 Reporter: Rob P <rob>
Component: gccAssignee: Jason Merrill <jason>
Status: CLOSED ERRATA QA Contact: Miroslav Franc <mfranc>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: law, mcermak, mfranc, mnewsome, mpolacek, ohudlick, tlavigne
Target Milestone: rc   
Target Release: 6.6   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: gcc-4.4.7-5.el6 Doc Type: Bug Fix
Doc Text:
Previously, G++ would crash on an invalid code in the gnu++11 mode when using an initializer list with invalid value in its constructor. This has been fixed in such a way that the constructor is better checked for an erroneous values.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-14 05:01:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1023566, 1056252    
Attachments:
Description Flags
Source code. Title is VTTest.C none

Description Rob P 2013-11-05 21:06:43 UTC
Created attachment 820014 [details]
Source code. Title is VTTest.C

Description of problem:
If a programmer mismatches angle brackets while using initializer lists to create a C++ vector<vector<T> > object, g++ can seg-fault instead of throwing a syntax error. An example is shown in the attached short piece of code.
Apologies if this has been fixed already. I'm new to this site and had trouble accessing the "frequently reported bugs" list; our web browser here at work is several years out of date.

Version-Release number of selected component (if applicable):
gcc version 4.4.7-3

How reproducible:
Everything needed to reproduce this should be in the attached text.

Steps to Reproduce:
Compile the attached text with "g++ -std=gnu++0x -c VTTest.C".

Actual results:
Segmentation fault.

Expected results:
Syntax error.

Additional info:
While I was tracking down this bug, I came across an (apparently unrelated) second issue. I suspect the second issue is probably an error on my part rather than a bug. However, I decided to mention it anyways. It is described briefly as a "sidenote" in the definition of the Tag class in the attached text.

Comment 2 RHEL Program Management 2013-11-08 21:55:52 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 Marek Polacek 2014-02-11 22:32:56 UTC
Fixed by http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=159045 -- safe and eligible for backport.

Comment 12 errata-xmlrpc 2014-10-14 05:01:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-1377.html