From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manish Katiyar Subject: Re: Question about core files Date: Tue, 6 Oct 2009 20:11:43 +0530 Message-ID: References: Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=UGFkuLnBn8XYUBO+Yt2qJTaUriL19FGdd5NCgayDj10=; b=UNK8kV9KJcEFG+MkKhvReFFj5JfcPj92pEp8ol6NSKoyhGSSfp0PNyqqJs78rBBiZX 2BFuroJkAQAHsPDZF8eaP/Cyc9LgH8UDaAWBbOWBbPXnnGa0tHfLIBvMX3tyqa0vkRL5 I43mHpSlnhKmbym2ulLmHMw2m04XoPFgPppQI= In-Reply-To: Sender: linux-c-programming-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="iso-8859-1" To: Holger Kiehl Cc: linux-c-programming@vger.kernel.org On Tue, Oct 6, 2009 at 7:34 PM, Holger Kiehl wrot= e: > Hello > > Most the time I compile my application without the -g option due to > performance reasons. Problem is that when it hits some bug and dumps > core, this is not very useful because there is hardly any information > in it. Is there some way to get some useful information out of > the core file. Is it possible to post your code ? Atleast the start_process() function. Given that you have got a sigsegv it is probably an invalid pointer access. You can also try to print $eip (or rip since this is 64 bit machine) and look around the assembly . Output of "disas start_process" from gdb will also help. > For example one of my program crashed and with gdb > I see the following: > > =A0 afd@helena:~$ gdb fd core.2515 > =A0 GNU gdb Fedora (6.8-24.fc9) > =A0 Copyright (C) 2008 Free Software Foundation, Inc. > =A0 License GPLv3+: GNU GPL version 3 or later > > =A0 This is free software: you are free to change and redistribute it= =2E > =A0 There is NO WARRANTY, to the extent permitted by law. =A0Type "sh= ow copying" > =A0 and "show warranty" for details. > =A0 This GDB was configured as "x86_64-redhat-linux-gnu"... > =A0 (no debugging symbols found) > > =A0 warning: Can't read pathname for load map: Input/output error. > =A0 Reading symbols from /lib64/libc-2.8.so...Reading symbols from > /usr/lib/debug/lib64/libc-2.8.so.debug...done. > =A0 done. > =A0 Loaded symbols for /lib64/libc-2.8.so > =A0 Reading symbols from /lib64/ld-2.8.so...Reading symbols from > /usr/lib/debug/lib64/ld-2.8.so.debug...done. > =A0 done. > =A0 Loaded symbols for /lib64/ld-2.8.so > =A0 Reading symbols from /lib64/libnss_files-2.8.so...Reading symbols= from > /usr/lib/debug/lib64/libnss_files-2.8.so.debug...done. > =A0 done. > =A0 Loaded symbols for /lib64/libnss_files-2.8.so > =A0 Core was generated by `fd -w /home/afd'. > =A0 Program terminated with signal 6, Aborted. > =A0 [New process 2515] > =A0 #0 =A00x000000304cc32215 in raise (sig=3D) > =A0 =A0 =A0 at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 > =A0 64 =A0 =A0 =A0 =A0return INLINE_SYSCALL (tgkill, 3, pid, selftid,= sig); > =A0 (gdb) where > =A0 #0 =A00x000000304cc32215 in raise (sig=3D) > =A0 =A0 =A0 at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 > =A0 #1 =A00x000000304cc33d83 in abort () at abort.c:88 > =A0 #2 =A00x000000000040b174 in sig_segv () > =A0 #3 =A0 > =A0 #4 =A00x0000000000404b5f in start_process () > =A0 #5 =A00x0000000000407b9a in main () > > At least I know that the bug is in my function start_process. But is > there some way to find out at what line it happened? > > Thanks, > Holger > -- > To unsubscribe from this list: send the line "unsubscribe > linux-c-programming" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at =A0http://vger.kernel.org/majordomo-info.html > --=20 Thanks - Manish =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [$\*.^ -- I miss being one of them =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D -- To unsubscribe from this list: send the line "unsubscribe linux-c-progr= amming" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html