Bug 1786

Summary: Unaligned Trap and Wrong Data Byte in ping.
Product: [Retired] Red Hat Linux Reporter: Richard D. Payne <rdp>
Component: netkit-baseAssignee: Jay Turner <jturner>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: dwmw2, folke, gnw, srevivo, steveu
Target Milestone: ---   
Target Release: ---   
Hardware: alpha   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-05-24 20:06:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Richard D. Payne 1999-03-25 16:12:13 UTC
PING nobleman.alpha-processor.com (192.233.60.249): 56 data
bytes
64 bytes from 192.233.60.249: icmp_seq=0 ttl=128 time=0.4 ms
wrong data byte #8 should be 0x8 but was 0xf5
        c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d
1e 1f 20 21 22 23 24 2
5 26 27 28 29 2a 2b
        2c 2d 2e 2f 0 0 0 0 0 0 0 0 ff ff ff ff

Comment 1 Richard D. Payne 1999-03-26 20:52:59 UTC
Same things are happening with traceroute.

Comment 2 Richard D. Payne 1999-04-08 16:07:59 UTC
The problem still exists with 5.9.7.

Comment 3 Jeff Johnson 1999-04-09 17:48:59 UTC
This smells like a problem with ICMP in the alpha kernel.

Comment 4 Jeff Johnson 1999-04-17 17:37:59 UTC
I can reproduce the ping (but not the traceroute) problem.
I'm going to try the ping from iputils.

Comment 5 Jeff Johnson 1999-04-28 14:42:59 UTC
*** Bug 2391 has been marked as a duplicate of this bug. ***

The summary says it all. Ping gives unaligned trap errors,
apparantly under all circumstances.

Comment 6 Jeff Johnson 1999-05-05 11:50:59 UTC
*** Bug 2562 has been marked as a duplicate of this bug. ***

Networking is fine - only ping is complaining....

64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=0.1 ms
wrong data byte #8 should be 0x8 but was 0xe9
        c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b
        2c 2d 2e 2f 0 0 0 0 0 0 0 0 0 0 0 0
64 bytes from 127.0.0.1: icmp_seq=1 ttl=255 time=0.0 ms
wrong data byte #8 should be 0x8 but was 0x5
        c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b
        2c 2d 2e 2f 0 0 0 0 0 0 0 0 0 0 0 0

... and doing unaligned memory accesses...
ping(8664): unaligned trap at 0000000120002b04: 0000000120117784 29 1
ping(8664): unaligned trap at 0000000120002b2c: 000000012011777c 29 2

Comment 7 Jeff Johnson 1999-05-05 11:51:59 UTC
*** Bug 2563 has been marked as a duplicate of this bug. ***

Networking is fine - only ping is complaining....

64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=0.1 ms
wrong data byte #8 should be 0x8 but was 0xe9
        c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b
        2c 2d 2e 2f 0 0 0 0 0 0 0 0 0 0 0 0
64 bytes from 127.0.0.1: icmp_seq=1 ttl=255 time=0.0 ms
wrong data byte #8 should be 0x8 but was 0x5
        c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b
        2c 2d 2e 2f 0 0 0 0 0 0 0 0 0 0 0 0

... and doing unaligned memory accesses...
ping(8664): unaligned trap at 0000000120002b04: 0000000120117784 29 1
ping(8664): unaligned trap at 0000000120002b2c: 000000012011777c 29 2

Comment 8 Jeff Johnson 1999-05-07 18:00:59 UTC
*** Bug 2638 has been marked as a duplicate of this bug. ***

Every successful ping is returning the following errors:

PING www.yahoo.com (204.71.200.68): 56 data bytes
64 bytes from 204.71.200.68: icmp_seq=0 ttl=250 time=26.0 ms
wrong data byte #8 should be 0x8 but was 0x10
        c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e
1f 20 21 22 23 24 2
5 26 27 28 29 2a 2b
        2c 2d 2e 2f 0 0 0 0 0 0 0 0 0 0 0 0
64 bytes from 204.71.200.68: icmp_seq=1 ttl=250 time=23.4 ms
wrong data byte #8 should be 0x8 but was 0xe4
        c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e
1f 20 21 22 23 24 2
5 26 27 28 29 2a 2b
        2c 2d 2e 2f 0 0 0 0 0 0 0 0 0 0 0 0
