Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] elfutils: Fix backtrace ptests on musl
@ 2026-10-22 15:49 Khem Raj
  2026-10-24 17:31 ` [OE-core] " Mathieu Dubois-Briand
  2026-12-01  8:14 ` [PATCH v2] " Khem Raj
  0 siblings, 2 replies; 5+ messages in thread
From: Khem Raj @ 2026-10-22 15:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj

musl is built with -fno-asynchronous-unwind-tables, so libc.so carries
almost no .eh_frame and its CFI only lives in .debug_frame. Without it the
unwinder cannot get out of abort () and run-backtrace-dwarf.sh fails with
"No DWARF information found". Add musl-dbg to the ptest dependencies, like
glibc-dbg for glibc.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 meta/recipes-devtools/elfutils/elfutils_0.197.bb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/recipes-devtools/elfutils/elfutils_0.197.bb b/meta/recipes-devtools/elfutils/elfutils_0.197.bb
index 6e58afb274..b06505d520 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.197.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.197.bb
@@ -52,6 +52,7 @@ EXTRA_OECONF:append:class-target = " --disable-tests-rpath"
 EXTRA_OECONF:append:class-target:microblaze = " --disable-symbol-versioning"
 
 RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-dbg glibc-dev"
+RDEPENDS:${PN}-ptest:append:libc-musl = " musl-dbg"
 INSANE_SKIP:${PN}-ptest = "debug-deps dev-deps"
 
 do_compile_ptest() {

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [OE-core] [PATCH] elfutils: Fix backtrace ptests on musl
  2026-10-22 15:49 [PATCH] elfutils: Fix backtrace ptests on musl Khem Raj
@ 2026-10-24 17:31 ` Mathieu Dubois-Briand
  2026-12-01  8:14 ` [PATCH v2] " Khem Raj
  1 sibling, 0 replies; 5+ messages in thread
From: Mathieu Dubois-Briand @ 2026-10-24 17:31 UTC (permalink / raw)
  To: raj.khem, openembedded-core; +Cc: Khem Raj

On Thu Oct 22, 2026 at 5:49 PM CEST, Khem Raj via lists.openembedded.org wrote:
> musl is built with -fno-asynchronous-unwind-tables, so libc.so carries
> almost no .eh_frame and its CFI only lives in .debug_frame. Without it the
> unwinder cannot get out of abort () and run-backtrace-dwarf.sh fails with
> "No DWARF information found". Add musl-dbg to the ptest dependencies, like
> glibc-dbg for glibc.
>
> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
> ---

Hi Khem,

Thanks for your patch.

It looks like this is breaking some ptest on qemux86-64-musl:

AssertionError:
Failed ptests:
{'elfutils': 'START: ptest-runner\n'
...
             '===============================================================\n'
             '2 of 259 tests did not behave as expected (2 unexpected passes)\n'
             '(45 tests were not run)\n'
             'Please report to https://sourceware.org/bugzilla\n'
             '===============================================================\n'

https://autobuilder.yoctoproject.org/valkyrie/#/builders/110/builds/1435

Can you have a look at the issue?

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] elfutils: Fix backtrace ptests on musl
  2026-10-22 15:49 [PATCH] elfutils: Fix backtrace ptests on musl Khem Raj
  2026-10-24 17:31 ` [OE-core] " Mathieu Dubois-Briand
@ 2026-12-01  8:14 ` Khem Raj
  2026-12-01 15:29   ` Mathieu Dubois-Briand
  2026-12-01 16:52   ` [PATCH v3] " Khem Raj
  1 sibling, 2 replies; 5+ messages in thread
From: Khem Raj @ 2026-12-01  8:14 UTC (permalink / raw)
  To: openembedded-core; +Cc: Khem Raj, Mathieu Dubois-Briand

musl is built with -fno-asynchronous-unwind-tables, so libc.so carries
almost no .eh_frame and its CFI only lives in .debug_frame. Without it the
unwinder cannot get out of abort () and run-backtrace-dwarf.sh fails with
"No DWARF information found". Add musl-dbg to the ptest dependencies, like
glibc-dbg for glibc.

With musl-dbg installed, run-backtrace-data.sh and run-deleted.sh pass
on musl too, so drop them from the musl XFAIL list.

run-deleted.sh still fails on musl when the test library is linked with
lld. lld packs all segments of deleted-lib.so into the first file page,
so musl maps every segment at file offset 0, and once the file is
deleted elfutils cannot find the CFI of libfunc in the copy it reads
back from memory. Keep it as XFAIL for musl with ld-is-lld.
run-backtrace-data.sh is already XFAIL with ld-is-lld.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
v2: Drop run-backtrace-data.sh and run-deleted.sh from the musl XFAIL
    list, they pass with musl-dbg (2 unexpected passes on
    qemux86-64-musl reported by Mathieu Dubois-Briand). Keep
    run-deleted.sh XFAIL for musl with ld-is-lld.

 meta/recipes-devtools/elfutils/elfutils_0.197.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/elfutils/elfutils_0.197.bb b/meta/recipes-devtools/elfutils/elfutils_0.197.bb
index 253e1a65f0..2edb992b94 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.197.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.197.bb
@@ -53,6 +53,7 @@ EXTRA_OECONF:append:class-target = " --disable-tests-rpath"
 EXTRA_OECONF:append:class-target:microblaze = " --disable-symbol-versioning"
 
 RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-dbg glibc-dev"
+RDEPENDS:${PN}-ptest:append:libc-musl = " musl-dbg"
 INSANE_SKIP:${PN}-ptest = "debug-deps dev-deps"
 
 do_compile_ptest() {
@@ -64,7 +65,8 @@ PTEST_PARALLEL_MAKE = ""
 PTEST_XFAILS ?= ""
 # See - https://sourceware.org/bugzilla/show_bug.cgi?id=32232
 PTEST_XFAILS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' run-strip-strmerge.sh run-elflint-self.sh run-backtrace-data.sh run-reverse-sections-self.sh', '', d)}"
