zephyr: C++ exceptions do not work on multiple platforms
EDITED
Architectures on which C++ exceptions work
- ARC
- ARM-32
- ARM-64
- RISCV-32
- RISCV-64
- SPARC
- x86-32
- x86-64
- Xtensa
Architectures on which C++ exceptions do not work
- NIOS2? (unsure,
qemu-nios2cannot run this; if anyone has a HW to test this, any help would be greatly appreciated).
ORIGINAL POST
Describe the bug C++ exception (with matching catch statement) generated in ZTEST application and executed under QEMU x86 causes immediate test (application) exit. The same test executed under QEMU for coretex_m3 works fine.
To Reproduce See: attached ztest project.
Expected behavior C++ exceptions should be handled properly in ZTEST environment.
Impact showstopper
Logs and console output See attached logs.
Environment (please complete the following information):
- OS: Linux
- Toolchain: Zephyr SDK 0.12.3
- Commit SHA: e287fd7ab2fb203d5683eab42ccbd5a3f5c07f62
Additional context logs.zip CPP_TEST.zip
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (12 by maintainers)
Commits related to this issue
- tests: Add base test for C++ exceptions handling. Try to throw and catch C++ exception of int type. Related to: #32448 and #34229 Signed-off-by: Artur Lipowski <Artur.Lipowski@hidglobal.com> — committed to zephyrproject-rtos/zephyr by r2r0 3 years ago
- tests: cpp: run exceptions tests only on mps2_an385 While we wait for #32448, run only on mps2_an385. Signed-off-by: Anas Nashif <anas.nashif@intel.com> — committed to nashif/zephyr by nashif 3 years ago
- tests: cpp: run exceptions tests only on mps2_an385 While we wait for #32448, run only on mps2_an385. Signed-off-by: Anas Nashif <anas.nashif@intel.com> — committed to zephyrproject-rtos/zephyr by nashif 3 years ago
- [nrf temphack] tests: libcxx: skip on mps2 to avoid timeout mps2 appears to be affected by https://github.com/zephyrproject-rtos/zephyr/issues/32448 as well, and is disabled until we can reliably run... — committed to trond-snekvik/sdk-zephyr by trond-snekvik 3 years ago
- [nrf temphack] tests: libcxx: skip on mps2 to avoid timeout mps2 appears to be affected by https://github.com/zephyrproject-rtos/zephyr/issues/32448 as well, and is disabled until we can reliably run... — committed to nrfconnect/sdk-zephyr by trond-snekvik 3 years ago
- cmake: c++ exceptions linking support Fixes part of: #32448 This commit updates the CMake CMAKE_CXX_LINK_EXECUTABLE to include crtbegin.o and crtend.o at the right locations when linking with gcc. ... — committed to tejlmand/zephyr by tejlmand 3 years ago
- cmake: c++ exceptions linking support Fixes part of: #32448 This commit updates the CMake CMAKE_CXX_LINK_EXECUTABLE to include crtbegin.o and crtend.o at the right locations when linking with gcc. ... — committed to zephyrproject-rtos/zephyr by tejlmand 3 years ago
- cpp: Restrict C++ exceptions usage to supported archs This commit makes CONFIG_EXCEPTIONS selectable only for the architectures that currently support C++ exception handling (see #32448). Signed-off... — committed to stephanosio/zephyr by stephanosio 3 years ago
- tests: cpp: libcxx: Update C++ exceptions testing filter This commit updates the filter for cpp.libcxx.exceptions test to allow testing on all architectures except the ones that are known to be broke... — committed to stephanosio/zephyr by stephanosio 3 years ago
64-bit archs to be fixed by #35734. SPARC to be fixed by #35733. NIOS2 needs verification (
qemu-nios2cannot run the test due to flash size limitation).Here’s my working tree for that https://github.com/galak/zephyr/tree/cpp-exception
It in theory this works for x86 and riscv32/64