Bug 23901 - run-backtrace-native-core returns error isntead of skip
Summary: run-backtrace-native-core returns error isntead of skip
Status: RESOLVED FIXED
Alias: None
Product: elfutils
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-20 18:31 UTC by Kurt Roeckx
Modified: 2018-11-21 19:10 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Roeckx 2018-11-20 18:31:27 UTC
On MIPS I get:

FAIL: run-backtrace-native-core.sh
==================================

/<<PKGBUILDDIR>>/tests/backtrace: dwfl_pid: Unwinding not supported for this architecture
backtrace-child-core.9086: arch not supported
rmdir: failed to remove 'test-9078': Directory not empty
FAIL run-backtrace-native-core.sh (exit status: 1)
Comment 1 Mark Wielaard 2018-11-20 18:51:50 UTC
That is indeed weird. It should exit 77 on that message.
But it seems there is something left in that test-9078 test subdir.
That would indeed make it fail. What is in that dir?

Note that there is no MIPS backend support, so failures are expected.

It might be that you have local debian patches that provide some MIPS support which might explain the issue.

It would be nice to have a MIPS arch expert submit these patches upstream to get official MIPS support for elfutils.
Comment 2 Kurt Roeckx 2018-11-20 19:47:06 UTC
Yes, I've had this mips patch written in 2006. But I've been unable to contact the author of that. It has had various fixes since, but the current version also has other issues, see: https://buildd.debian.org/status/fetch.php?pkg=elfutils&arch=mips&ver=0.175-1&stamp=1542667301&raw=0

Anyway, the directory contains:
-rw------- 1 kroeckx kroeckx 8790016 Nov 20 19:23 core.10371
-rw-r--r-- 1 kroeckx kroeckx       0 Nov 20 19:23 core.10371.bt
-rw-r--r-- 1 kroeckx kroeckx     102 Nov 20 19:23 core.10371.err
Comment 3 Mark Wielaard 2018-11-21 12:10:15 UTC
Odd, the trap on exit really should remove those.
But explicitly cleaning the test files seems to work:

diff --git a/tests/backtrace-subr.sh b/tests/backtrace-subr.sh
index ff42c6f..53c719d 100644
--- a/tests/backtrace-subr.sh
+++ b/tests/backtrace-subr.sh
@@ -85,6 +85,7 @@ check_unsupported()
   testname=$2
   if grep -q ': Unwinding not supported for this architecture$' $err; then
     echo >&2 $testname: arch not supported
+    test_cleanup
     exit 77
   fi
 }
Comment 4 Kurt Roeckx 2018-11-21 19:02:24 UTC
I can confirm that the patch fixes the issue for me.
Comment 5 Mark Wielaard 2018-11-21 19:10:03 UTC
commit 628b4a93c6863b9982d817db6acaacbc4e116453
Author: Mark Wielaard <mark@klomp.org>
Date:   Wed Nov 21 20:07:14 2018 +0100

    tests: Call test_cleanup in backtrace-subr.sh check_unsupported.
    
    We want to make sure all (temporary) test files are cleaned up even when
    we exit 77 to skip the testcase.
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=23901
    
    Tested-by: Kurt Roeckx <kurt@roeckx.be>
    Signed-off-by: Mark Wielaard <mark@klomp.org>