64 bytes from 204.71.200.68: icmp_seq=2 ttl=250 time=25.2 ms
wrong data byte #8 should be 0x8 but was 0xcb
        c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e
1f 20 21 22 23 24 2
5 26 27 28 29 2a 2b
        2c 2d 2e 2f 0 0 0 0 0 0 0 0 0 0 0 0

Comment 9 Jeff Johnson 1999-05-24 20:06:59 UTC
Fixed (ping anyways) in netkit-base-0.10-31.
Please reopen if traceroute needs attention.

Comment 10 Jeff Johnson 1999-05-27 15:52:59 UTC
*** Bug 2391 has been marked as a duplicate of this bug. ***

The summary says it all. Ping gives unaligned trap errors,
apparantly under all circumstances.

------- Additional Comments From jbj  04/28/99 10:42 -------


*** This bug has been marked as a duplicate of 1786 ***

Comment 11 Jeff Johnson 1999-05-31 15:19:59 UTC
*** Bug 3173 has been marked as a duplicate of this bug. ***

1. Broken ping: see comp.os.linux.alpha - 8 bit error
2. Ethernet does not work - works fine with redhat 5.2!

1.
Subject: PATCH: broken ping on RH 6.0
Date: Fri, 14 May 1999 17:41:46 +0200
From: Alex Rhomberg <rhomberg.ethz.ch>
Organization: Electronics Lab, ETH Zurich, Switzerland
Newsgroups: comp.os.linux.alpha

ping in netkit 0.11+ assumes that timeval has a length of
eight bytes
and works with 32 bit alignment. This is no longer the case
on my Alphas
running Linux 2.2.5 and Redhat 6.0 (might be due to glibc
2.1??)
Ping generated unaligned traps and erroneously reported
receiving of
wrong data.
This is fixed by the following patch. Note that I did not
read the whole
code but just made some wild guesses. The unaligned traps
and the wrong
data errors are gone.

Regards
- Alex

--- ping.unpatched.c    Fri May 14 17:30:50 1999
+++ ping.c      Fri May 14 17:31:06 1999
@@ -394,7 +394,7 @@
                exit(2);
        }
        if (!(options & F_PINGFILLED))
-               for (i = 8; i < datalen; ++i)
+               for (i = sizeof(struct timeval); i <
datalen; ++i)
                        *datap++ = i;

        ident = getpid() & 0xFFFF;
@@ -657,11 +657,18 @@
                        return;                 /* 'Twas not
our ECHO */
                ++nreceived;
                if (timing) {
+                 struct timeval temp_tv;
 #ifndef icmp_data
                        tp = (struct timeval *)(icp + 1);
 #else
                        tp = (struct timeval
*)icp->icmp_data;
 #endif
+                       if((long)tp % sizeof(tp->tv_sec))
+                       {
+                         char *unaligned_pointer = (char
*)tp;
+                         tp = &temp_tv;
+                         memcpy(tp, unaligned_pointer,
sizeof(struct
timeval));
+                       }
                        tvsub(&tv, tp);
                        triptime = tv.tv_sec * 10000 +
(tv.tv_usec /
100);
                        tsum += triptime;
@@ -697,9 +704,9 @@
                                (void)printf(" (DUP!)");
                        /* check the data */
 #ifndef icmp_data
-                       cp = ((u_char*)(icp + 1) + 8);
+                       cp = ((u_char*)(icp + 1) +
sizeof(struct
timeval));
 #else
-                       cp = (u_char*)icp->icmp_data + 8;
+                       cp = (u_char*)icp->icmp_data +
sizeof(struct
timeval);
 #endif
                        dp = &outpack[8 + sizeof(struct
timeval)];
                        for (i = 8; i < datalen; ++i, ++cp,
++dp) {

--

____________________________________________________________
_____
 /
       \
|  Alex Rhomberg                           Tel: +41 1 632 49
18     |
|  Institut fuer Elektronik                Fax: +41 1 632 12
10     |
|  ETH Zuerich                        Zentrale: +41 1 632 11
11     |
|  Gloriastrasse 35
        |
|  8092 Zuerich               ema1) The broken ping on alpha has been fixed.
2) Dunno about "Ethernet does not work" -- more information is needed.il: rhomberg.ethz.ch
       |

\___________________________________________________________
______/