-PTEST_XFAILS:append:libc-musl = " run-large-elf-file.sh run-backtrace-data.sh run-backtrace-native.sh run-backtrace-native-core.sh run-stack-d-test.sh run-stack-i-test.sh run-stack-demangled-test.sh run-deleted.sh run-compress-test.sh"
+PTEST_XFAILS:append:libc-musl = " run-large-elf-file.sh run-backtrace-native.sh run-backtrace-native-core.sh run-stack-d-test.sh run-stack-i-test.sh run-stack-demangled-test.sh run-compress-test.sh"
+PTEST_XFAILS:append:libc-musl = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' run-deleted.sh', '', d)}"
 
 ELFUTILS_PTEST_SKIP ?= ""
 ELFUTILS_PTEST_SKIP:append:qemuall = " run-stackprof-system.sh"

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] elfutils: Fix backtrace ptests on musl
  2026-12-01  8:14 ` [PATCH v2] " Khem Raj
@ 2026-12-01 15:29   ` Mathieu Dubois-Briand
  2026-12-01 16:52   ` [PATCH v3] " Khem Raj
  1 sibling, 0 replies; 5+ messages in thread
From: Mathieu Dubois-Briand @ 2026-12-01 15:29 UTC (permalink / raw)
  To: Khem Raj, openembedded-core; +Cc: Khem Raj

On Tue Dec 1, 2026 at 9:14 AM CET, Khem Raj wrote:
> musl is built with -fno-asynchronous-unwind-tables, so libc.so carries
> almost no .eh_frame and its CFI only lives in .debug_frame. Without it the
> unwinder cannot get out of abort () and run-backtrace-dwarf.sh fails with
> "No DWARF information found". Add musl-dbg to the ptest dependencies, like
> glibc-dbg for glibc.
>
> With musl-dbg installed, run-backtrace-data.sh and run-deleted.sh pass
> on musl too, so drop them from the musl XFAIL list.
>
> run-deleted.sh still fails on musl when the test library is linked with
> lld. lld packs all segments of deleted-lib.so into the first file page,
> so musl maps every segment at file offset 0, and once the file is
> deleted elfutils cannot find the CFI of libfunc in the copy it reads
> back from memory. Keep it as XFAIL for musl with ld-is-lld.
> run-backtrace-data.sh is already XFAIL with ld-is-lld.
>
> AI-Generated: Uses Claude Code
> Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
> ---

Hi Khem,

Thanks for the new version.

>  do_compile_ptest() {
> @@ -64,7 +65,8 @@ PTEST_PARALLEL_MAKE = ""
>  PTEST_XFAILS ?= ""
>  # See - https://sourceware.org/bugzilla/show_bug.cgi?id=32232
>  PTEST_XFAILS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' run-strip-strmerge.sh run-elflint-self.sh run-backtrace-data.sh run-reverse-sections-self.sh', '', d)}"
> -PTEST_XFAILS:append:libc-musl = " run-large-elf-file.sh run-backtrace-data.sh run-backtrace-native.sh run-backtrace-native-core.sh run-stack-d-test.sh run-stack-i-test.sh run-stack-demangled-test.sh run-deleted.sh run-compress-test.sh"
> +PTEST_XFAILS:append:libc-musl = " run-large-elf-file.sh run-backtrace-native.sh run-backtrace-native-core.sh run-stack-d-test.sh run-stack-i-test.sh run-stack-demangled-test.sh run-compress-test.sh"
> +PTEST_XFAILS:append:libc-musl = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' run-deleted.sh', '', d)}"

It looks like this is breaking the ptest on qemuarm64-musl:

WARNING: core-image-ptest-elfutils-1.0-r0 do_testimage: There were failing ptests.
Traceback (most recent call last):
  File "/srv/pokybuild/yocto-worker/qemuarm64-musl-ptest/build/layers/openembedded-core/meta/lib/oeqa/runtime/cases/ptest.py", line 27, in test_ptestrunner_expectfail
    self.do_ptestrunner()
  File "/srv/pokybuild/yocto-worker/qemuarm64-musl-ptest/build/layers/openembedded-core/meta/lib/oeqa/runtime/cases/ptest.py", line 121, in do_ptestrunner
    self.fail(failmsg)
AssertionError:
Failed ptests:
{'elfutils': ['run-deleted.sh']}

https://autobuilder.yoctoproject.org/valkyrie/#/builders/109/builds/1667

Can you have a look at that?

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3] elfutils: Fix backtrace ptests on musl
  2026-12-01  8:14 ` [PATCH v2] " Khem Raj
  2026-12-01 15:29   ` Mathieu Dubois-Briand
@ 2026-12-01 16:52   ` Khem Raj
  1 sibling, 0 replies; 5+ messages in thread
