From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13414 invoked by alias); 18 Jul 2008 13:22:55 -0000 Received: (qmail 13400 invoked by uid 22791); 18 Jul 2008 13:22:54 -0000 X-Spam-Check-By: sourceware.org Received: from sd-green-bigip-202.dreamhost.com (HELO spunkymail-a17.g.dreamhost.com) (208.97.132.202) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 18 Jul 2008 13:22:25 +0000 Received: from [192.168.69.3] (85.Red-83-54-219.dynamicIP.rima-tde.net [83.54.219.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by spunkymail-a17.g.dreamhost.com (Postfix) with ESMTP id 6ABFB75244 for ; Fri, 18 Jul 2008 06:22:20 -0700 (PDT) Message-ID: <48809905.50806@hiramoto.org> Date: Fri, 18 Jul 2008 13:34:00 -0000 From: Karl Hiramoto User-Agent: Thunderbird 2.0.0.14 (X11/20080508) MIME-Version: 1.0 To: gcc-help@gcc.gnu.org Subject: Re: debugging segfault before main. References: <48805DEC.9090205@hiramoto.org> In-Reply-To: <48805DEC.9090205@hiramoto.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2008-07/txt/msg00215.txt.bz2 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/