Bug 30072 - FAIL: run-addr2line-C-test.sh
Summary: FAIL: run-addr2line-C-test.sh
Status: RESOLVED FIXED
Alias: None
Product: elfutils
Classification: Unclassified
Component: tools (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-03 09:01 UTC by Martin Liska
Modified: 2023-02-03 12:46 UTC (History)
2 users (show)

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


Attachments
Build log (39.77 KB, text/plain)
2023-02-03 09:01 UTC, Martin Liska
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Liska 2023-02-03 09:01:53 UTC
Created attachment 14650 [details]
Build log

The test is pretty new and fails with:

[   30s] FAIL: run-addr2line-C-test.sh
[   30s] =============================
[   30s] 
[   30s] --- addr2line.out	2023-02-03 08:59:30.572855287 +0000
[   30s] +++ -	2023-02-03 08:59:30.576315349 +0000
[   30s] @@ -8,12 +8,12 @@
[   30s]   (inlined by) baz at /tmp/x.cpp:20
[   30s]  0x00000000000005e0: foobar at /tmp/x.cpp:5
[   30s]   (inlined by) bar at /tmp/x.cpp:15
[   30s] - (inlined by) _Z3foov at /tmp/x.cpp:25
[   30s] + (inlined by) foo() at /tmp/x.cpp:25
[   30s]  0x00000000000005e1: fubar at /tmp/x.cpp:10
[   30s]   (inlined by) baz at /tmp/x.cpp:20
[   30s] - (inlined by) _Z3foov at /tmp/x.cpp:26
[   30s] -0x00000000000005f0: _Z2fuv at /tmp/x.cpp:31
[   30s] + (inlined by) foo() at /tmp/x.cpp:26
[   30s] +0x00000000000005f0: fu() at /tmp/x.cpp:31
[   30s]  0x00000000000005f1: fubar at /tmp/x.cpp:10
[   30s] - (inlined by) _Z2fuv at /tmp/x.cpp:32
[   30s] + (inlined by) fu() at /tmp/x.cpp:32
[   30s]  0x00000000000005f2: foobar at /tmp/x.cpp:5
[   30s] - (inlined by) _Z2fuv at /tmp/x.cpp:33
[   30s] + (inlined by) fu() at /tmp/x.cpp:33
[   30s] FAIL run-addr2line-C-test.sh (exit status: 1)
[   30s] 
[   30s] FAIL: run-addr2line-i-test.sh
[   30s] =============================
[   30s] 
[   30s] --- addr2line.out	2023-02-03 08:59:30.612856288 +0000
[   30s] +++ -	2023-02-03 08:59:30.615130217 +0000
[   30s] @@ -1,6 +1,6 @@
[   30s] -_Z6foobari at /tmp/x.cpp:4:14
[   30s] - (inlined by) _Z3fooi at /tmp/x.cpp:22:16
[   30s] - (inlined by) _Z2fui at /tmp/x.cpp:27:13
[   30s] -_Z5fubari at /tmp/x.cpp:10:14
[   30s] - (inlined by) _Z3bari at /tmp/x.cpp:16:15
[   30s] - (inlined by) _Z2fui at /tmp/x.cpp:27:24
[   30s] +foobar(int) at /tmp/x.cpp:4:14
[   30s] + (inlined by) foo(int) at /tmp/x.cpp:22:16
[   30s] + (inlined by) fu(int) at /tmp/x.cpp:27:13
[   30s] +fubar(int) at /tmp/x.cpp:10:14
[   30s] + (inlined by) bar(int) at /tmp/x.cpp:16:15
[   30s] + (inlined by) fu(int) at /tmp/x.cpp:27:24
[   30s] FAIL run-addr2line-i-test.sh (exit status: 1)

So somehow the output is demangled, but the test does not expected it.
Comment 1 Mark Wielaard 2023-02-03 10:06:53 UTC
(In reply to Martin Liska from comment #0)
> Created attachment 14650 [details]
> Build log
> 
> The test is pretty new and fails with:
> 
> [   30s] FAIL: run-addr2line-C-test.sh
> [   30s] =============================
> [   30s] 
> [   30s] --- addr2line.out	2023-02-03 08:59:30.572855287 +0000
> [   30s] +++ -	2023-02-03 08:59:30.576315349 +0000
> [   30s] @@ -8,12 +8,12 @@
> [   30s]   (inlined by) baz at /tmp/x.cpp:20
> [   30s]  0x00000000000005e0: foobar at /tmp/x.cpp:5
> [   30s]   (inlined by) bar at /tmp/x.cpp:15
> [   30s] - (inlined by) _Z3foov at /tmp/x.cpp:25
> [   30s] + (inlined by) foo() at /tmp/x.cpp:25
> [   30s]  0x00000000000005e1: fubar at /tmp/x.cpp:10
> [   30s]   (inlined by) baz at /tmp/x.cpp:20
> [   30s] - (inlined by) _Z3foov at /tmp/x.cpp:26
> [   30s] -0x00000000000005f0: _Z2fuv at /tmp/x.cpp:31
> [   30s] + (inlined by) foo() at /tmp/x.cpp:26
> [   30s] +0x00000000000005f0: fu() at /tmp/x.cpp:31
> [   30s]  0x00000000000005f1: fubar at /tmp/x.cpp:10
> [   30s] - (inlined by) _Z2fuv at /tmp/x.cpp:32
> [   30s] + (inlined by) fu() at /tmp/x.cpp:32
> [   30s]  0x00000000000005f2: foobar at /tmp/x.cpp:5
> [   30s] - (inlined by) _Z2fuv at /tmp/x.cpp:33
> [   30s] + (inlined by) fu() at /tmp/x.cpp:33
> [   30s] FAIL run-addr2line-C-test.sh (exit status: 1)
> [   30s] 
> [   30s] FAIL: run-addr2line-i-test.sh
> [   30s] =============================
> [   30s] 
> [   30s] --- addr2line.out	2023-02-03 08:59:30.612856288 +0000
> [   30s] +++ -	2023-02-03 08:59:30.615130217 +0000
> [   30s] @@ -1,6 +1,6 @@
> [   30s] -_Z6foobari at /tmp/x.cpp:4:14
> [   30s] - (inlined by) _Z3fooi at /tmp/x.cpp:22:16
> [   30s] - (inlined by) _Z2fui at /tmp/x.cpp:27:13
> [   30s] -_Z5fubari at /tmp/x.cpp:10:14
> [   30s] - (inlined by) _Z3bari at /tmp/x.cpp:16:15
> [   30s] - (inlined by) _Z2fui at /tmp/x.cpp:27:24
> [   30s] +foobar(int) at /tmp/x.cpp:4:14
> [   30s] + (inlined by) foo(int) at /tmp/x.cpp:22:16
> [   30s] + (inlined by) fu(int) at /tmp/x.cpp:27:13
> [   30s] +fubar(int) at /tmp/x.cpp:10:14
> [   30s] + (inlined by) bar(int) at /tmp/x.cpp:16:15
> [   30s] + (inlined by) fu(int) at /tmp/x.cpp:27:24
> [   30s] FAIL run-addr2line-i-test.sh (exit status: 1)
> 
> So somehow the output is demangled, but the test does not expected it.

It looks like the other way around (but the test-suite.log is confusing).
Could you check whether configure detected DEMANGLE support?

    libstdc++ demangle support         : yes

If not, then the fix would be:

diff --git a/tests/run-addr2line-C-test.sh b/tests/run-addr2line-C-test.sh
index 8c63d78d..1780157d 100755
--- a/tests/run-addr2line-C-test.sh
+++ b/tests/run-addr2line-C-test.sh
@@ -18,6 +18,11 @@
 
 . $srcdir/test-subr.sh
 
+if test -n "$ELFUTILS_DISABLE_DEMANGLE"; then
+  echo "demangler unsupported"
+  exit 77
+fi
+
 # See run-addr2line-i-test.sh
 testfiles testfile-inlines
Comment 2 Martin Liska 2023-02-03 12:36:33 UTC
> It looks like the other way around (but the test-suite.log is confusing).
> Could you check whether configure detected DEMANGLE support?
> 
>     libstdc++ demangle support         : yes

Yes, I really miss it:

configure:8679: checking for __cxa_demangle in -lstdc++
configure:8702: gcc -o conftest -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -ffat-lto-objects -Werror=date-time -g  -flto=auto -ffat-lto-objects conftest.c -lstdc++   >&5
/usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: cannot find -lstdc++: No such file or directory
collect2: error: ld returned 1 exit status
configure:8702: $? = 1
configure: failed program was:

Oh, apparently my spec file has not BuildRequires of the gcc-c++ package. Adding that, all is green.

> 
> If not, then the fix would be:
> 
> diff --git a/tests/run-addr2line-C-test.sh b/tests/run-addr2line-C-test.sh
> index 8c63d78d..1780157d 100755
> --- a/tests/run-addr2line-C-test.sh
> +++ b/tests/run-addr2line-C-test.sh
> @@ -18,6 +18,11 @@
>  
>  . $srcdir/test-subr.sh
>  
> +if test -n "$ELFUTILS_DISABLE_DEMANGLE"; then
> +  echo "demangler unsupported"
> +  exit 77
> +fi
> +
>  # See run-addr2line-i-test.sh
>  testfiles testfile-inlines

This would fix it as well..
Comment 3 Mark Wielaard 2023-02-03 12:46:02 UTC
commit dd3c621ff36f73cb26d89a2fd5ea384a5b33334c
Author: Mark Wielaard <mark@klomp.org>
Date:   Fri Feb 3 13:44:17 2023 +0100

    tests: Check ELFUTILS_DISABLE_DEMANGLE in run-addr2line-C-test.sh
    
    https://sourceware.org/bugzilla/show_bug.cgi?id=30072
    
    Signed-off-by: Mark Wielaard <mark@klomp.org>