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 77350 - gcc3 segfaults on struct/flexible array with bad initializer.
gcc3 segfaults on struct/flexible array with bad initializer.
Product: Red Hat Linux
Classification: Retired
Component: gcc3 (Show other bugs)
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2002-11-05 12:41 EST by Joe Krahn
Modified: 2007-04-18 12:48 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-01 16:39:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Joe Krahn 2002-11-05 12:41:09 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.79 [en] (X11; U; Linux 2.4.18-17.8.0 i686)

Description of problem:
I created some code with a variable sized type
within a struct typedef, then tried to initialize it with
data from another array (improper code).

This caused gcc3 to segfault. Seems to only occur with
bas code, so probably not a serious problem, except that
segfaults are always bad.

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

How reproducible:

Steps to Reproduce:
1. run gcc3 -c on the code listed in Additional Info.

Actual Results:  bug.c:10: internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.

Expected Results:  This is what gcc 2.9x gives:
bug2.c:3: array size missing in `points'
bug2.c:8: incompatible types in initialization
bug2.c:8: initializer element is not constant
bug2.c:8: (near initialization for `p1.points[0][0]')

Additional info:

/* Example bug source (nice and short) */
typedef struct {
        int n;
        float points[][2];
} polygon_t ;

float p1_points[][2]={{1,2},{3,4}};

polygon_t p1 = { 2, p1_points };
Comment 1 Vladimir Makarov 2004-10-01 16:39:48 EDT
I've checked the current state of redhat gcc3 branch
(gcc-3_2-rhl8-branch).  The bug was gone.  Therefore we are closing
the case.

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