Bug 1027003 - g++ seg-faults on syntax error in vector<vector<T>> initializer
g++ seg-faults on syntax error in vector<vector<T>> initializer
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: gcc (Show other bugs)
x86_64 Linux
unspecified Severity unspecified
: rc
: 6.6
Assigned To: Jason Merrill
Miroslav Franc
Depends On:
Blocks: 1023566 1056252
  Show dependency treegraph
Reported: 2013-11-05 16:06 EST by Rob P
Modified: 2016-01-31 21:28 EST (History)
7 users (show)

See Also:
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:
Last Closed: 2014-10-14 01:01:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Source code. Title is VTTest.C (2.67 KB, text/plain)
2013-11-05 16:06 EST, Rob P
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 43028 None None None Never

  None (edit)
Description Rob P 2013-11-05 16:06:43 EST
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 Product and Program Management 2013-11-08 16:55:52 EST
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 17:32:56 EST
Fixed by http://gcc.gnu.org/viewcvs/gcc?view=revision&revision=159045 -- safe and eligible for backport.
Comment 12 errata-xmlrpc 2014-10-14 01:01:30 EDT
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.


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