This is the mail archive of the
mailing list for the glibc project.
Re: Add tests that backtrace and backtrace_symbols produce correctresults
- From: Carlos O'Donell <carlos at systemhalted dot org>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 17 Jan 2013 23:46:22 -0500
- Subject: Re: Add tests that backtrace and backtrace_symbols produce correctresults
- References: <Pine.LNX.email@example.com>
On 01/17/2013 09:30 PM, Joseph S. Myers wrote:
> The existing tests of the backtrace and backtrace_symbols functions,
> debug/backtrace-tst.c and nptl/tst-backtrace1.c, test essentially
> nothing beyond that the functions succeed rather than (for example)
> segfaulting. In particular, they do not test anything about the
> correctness of the backtraces generated.
> This patch adds some tests that backtraces generated are correct.
> (These tests have been in EGLIBC for some time. There's also another
> test there, tst-backtrace6.c, which tests for backtraces involving
> noreturn functions - an important case, since people may well want to
> backtrace through code that called "abort". However, that runs into
> problems on some architectures when the return address for the
> noreturn function is after the end of the calling function. I think
> dealing with such cases reliably would involved a new variant of the
> backtrace function that uses _Unwind_GetIPInfo instead of
> _Unwind_GetIP to ensure it always produces an address within the
> correct function. So this patch just includes those tests that
> already work without needing such new interfaces.)
> Tested x86_64 and x86.
> 2013-01-18 Joseph Myers <firstname.lastname@example.org>
> Mark Mitchell <email@example.com>
> Tom de Vries <firstname.lastname@example.org>
> Paul Pluzhnikov <email@example.com>
> * debug/tst-backtrace2.c: New file.
> * debug/tst-backtrace3.c: Likewise.
> * debug/tst-backtrace4.c: Likewise.
> * debug/tst-backtrace5.c: Likewise.
> * debug/Makefile (CFLAGS-tst-backtrace2.c): New variable.
> (CFLAGS-tst-backtrace3.c): Likewise.
> (CFLAGS-tst-backtrace4.c): Likewise.
> (CFLAGS-tst-backtrace5.c): Likewise.
> (LDFLAGS-tst-backtrace2): Likewise.
> (LDFLAGS-tst-backtrace3): Likewise.
> (LDFLAGS-tst-backtrace4): Likewise.
> (LDFLAGS-tst-backtrace5): Likewise.
> (tests): Add new tests tst-backtrace2, tst-backtrace3,
> tst-backtrace4 and tst-backtrace5.
Looks good to me. Great addition to the testsuite!