Skip to contentSkip to conversation

Alpha: bad unaligned access handling

DISCUSSION Jan-Benedict Glaw 3 participants 5 messages Feb 14, 2001

lore
Share & tools
lore
#0 lore raw

Hi!

With my currently installed ping (netkit-ping 0.10-6 from Debian Woody) I get unaligned accesses:

ping(15953): unaligned trap at 00000001200030e4: 0000000120026b34 29 1 ping(15953): unaligned trap at 0000000120003110: 0000000120026b2c 29 2

The worse part is: they seem to be handled The Wrong Way:

[jbglaw@air:/home/jbglaw] $> ping -c 1 localhost PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=13.8 ms wrong data byte #8 should be 0x8 but was 0xdc

        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 

--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 13.8/13.8/13.8 ms

This is on a NoName Alpha box, running 2.4.0-test8-pre1 (with very good uptimes), but I think 2.4.2-pre2 would do the same (wrong) things as arch/alpha/kernel/traps.c wasn't really changed since ages... I don't know much about alpha assemlbly language so somebody else should have a look at that;( Btw., when such an unaligned trap has happened, I also get transmit timeouts on my network card (which is:
00:0c.0 Ethernet controller: 3Com Corporation 3c905 100BaseTX [Boomerang]

NETDEV WATCHDOG: eth0: transmit timed out
eth0: transmit timed out, tx_status 00 status e000.
Flags; bus-master 1, full 1; dirty 1470429(13) current 1470445(13). Transmit list 477a42d0 vs. fffffc00077a42d0.
0: @fffffc00077a4200 length 80000042 status 00000042
...

MfG, JBG

Signature · 4 lines
Fehler eingestehen, Größe zeigen: Nehmt die Rechtschreibreform zurück!!!
/* Jan-Benedict Glaw <[email protected]> -- +49-177-5601720 */
keyID=0x8399E1BB fingerprint=250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB
     "insmod vi.o and there we go..." (Alexander Viro on linux-kernel)
#1 lore raw

Jan-Benedict Glaw ([email protected]) wrote on 14 February 2001 15:48:

Quoted 15 lines

With my currently installed ping (netkit-ping 0.10-6 from Debian Woody) I get unaligned accesses:

ping(15953): unaligned trap at 00000001200030e4: 0000000120026b34 29 1 ping(15953): unaligned trap at 0000000120003110: 0000000120026b2c 29 2

The worse part is: they seem to be handled The Wrong Way:

[jbglaw@air:/home/jbglaw] $> ping -c 1 localhost PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=13.8 ms wrong data byte #8 should be 0x8 but was 0xdc

       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 
Quoted 8 lines

--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 13.8/13.8/13.8 ms

This is on a NoName Alpha box, running 2.4.0-test8-pre1 (with very good uptimes), but I think 2.4.2-pre2 would do the same (wrong) things as arch/alpha/kernel/traps.c wasn't really changed since ages...

I also get these, with 2.2.18pre5 (plus some Andrea patches) and vanilla 2.2.19pre10 on a SMP UP2000.

#2 lore raw
In reply to Jan-Benedict Glaw
Quoted 21 lines · Carlos Carvalho

Jan-Benedict Glaw ([email protected]) wrote on 14 February 2001 15:48:

Quoted 20 lines

With my currently installed ping (netkit-ping 0.10-6 from Debian Woody) I get unaligned accesses:

ping(15953): unaligned trap at 00000001200030e4: 0000000120026b34 29 1 ping(15953): unaligned trap at 0000000120003110: 0000000120026b2c 29 2

The worse part is: they seem to be handled The Wrong Way:

[jbglaw@air:/home/jbglaw] $> ping -c 1 localhost PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=13.8 ms wrong data byte #8 should be 0x8 but was 0xdc

       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 

--- localhost ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 13.8/13.8/13.8 ms

Quoted 6 lines
Quoted 3 lines

This is on a NoName Alpha box, running 2.4.0-test8-pre1 (with very good uptimes), but I think 2.4.2-pre2 would do the same (wrong) things as arch/alpha/kernel/traps.c wasn't really changed since ages...

I also get these, with 2.2.18pre5 (plus some Andrea patches) and vanilla 2.2.19pre10 on a SMP UP2000.

This is an application problem, not a kernel one. You need to upgrade your netkit.

Sean

P.S. I wrote a small wrapper to aid in the debugging of unaligned traps, which I'll send to anyone who's interested.

Quoted 5 lines

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#3 lore raw

Sean Hunter ([email protected]) wrote on 14 February 2001 17:26:

Quoted 2 lines

This is an application problem, not a kernel one. You need to upgrade your netkit.

Yes, I was quite confident of this. However, unaligned traps are a frequent problem with alphas. For a looong time we had zsh produce lots of it, to the point of making it unusable. Strangely, the problem disappeared without changing anything in zsh. It was either a library or kernel problem.

Quoted 2 lines

P.S. I wrote a small wrapper to aid in the debugging of unaligned traps, which I'll send to anyone who's interested.

I'd like it!

#4 lore raw
In reply to Jan-Benedict Glaw
Quoted 9 lines · Carlos Carvalho

Sean Hunter ([email protected]) wrote on 14 February 2001 17:26:

Quoted 2 lines

This is an application problem, not a kernel one. You need to upgrade your netkit.

Yes, I was quite confident of this. However, unaligned traps are a frequent problem with alphas. For a looong time we had zsh produce lots of it, to the point of making it unusable. Strangely, the problem disappeared without changing anything in zsh. It was either a library or kernel problem.

Definitely library, I'd think.

Quoted 6 lines
Quoted 3 lines

P.S. I wrote a small wrapper to aid in the debugging of unaligned traps, which I'll send to anyone who's interested.

I'd like it!

OK, my alpha is a sick bunny at the moment, so I'll have to wait until I get home (so I can see why I can't ssh to it). What the wrapper does is set some settings so your program gets sigbus when it generates an unaligned trap, and then runs your program in gdb so gdb helpfully stops at the line which generated the trap. It goes without saying you need to build the program in question with debugging symbols so that you see the code.

You then need to fix the unaligned access. This sometimes requires real alpha guruhood (Which I do not possess, but Richard Henderson or Michal Jagerman do, if you need advice), but sometimes simply requires adding __attribute__ ((__unaligned__)) to a struct member in a c file.

Sean