Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 78413 - (alpha) deflate.c mis-compiled with -O2
Summary: (alpha) deflate.c mis-compiled with -O2
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: gcc3
Version: 1.0
Hardware: alpha
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Richard Henderson
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-11-22 16:13 UTC by Jeff Johnson
Modified: 2007-04-18 16:48 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-01-31 05:21:40 UTC


Attachments (Terms of Use)
file to reproduce problem (deleted)
2002-11-22 16:15 UTC, Jeff Johnson
no flags Details

Description Jeff Johnson 2002-11-22 16:13:33 UTC
Description of Problem:


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


How Reproducible:


Steps to Reproduce:
1. gzip lutBS08.pcf segfaults
2. compile deflate.c with -O0 rather than -O2
3. gzip lutBS08.pcf compresses

Actual Results:


Expected Results:


Additional Information:

Comment 1 Jeff Johnson 2002-11-22 16:15:17 UTC
Created attachment 86066 [details]
file to reproduce problem

Comment 2 Jeff Johnson 2002-11-22 16:16:45 UTC
Workaround (compile deflate.c with -O0) in gzip-1.3.3-7

Comment 3 Jeff Johnson 2002-12-02 15:01:06 UTC
This smells like a compiler bug, since -O0 is a fix.

Bounce back to gzip so I can get the workaround removed, please.

Comment 4 Richard Henderson 2003-01-31 05:21:40 UTC
Using no optimization does *not* fix the problem for me.
I see the same crash with all files compiled -O0.  Sticking
the debugger on this shows that the program is walking off
the end of the data segment.

I rebuilt gzip with gcc 2.96, which does not exhibit the
crash and debugged things there, trying to see what happens
differently.  Turns out: nothing at all.  The code really 
does walk off the end of the "window" array.

With the 2.96 compiler, the data segment is aligned differently,
and the end of the last page ends 0x1990 bytes past the end of
the window array.  With the 3.2 compiler, the last page ends 
0xd0 bytes past the end of the array.




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