gdb bus error(core dump), from linking in a library
Ramana Radhakrishnan
ramana.radhakrishnan@codito.com
Thu Mar 18 02:38:00 GMT 2004
Grant,
>Help!.. gdb keeps core dumping on me(with a bus error). I've stripped the
>app down to a hello world c program. It still core'd. I figured out it is a
>particular library that I am linking in(pkgl in my below example). Anyone
>know why linking in a certain library would cause gdb to core dump? This is
>just driving me nuts as I can't stand having to do printf debugging in an
>app... I need my debugger! :>
>
>
It would be helpful if you sent a copy of your program as well as your
library , maybe then we can see what is happening .
I understand that everyone would like to use their "debugger" but (To
quote from one of Michaels earlier mails. ) it would help everyone if
you told us about :
What computer and operating system are you using?
What compiler are you using to compile 'fun'?
What version of the compiler are you using?
What command line switches do you use to compile your program?
What command line switches do you use to link your program?
Can you make a small sample program which shows this problem?
Then use the 'script' command. 'cat' the program,
compile and link the program, run gdb on the program,
exit 'script', and mail us the typescript.
In this case maybe you can also tell us where we can get the library you are linking in from / version?
cheers
ramana
>How I compile/link this app.
>
> gcc -c -g ba1_main.c
> gcc -g -L/home/gschoep/pkgl/lib -o ba1 ba1_main.o -Bstatic -lpkgl
>
>This is what I get when I run the am in the debugger(it runs fine outside
>the debugger)
>
>gschoep@weasel>263% gdb ./ba1
>GNU gdb 6.0
>Copyright 2003 Free Software Foundation, Inc.
>GDB is free software, covered by the GNU General Public License, and you are
>welcome to change it and/or distribute copies of it under certain
>conditions. Type "show copying" to see the conditions. There is absolutely
>no warranty for GDB. Type "show warranty" for details. This GDB was
>configured as "sparc-sun-solaris2.9"...
>(gdb) run
>Starting program: /silver/home/gschoep/test/ipc/gdbtest/ba1
>Bus error (core dumped)
>
>
>I am using gcc 3.3.2, gdb 6.0
>
>
>Any ideas?
>
>Thanks
>-grant
>
>
More information about the Gdb
mailing list