* Re: unalinged traps
@ 1999-03-13 5:00 Michael Weber
0 siblings, 0 replies; 3+ messages in thread
From: Michael Weber @ 1999-03-13 5:00 UTC (permalink / raw)
On Fri, 12 Mar 1999 15:51:22 -0500, Jacob C Gladish <jcgst28@pop.pitt.edu>
> Well, i'd liek to fix the ones I find. Can anyone explain how you would
> go about doing this.Specifically, how would I got about finding out
> where this occured in what source file.
"Unaligned trap-fixing [for user-space programs]" nano-HOWTO:
1.) compile your program P with "CFLAGS += -g" for debugging symbols.
*Don't* strip it. [BTW: Using find, my Alpha says a binary is stripped,
regardless whether it is or not...]
2.) Start P. wait for an unaligned trap in syslog. *Don't* kill the program.
If it segfaults [uncommon], have a look at the core (gdb ./P core)
3a.) Read The Fine Manual of gdb (info gdb)
3b.) start gdb with
# gdb ./P `pidof P`
4.) gdb will tell you that is has attached to the program, it is stopped
then.
5.) At the gdb prompt, type:
> list *0x<fill in the address from syslog... that big hex number
until the first whitespace should do>
You should see the offending lines in source code. If not, maybe gdb is
complaining about pathnames of source files. IIRC, you have to start gdb
in the same directory where you typed "make".
6.) Look at the displayed code for type casts between long and int, or type
casts at all. They're IMHO the most common causes...
7.) Fix it. Sometimes the compiler warns about these lines, too. Having P
compile cleanly is at least an indicator for doing The Right Thing(TM).
HTH,
Michael
BTW: If someone knows how to gdb the kernel for unaligned traps, I'm
interested...
--
That hurts:
"Hi, I'm new at Alpha..this might sound dumb even..
Can I install Windows 95/98 on Dec Alpha machine?"
-- Brian Seo in comp.os.linux.alpha
^ permalink raw reply [flat|nested] 3+ messages in thread* unalinged traps
@ 1999-03-12 5:00 Jacob C Gladish
1999-03-13 5:00 ` Anton Ertl
0 siblings, 1 reply; 3+ messages in thread
From: Jacob C Gladish @ 1999-03-12 5:00 UTC (permalink / raw)
I've read in the FAQ that about the cause of unaligned trap, and it
mentions that you may want to take time to fix the ones that you find.
Well, i'd liek to fix the ones I find. Can anyone explain how you would
go about doing this.Specifically, how would I got about finding out
where this occured in what source file.
thanks for any help
jake
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1999-03-13 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-13 5:00 unalinged traps Michael Weber
-- strict thread matches above, loose matches on Subject: below --
1999-03-12 5:00 Jacob C Gladish
1999-03-13 5:00 ` Anton Ertl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox