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-nios2 cannot 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

Most upvoted comments

64-bit archs to be fixed by #35734. SPARC to be fixed by #35733. NIOS2 needs verification (qemu-nios2 cannot 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