From: Khem Raj @ 2026-12-01 16:52 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mathieu Dubois-Briand

musl is built with -fno-asynchronous-unwind-tables, so libc.so carries
almost no .eh_frame and its CFI only lives in .debug_frame. Without it the
unwinder cannot get out of abort () and run-backtrace-dwarf.sh fails with
"No DWARF information found". Add musl-dbg to the ptest dependencies, like
glibc-dbg for glibc.

With musl-dbg installed, run-backtrace-data.sh and run-deleted.sh pass
on musl too, so drop them from the musl XFAIL list.

run-deleted.sh still fails on musl when the test library is linked with
lld. lld packs all segments of deleted-lib.so into the first file page,
so musl maps every segment at file offset 0, and once the file is
deleted elfutils cannot find the CFI of libfunc in the copy it reads
back from memory. Keep it as XFAIL for musl with ld-is-lld.
run-backtrace-data.sh is already XFAIL with ld-is-lld.

It also still fails on aarch64 musl, for a different reason: eu-stack
stops in libc while unwinding the sleeping process:

  #0  __syscall_cp_asm
  #1  __syscall_cp_c
  #2  0x0000ffff92090d28
  eu-stack: dwfl_thread_getframes ... in /usr/lib/libc.so: no matching address range

__syscall_cp_asm is assembly without CFI, so the first step is a
fallback guess, and on aarch64 it does not leave a usable state for the
next frame. Keep run-deleted.sh as XFAIL for musl on aarch64.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
v3: also keep run-deleted.sh as XFAIL for musl on aarch64; it fails
    there while unwinding out of libc's __syscall_cp_asm (reported by
    the autobuilder on qemuarm64-musl-ptest). qemux86-64-musl-ptest
    passes it with v2.
v2: keep run-deleted.sh as XFAIL for musl with ld-is-lld

 meta/recipes-devtools/elfutils/elfutils_0.197.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/elfutils/elfutils_0.197.bb b/meta/recipes-devtools/elfutils/elfutils_0.197.bb
index 253e1a65f0..1aa49b4dbf 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.197.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.197.bb
@@ -53,6 +53,7 @@ EXTRA_OECONF:append:class-target = " --disable-tests-rpath"
 EXTRA_OECONF:append:class-target:microblaze = " --disable-symbol-versioning"
 
 RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-dbg glibc-dev"
+RDEPENDS:${PN}-ptest:append:libc-musl = " musl-dbg"
 INSANE_SKIP:${PN}-ptest = "debug-deps dev-deps"
 
 do_compile_ptest() {
@@ -64,7 +65,9 @@ PTEST_PARALLEL_MAKE = ""
 PTEST_XFAILS ?= ""
 # See - https://sourceware.org/bugzilla/show_bug.cgi?id=32232
 PTEST_XFAILS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' run-strip-strmerge.sh run-elflint-self.sh run-backtrace-data.sh run-reverse-sections-self.sh', '', d)}"
-PTEST_XFAILS:append:libc-musl = " run-large-elf-file.sh run-backtrace-data.sh run-backtrace-native.sh run-backtrace-native-core.sh run-stack-d-test.sh run-stack-i-test.sh run-stack-demangled-test.sh run-deleted.sh run-compress-test.sh"
+PTEST_XFAILS:append:libc-musl = " run-large-elf-file.sh run-backtrace-native.sh run-backtrace-native-core.sh run-stack-d-test.sh run-stack-i-test.sh run-stack-demangled-test.sh run-compress-test.sh"
+PTEST_XFAILS:append:libc-musl = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', ' run-deleted.sh', '', d)}"
+PTEST_XFAILS:append:libc-musl:aarch64 = " run-deleted.sh"
 
 ELFUTILS_PTEST_SKIP ?= ""
 ELFUTILS_PTEST_SKIP:append:qemuall = " run-stackprof-system.sh"

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-01 16:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-22 15:49 [PATCH] elfutils: Fix backtrace ptests on musl Khem Raj
2026-10-24 17:31 ` [OE-core] " Mathieu Dubois-Briand
2026-12-01  8:14 ` [PATCH v2] " Khem Raj
2026-12-01 15:29   ` Mathieu Dubois-Briand
2026-12-01 16:52   ` [PATCH v3] " Khem Raj

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox