Bug 192930 - libcups httpAddrGetList miscompiled at -O2
Summary: libcups httpAddrGetList miscompiled at -O2
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
(Show other bugs)
Version: 5
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 192628
TreeView+ depends on / blocked
 
Reported: 2006-05-24 10:19 UTC by Tim Waugh
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-05-24 16:12:07 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
http-addrlist.c (243.08 KB, text/plain)
2006-05-24 10:21 UTC, Tim Waugh
no flags Details

Description Tim Waugh 2006-05-24 10:19:46 UTC
Description of problem:
The httpAddrGetList() function from libcups (cups-1.2.1/cups/http-addrlist.c) is
miscompiled at -O2.  The symptom is that
httpAddrGetList("localhost",AF_UNSPEC,"631") fails to return an address when
/etc/hosts looks like this:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               primary
127.0.0.1               localhost.localdomain

There is code in httpAddrGetList() specifically to handle such a misconfigured
/etc/hosts, but it is not getting triggered because an automatic local variable
(addr) is not getting correctly initialized.

Version-Release number of selected component (if applicable):
gcc-4.1.0-3, also
gcc-4.1.0-17

How reproducible:
100%

Steps to Reproduce:

1. Back up /etc/hosts

2.

cat >/etc/hosts <<"EOF"
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               primary
127.0.0.1               localhost.localdomain
EOF 

gcc -g -O2 -o http-addrlist http-addrlist.c
./http-addrlist

Actual results:
failure

Expected results:
success

Additional info:
Original bug report is bug #192628.

Comment 1 Tim Waugh 2006-05-24 10:21:00 UTC
Created attachment 129909 [details]
http-addrlist.c

Comment 2 Tim Waugh 2006-05-24 13:24:07 UTC
Hmm, test case seems to always say 'failure'.  I will try to distill it again.

FWIW, compiling the original with '-O2 -fno-strict-aliasing' makes no difference.

Comment 3 Tim Waugh 2006-05-24 16:12:07 UTC
Oh, never mind, false alarm.  Sorry for the noise.


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