[libcxx][test] qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- compilers, testing-qa
Research direction
Start with libcxx/utils/run.py and inspect how it constructs the executed command environment. Reproduce the failure using std/containers/container.adaptors/flat.map/flat.map.modifiers/replace.pass.cpp with QEMU_CPU=7450, then verify that the relevant QEMU_* settings reach qemu-static and the test completes under emulation.
Written by the indexing model from the issue text.
Description
Running libcxx on qemu-ppc with altivec extensions enabled fails with errors:
********************
FAIL: llvm-libc++-shared.cfg.in :: std/containers/container.adaptors/flat.map/flat.map.modifiers/replace.pass.cpp (3766 of 11321)
******************** TEST 'llvm-libc++-shared.cfg.in :: std/containers/container.adaptors/flat.map/flat.map.modifiers/replace.pass.cpp' FAILED ********************
Exit Code: 252
Command Output (stdout):
--
# COMPILED WITH
/usr/lib/llvm/22/bin/powerpc-unknown-linux-musl-clang++-22 /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.modifiers/replace.pass.cpp -pthread --target=powerpc-unknown-linux-musl -nostdinc++ -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test-suite-install/include/c++/v1 -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test-suite-install/include/c++/v1 -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -flax-vector-conversions=none -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Wuser-defined-warnings -lc++experimental -nostdlib++ -L /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test-suite-install/lib -Wl,-rpath,/var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test-suite-install/lib -lc++ -o /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.modifiers/Output/replace.pass.cpp.dir/t.tmp.exe
# executed command: /usr/lib/llvm/22/bin/powerpc-unknown-linux-musl-clang++-22 /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.modifiers/replace.pass.cpp -pthread --target=powerpc-unknown-linux-musl -nostdinc++ -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test-suite-install/include/c++/v1 -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test-suite-install/include/c++/v1 -I /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/test/support -std=c++26 -Werror -Wall -Wctad-maybe-unsupported -Wextra -Wshadow -Wundef -Wunused-template -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move -Wno-noexcept-type -Wno-atomic-alignment -Wno-reserved-module-identifier -Wdeprecated-copy -Wdeprecated-copy-dtor -Wshift-negative-value -Wno-user-defined-literals -Wno-tautological-compare -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code -Wno-unused-local-typedef -Wno-local-type-template-args -Wno-c++11-extensions -Wno-unknown-pragmas -Wno-pass-failed -Wno-mismatched-new-delete -Wno-redundant-move -Wno-self-move -Wno-nullability-completeness -flax-vector-conversions=none -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D_LIBCPP_ENABLE_EXPERIMENTAL -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_NONE -Wuser-defined-warnings -lc++experimental -nostdlib++ -L /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test-suite-install/lib -Wl,-rpath,/var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test-suite-install/lib -lc++ -o /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.modifiers/Output/replace.pass.cpp.dir/t.tmp.exe
# EXECUTED AS
/usr/bin/python3.14 /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/utils/run.py --execdir /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.modifiers/Output/replace.pass.cpp.dir -- /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.modifiers/Output/replace.pass.cpp.dir/t.tmp.exe
# executed command: /usr/bin/python3.14 /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/libcxx/utils/run.py --execdir /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.modifiers/Output/replace.pass.cpp.dir -- /var/tmp/portage/llvm-runtimes/libcxx-22.1.8/work/runtimes_build-.ppc/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.modifiers/Output/replace.pass.cpp.dir/t.tmp.exe
# .---command stderr------------
# | qemu: uncaught target signal 4 (Illegal instruction) - core dumped
# `-----------------------------
# error: command failed with exit status: 252
--
The issue is caused by libcxx/utils/run.py which drops all env vars:
qemu-staticis controlled throughQEMU_*vars includingQEMU_CPU.QEMU_CPUneeds to be set to a compatible CPU to support altivec extensions, e.g.QEMU_CPU=7450- When
qemu-staticis called without that information, it uses the default CPU for the target architecture, i.e. with CPU extensions disabled. - This issue is not ppc specific, but affects all use cases, where CPU extensions are used that are not supported by the baseline.
The script should forward QEMU_* vars to ensure that the env is setup properly to run the test in an emulated environment.
- Dominant language
- LLVM
- Stars
- 40.6k
- Forks
- 18.7k
- Avg merge
- 18h 16m
- Merged PRs (30d)
- 417
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from llvm/llvm-project
-
website
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
llvm/llvm-project#224961 ·
-
lldb test-suite
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
llvm/llvm-project#224948 · 1 comment ·
-
mlir
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
llvm/llvm-project#224908 · 1 comment ·
-
libc
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
llvm/llvm-project#224587 · 2 comments · 1 assignee ·
-
HLSL
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
llvm/llvm-project#224413 ·
All issues in llvm/llvm-project
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/eo#8869 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
EricSpencer00/Resilient#4824 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
objectionary/jeo-maven-plugin#1758 ·
-
generics
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100