Re: debugging segfault before main.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Karl Hiramoto wrote:
Hi all,

I'm looking for suggestions how to debug a segfault i have before main(). I'm thinking now that this is probably coming from one of the ten shared libraries i link to, but i don't know which one. I recently upgraded from kernel 2.6.16, uclibc 0.28, gcc 3.4.6 to kernel 2.6.25, uclibc 0.29, gcc 4.2.4 and this problem started.


# gdb /usr/bin/myprog
GNU gdb 6.6
Copyright (C) 2006 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 "armeb-linux-uclibc"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) break _init
Breakpoint 1 at 0xb6cc
(gdb) break main
Breakpoint 2 at 0xc4f8: file /home/karl/Work/myprog.c, line 355.
(gdb) run
Starting program: /usr/bin/myprog
[Thread debugging using libthread_db enabled]
[New Thread 1024 (LWP 894)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 894)]
0x400d1578 in _pthread_cleanup_push_defer () from /lib/libc.so.0
(gdb)



The only thing i have left to try, is to start to eliminate the libraries i link to, to try and find which one it is.


Some similar problems to mine, but not really helping me:
http://gcc.gnu.org/ml/libstdc++/1999-q4/msg00219.html
http://gcc.gnu.org/ml/gcc-help/1999-10/msg00485.html


Any suggestions welcome..

Thanks.

karl.


figured this out myself, by removing all libs, then readding them till i found which lib caused the problem. Found that the problematic lib was being compilled with -pthread even though it did not use threads.

--

--
Karl Hiramoto  http://karl.hiramoto.org/



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux