We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I am working on embedded RTOS for ARMv8M chipset. I have recently added C++ support for my OS. When I try to handle exceptions in my C++ application, my system is crashing with an imprecise Data abort exception. I am not able to pin point the exact instruction which caused the issue, but I think the issue is happening either in memcpy or verbose_terminate_handler API's.
Below is the abort call stack which I am getting.
_ZTSSt12out_of_range_ZNK3Foo9print_addEi /home/apps/examples/cxxtest/cxxtest_main.cxx:120memcpy /home/os/include/string.h:321d_growable_string_callback_adapter_ZN9__gnu_cxx27__verbose_terminate_handlerEv_ZTISt13runtime_error_ZNSt13runtime_errorD2Ev /home/external/libcxx/stdexcept.cxx:99_ZTISt13runtime_error_ZN10__cxxabiv111__terminateEPFvvE_ZSt9terminatev__cxa_throwcxxtest_main /home/apps/examples/cxxtest/cxxtest_main.cxx:502
I am using the LLVM C++ library and linking the libsupc++.a from the toolchain.
Toolchain version: arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599]
I am using the same configuration for an ARMv7M based chipset and everything is working just fine. Exceptions are caught and proper error messages are printed.
I found some information related to similar issues and I have tried the following:
1. I tried to build the gcc toolchain from source by disabling --disable-libstdcxx-verbose to avoid verbose exception prints
2. Build my code with -mno-unaligned-access and use memcpy implementation from my own code
But, the above methods have not worked out. Any help would be highly appreciated!!