Bug 84226 - htons() broken for Pentium 4
htons() broken for Pentium 4
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
8.0
other Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-02-13 12:54 EST by Matt Peterson
Modified: 2016-11-24 10:24 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-02-13 15:00:12 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Short test program that uses htons() to build packet buffer (1.57 KB, text/plain)
2003-02-13 12:59 EST, Matt Peterson
no flags Details

  None (edit)
Description Matt Peterson 2003-02-13 12:54:08 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003

Description of problem:
It appears as though the htons implementation has some problems on Pentium 4.  I
have attached the code for a small test program based on code from the OpenSLP
project.  

You'll notice that the buffer generation on RedHat 7.3 differs from Redhat 8.0.
 You'll also notice that buffer generation differs between Pentium 2/3 and
Pentium 4.


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


How reproducible:
Always

Steps to Reproduce:
1.compile program on RH 7.3 and RH 8.0 and compare output
2.compile program on RH 8.0 and compare output when run on Pentium 3 and Pentium 4

    

Actual Results:  
Redhat 7.3 produces correctly formatted buffer.
Redhat 8.0 on Pentium 2/3 produces correctly formatted buffer
Redhat 8.0/8.1 beta produces INCORRECTLY formatted buffer

Expected Results:  
Code generation for htons() should be compatible across pentium family such that
use of htns() to format packet buffers is source/binary compatible across Redhat
distros and all pentium architectures

Additional info: See attached htons_test.c file
Comment 1 Matt Peterson 2003-02-13 12:58:05 EST
Actual results (should say)
Redhat 8.0/8.1 on Pentium 4 beta produces INCORRECTLY formatted buffer
Comment 2 Matt Peterson 2003-02-13 12:59:39 EST
Created attachment 90058 [details]
Short test program that uses htons() to build packet buffer
Comment 3 Jakub Jelinek 2003-02-13 15:00:12 EST
This program has undefined behaviour, see info gcc on -fstrict-aliasing.
You cannot access one memory location (in your testcase char[3]) through
two different pointers which may not alias.

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