Bug 144782 - non-integer bytes in gcc
Summary: non-integer bytes in gcc
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc
Version: 3.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-01-11 15:13 UTC by Matt Jamison
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-01-18 13:58:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Matt Jamison 2005-01-11 15:13:18 UTC
The issue is in the way a character string is initialized from the first
bytes of memory on the stack.  In the past, the first byte was
predictably a non-integer.  With libstdc++-3.2.3-49 and
gcc-c++-3.2.3-49, the first byte is predictably "4".  We found this
because we passed it directly to ATOI() which understands integers as
valid input and non-integers as junk.

In this case, the fault was on our end for disobeying the docs and
assuming that junk would be junk.  However, the implications are
interesting if other, more high profile programs, make that same
assumption.  Also, I didn't want to have called you with a "bug" without
giving you some kind of followup.

Comment 1 Jakub Jelinek 2005-01-12 00:12:23 UTC
From the incomplete description this sounds like you are triggering undefined
behaviour, so anything can happen.  That would mean NOTABUG resolution.
If you post a (selfcontained) testcase what exactly you're talking about,
I'll look at it, but without a testcase this will be NOTABUGed soon.

Comment 2 Jakub Jelinek 2005-01-18 13:58:19 UTC
Assuming NOTABUG, if you have self-contained testcase, please reopen.


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