There can be more than 3 frames, but depending on the system/installed glibc we might not be able to unwind fully till the end. cxxfunc -> f -> main Expect to see the top two and a warning that there are more frames (exit code 1)
Signed-off-by: Mark Wielaard mjw@redhat.com --- tests/ChangeLog | 4 ++++ tests/run-backtrace-demangle.sh | 13 +++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/tests/ChangeLog b/tests/ChangeLog index 1b84f3a..098093a 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2014-01-16 Mark Wielaard mjw@redhat.com + + * run-backtrace-demangle.sh: Check exitcode and max number of frames. + 2014-01-15 Jan Kratochvil jan.kratochvil@redhat.com
Fix corruption of non-C++ symbols by the demangler. diff --git a/tests/run-backtrace-demangle.sh b/tests/run-backtrace-demangle.sh index b5bddeb..6e18e77 100755 --- a/tests/run-backtrace-demangle.sh +++ b/tests/run-backtrace-demangle.sh @@ -20,13 +20,22 @@ if test -n "$ELFUTILS_DISABLE_DEMANGLE"; then fi
. $srcdir/backtrace-subr.sh -set -x
child=testfile-backtrace-demangle testfiles $child{,.core} tempfiles $child.{bt,err} -testrun ${abs_top_builddir}/src/stack -e $child --core $child.core >$child.bt 2>$child.err + +# There can be more than 3 frames, but depending on the system/installed +# glibc we might not be able to unwind fully till the end. +# cxxfunc -> f -> main +# Expect to see the top two and a warning that there are more frames +# (exit code 1) +testrun ${abs_top_builddir}/src/stack -n 2 -e $child --core $child.core >$child.bt 2>$child.err || exitcode=$? cat $child.{bt,err} +if test $exitcode != 1 || ! grep "shown max number of frames" $child.err; then + echo >&2 $2: expected more than 2 frames + false +fi if ! grep -w f $child.bt; then echo >&2 $2: no f false
On Thu, 16 Jan 2014 09:45:51 +0100, Mark Wielaard wrote:
There can be more than 3 frames, but depending on the system/installed glibc we might not be able to unwind fully till the end. cxxfunc -> f -> main Expect to see the top two and a warning that there are more frames (exit code 1)
I agree there should be something like ' || true' but which system cannot unwind 'main'? IIUC the 2 frames (and not 3 frames).
THanks, Jan
On Sat, Jan 18, 2014 at 07:27:50PM +0100, Jan Kratochvil wrote:
On Thu, 16 Jan 2014 09:45:51 +0100, Mark Wielaard wrote:
There can be more than 3 frames, but depending on the system/installed glibc we might not be able to unwind fully till the end. cxxfunc -> f -> main Expect to see the top two and a warning that there are more frames (exit code 1)
I agree there should be something like ' || true' but which system cannot unwind 'main'? IIUC the 2 frames (and not 3 frames).
You are right. 3 frames would also work since they all come from the main executable. I just picked 2 because the test only needs and checks the top two, "cxxfunc" and "f", but it can also be 3.
Cheers,
Mark
On Sat, 18 Jan 2014 21:29:40 +0100, Mark Wielaard wrote:
On Sat, Jan 18, 2014 at 07:27:50PM +0100, Jan Kratochvil wrote:
I agree there should be something like ' || true' but which system cannot unwind 'main'? IIUC the 2 frames (and not 3 frames).
You are right. 3 frames would also work since they all come from the main executable. I just picked 2 because the test only needs and checks the top two, "cxxfunc" and "f", but it can also be 3.
OK, yes, I agree with the patch now.
Thanks, Jan
On Sat, 2014-01-18 at 22:04 +0100, Jan Kratochvil wrote:
On Sat, 18 Jan 2014 21:29:40 +0100, Mark Wielaard wrote:
On Sat, Jan 18, 2014 at 07:27:50PM +0100, Jan Kratochvil wrote:
I agree there should be something like ' || true' but which system cannot unwind 'main'? IIUC the 2 frames (and not 3 frames).
You are right. 3 frames would also work since they all come from the main executable. I just picked 2 because the test only needs and checks the top two, "cxxfunc" and "f", but it can also be 3.
OK, yes, I agree with the patch now.
pushed to master.
Thanks,
Mark
elfutils-devel@lists.fedorahosted.org