Running testsuite with /proc/sys/kernel/core_uses_pid set, avoiding leaving core dump files behind

Jan Kratochvil jan.kratochvil@redhat.com
Thu Sep 8 19:54:00 GMT 2011


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



More information about the Gdb-patches mailing list