From: vinit dhatrak <vinit.dhatrak@gmail.com>
To: Holger Kiehl <Holger.Kiehl@dwd.de>
Cc: linux-c-programming@vger.kernel.org
Subject: Re: Question about core files
Date: Wed, 7 Oct 2009 10:28:17 +0530 [thread overview]
Message-ID: <edf0f34e0910062158o4c06ba11l2b14331b6a6f46af@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0910061349060.9660@praktifix.dwd.de>
On Tue, Oct 6, 2009 at 7:34 PM, Holger Kiehl <Holger.Kiehl@dwd.de> wrote:
> 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
GCC allows you to use -g option with -O flag. Here is what "man gcc" says,
[snip]
GCC allows you to use -g with -O. The shortcuts taken by
optimized code may occasionally produce surprising results: some
variables you declared may not exist at all; flow of control may
briefly move where you did not expect it; some statements may not be
executed because they compute constant results or their values were
already at hand; some statements may execute in different places
because they were moved out of loops.
[\snip]
-Vinit
> 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. For example one of my program crashed and with gdb
> I see the following:
>
> afd@helena:~$ gdb fd core.2515
> GNU gdb Fedora (6.8-24.fc9)
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-redhat-linux-gnu"...
> (no debugging symbols found)
>
> warning: Can't read pathname for load map: Input/output error.
> Reading symbols from /lib64/libc-2.8.so...Reading symbols from
> /usr/lib/debug/lib64/libc-2.8.so.debug...done.
> done.
> Loaded symbols for /lib64/libc-2.8.so
> Reading symbols from /lib64/ld-2.8.so...Reading symbols from
> /usr/lib/debug/lib64/ld-2.8.so.debug...done.
> done.
> Loaded symbols for /lib64/ld-2.8.so
> Reading symbols from /lib64/libnss_files-2.8.so...Reading symbols from
> /usr/lib/debug/lib64/libnss_files-2.8.so.debug...done.
> done.
> Loaded symbols for /lib64/libnss_files-2.8.so
> Core was generated by `fd -w /home/afd'.
> Program terminated with signal 6, Aborted.
> [New process 2515]
> #0 0x000000304cc32215 in raise (sig=<value optimized out>)
> at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> 64 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
> (gdb) where
> #0 0x000000304cc32215 in raise (sig=<value optimized out>)
> at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> #1 0x000000304cc33d83 in abort () at abort.c:88
> #2 0x000000000040b174 in sig_segv ()
> #3 <signal handler called>
> #4 0x0000000000404b5f in start_process ()
> #5 0x0000000000407b9a 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 http://vger.kernel.org/majordomo-info.html
>
--
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 http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2009-10-07 4:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 14:04 Question about core files Holger Kiehl
2009-10-06 14:41 ` Manish Katiyar
2009-10-07 13:28 ` Holger Kiehl
2009-10-07 13:54 ` Manish Katiyar
2009-10-07 14:21 ` Holger Kiehl
2009-10-07 17:36 ` Manish Katiyar
2009-10-08 18:47 ` Manish Katiyar
2009-10-09 12:09 ` Holger Kiehl
2009-10-09 12:15 ` Manish Katiyar
2009-10-09 12:43 ` Holger Kiehl
2009-10-10 8:35 ` Glynn Clements
2009-10-10 9:08 ` Manish Katiyar
2009-10-10 16:56 ` Holger Kiehl
2009-10-07 4:45 ` Glynn Clements
2009-10-07 13:43 ` Holger Kiehl
2009-10-08 0:28 ` Glynn Clements
2009-10-09 12:12 ` Holger Kiehl
2009-10-07 4:58 ` vinit dhatrak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=edf0f34e0910062158o4c06ba11l2b14331b6a6f46af@mail.gmail.com \
--to=vinit.dhatrak@gmail.com \
--cc=Holger.Kiehl@dwd.de \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).