[ARM/Linux] coreclr fails due to lack of DWARF feature in libunwind #6479
Coreclr uses libunwind library to unwind stack frame during exception handling and etc.
However libunwind sometimes can not unwind stack correctly and it was reported in dotnet/coreclr#6598.
For example, when we build coreclr for ARM/Linux using clang-3.6 with -O1 optimization, following function make use of ARM vfvp3/NEON registers.
After compilation, above C++ function will be compiled into assembly file as below and you can observe push intruction for d8 register which is ARM vfpv3/NEON registers, i.e.
After linking, above code will reside in
libunwind try to unwind stack using infromation in
Same patterns are observed in both arm and arm-soft and in "-g -O1" and "-g -O3".
I've also tried method 1 and 2, and both seems to work.
For method 1, when disabling UNW_ARM_METHOD_DWARF by setting UNW_ARM_UNWIND_METHOD=6, #6409 reproted that there is no obvious regression observbed.
Threfore I think method 1 will be a feasible and practical way to fix this issue. I will add PR soon.
The text was updated successfully, but these errors were encountered:
+ // libunwind library is used to unwind stack frame, butlibunwind for ARM + // does not support ARM vfpv3/NEON registers in DWARF format correctly + // Therefore let's disable stack unwiding using DWARF information + // See https://github.com/dotnet/coreclr/issues/6698 + // + // libunwind use following methods to unwind stack frame. + // UNW_ARM_METHOD_ALL 0xFF + // UNW_ARM_METHOD_DWARF 0x01 + // UNW_ARM_METHOD_FRAME 0x02 + // UNW_ARM_METHOD_EXIDX 0x04 + putenv(const_cast<char *>("UNW_ARM_UNWIND_METHOD=6")); Signed-off-by: Hyung-Kyu Choi <email@example.com>