From: Bryan R. <br...@ix...> - 2000-11-28 20:36:35
|
Philipp Rumpf wrote: > gas warns about unaligned .longs. gcc should never generate unaligned > accesses unless you use weird casting or assembler code. Basically, I think the problem was with code like this: --- #include <stdio.h> struct structone { unsigned short foo; unsigned short bar; unsigned short moo; }; struct structtwo { unsigned char blah; unsigned long boom; }; int main(void) { static struct structone bleep = {1, 2, 3}; static struct structtwo bloop = {1, 2}; bleep.foo=1; bloop.boom=2; printf("%ld",bloop.boom); return 0; } --- I will test that exact snippet on the SH4 and see if we are still having problems. If we are, I guess it's due to the linker either not aligning structtwo or not aligning boom within structtwo? As far as I know that code is standard, valid ANSI C. Please note: we're not using the latest toolchain here, and therefore, can't use the latest kernels. I would hate to go chasing after an already fixed bug, so I will look into testing the other engineer's code with the latest stuff as soon as possible. > shouldn't happen. indeed. > It sends a SIGSEGV. I'm currently looking into adding a siginfo struct > with sufficient information to emulate unaligned accesses efficiently. Ok... in this particular case the unaligned access was coming from a child pthread. Perhaps the pthread parent caught the SIGSEGV and zombied all the children? (sounds like a b-rate horror film) > If you don't see your process's exit status your test environment is broken. Just to make sure--when a process catches, say, a SIGSEGV and hasn't installed a special handler for it, it's up to the shell to display the termination message? I am using the BusyBox shell which may not do so, in which case I will submit a patch to those guys to at least handle SIGSEGV... > if the process doesn't die with SEGV there's another kernel bug. One which may have already been fixed. I will further investigate this issue when I get some spare time (heh, in a year or two). Thanks for the reply, Bryan -- Bryan Rittmeyer mailto:br...@ix... Ixia Communications 26601 W. Agoura Rd. Calabasas, CA 91302 |