This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Running testsuite with /proc/sys/kernel/core_uses_pid set, avoiding leaving core dump files behind
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <pedro at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org, Tom Tromey <tromey at redhat dot com>
- Date: Thu, 8 Sep 2011 21:12:42 +0200
- Subject: Re: Running testsuite with /proc/sys/kernel/core_uses_pid set, avoiding leaving core dump files behind
- References: <201109071718.38581.pedro@codesourcery.com>
On Wed, 07 Sep 2011 18:18:38 +0200, Pedro Alves wrote:
> I now only end up with a single unexpected core dump after a
> testrun, generated by the typeddwarf binary of typeddwarf.exp
> (a SIGSEGV). I'm not sure what's going on here. Looking at
> the .c file, there doesn't seem to be anything that should crash.
It is linked from .exp with -nostdlib, therefore there is no _exit syscall but
ret, jumping into a garbage.
> What I find strange is that the typeddwarf-amd64.S
> file claims to be generated by
>
> "gcc -S -g -O2 typeddwarf.c -o typeddwarf-amd64.S"
>
> but typeddwarf-amd64.S doesn't contain a main label, it
> has a _start label instead, so it looks like it got hand
> massaged a bit.
I agree.
> Indeed, if I compile typeddwarf.c
> directly, I get a binary that does not crash.
As you did not use -nostdlib:
if { [prepare_for_testing "${test}.exp" "${test}" ${sfile} {nodebug additional_flags=-nostdlib}] } {
The reason for -nostdlib is:
Re: Regression: Re: RFC: implement typed DWARF stack
http://sourceware.org/ml/gdb-patches/2011-05/msg00325.html
to be able to run it with -m32 even on system without 32-bit devel libraries
installed.
Still I do not get any core file from this testcase, either with linux-nat or
with gdbserver, in both cases the program gets properly killed before it
crashes.
Thanks,
Jan