strangest bug ever!

All timestamps are based on your local time of:

Posted by: stak
Posted on: 2004-12-02 18:31:03

so i came across this really weird bug today.. haven't quite cracked it yet, but it has something to do with aligned memory access. i write to a variable and then read it - that works fine if the variable is aligned on a word boundary. however, if it's not, then the value written gets shifted so that it IS aligned, and then when i read it back, it reads the unaligned value, which is messed up. argh.

stupid arm processor.

Posted by kats at 2004-12-03 18:15:59
turns out the value was being written with the 16-bit halves reversed. still.. stupid arm processor.
Allowed expansions in comments/replies: [i]italic[/i], [u]underline[/u], [b]bold[/b], [code]code[/code], [sub]subscript[/sub], [sup]superscript[/sup], [url=http://some.url]linked text[/url]
Human verification: Sum of thirty-two and forty-one =
Posted by John at 2004-12-03 21:44:22
The 16-bit halves were reversed?

That's just wierd. If anything, I'd have expected that to be a big/little endian problem... but then all four bytes would be out of whack.

Oh well... I'll just add it to the knowledge base... *makes humanoid/computer beeping noises*
[ Reply to this ]
Posted by kats at 2004-12-11 10:24:42
yeah, but the app specifically accounted for big/little endian problems since it has to run on like 50 platforms. anyway, problem's fixed.. just had to add some padding so that the value was aligned.

but still.. argh.
[ Reply to this ]

[ Add a new comment ]

(c) Kartikaya Gupta, 2004-2023. User comments owned by their respective posters. All rights reserved.
You are accessing this website via IPv4. Consider upgrading to IPv6!