Bug 192930 - libcups httpAddrGetList miscompiled at -O2
libcups httpAddrGetList miscompiled at -O2
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
5
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks: 192628
  Show dependency treegraph
 
Reported: 2006-05-24 06:19 EDT by Tim Waugh
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-05-24 12:12:07 EDT
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 06:21 EDT, Tim Waugh
no flags Details

  None (edit)
Description Tim Waugh 2006-05-24 06:19:46 EDT
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 06:21:00 EDT
Created attachment 129909 [details]
http-addrlist.c
Comment 2 Tim Waugh 2006-05-24 09:24:07 EDT
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 12:12:07 EDT
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.