[ARM/Linux] Regressions in 'Interop/MarshalAPI/ReadWrite/ReadWriteInt64'
In ARM/Linux, running 'Interop/MarshalAPI/ReadWrite/ReadWriteInt64' with CoreCLR from 23b20c4e737 throws unhandled exception as follows:
$ corerun ut/Interop/MarshalAPI/ReadWrite/ReadWriteInt64/ReadWriteInt64.exe
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Runtime.InteropServices.Marshal.ReadInt64(IntPtr ptr, Int32 ofs)
@parjong it can be always reproduced ?
@chunseoklee It always happens for me. Interestingly, it does not appear when I set UNW_ARM_UNWIND_METHOD as 6.
While digging this issue, I found that libunwind tries to use DWARF-based unwind method, and crashes with invalid memory access just few steps after the DWARD-based unwinding step.
@parjong It seems that DWARF-based unwinding requires several sections, which are omitted in coreclr(e.g. debug_loc, debug_frame.)
Is it possible to set UWN_ARM_UNWIND_METHOD = 6 ? (if does, there might be regression ?)
@chunseoklee There was code that sets UNW_ARM_UNWIND_METHOD as 6 in CoreCLR, but removed due to some regression in Release mode. I'll check whether setting UNW_ARM_UNWIND_METHOD has side-effect, or not.
parjong commented 3 days ago @chunseoklee It always happens for me. Interestingly, it does not appear when I set UNW_ARM_UNWIND_METHOD as 6.
@parjong Thanks god! It seems that issue dotnet/runtime#6322 is also related to this and JIT/Performance/CodeQuality/Serialization/Serialize is PASSED with UNW_ARM_UNWIND_METHOD=6. I never thought there is a unwind during the serialization. Thank you again!.
@chunseoklee @hqueue I checked whether setting UNW_ARM_UNWIND_METHOD as 6 introduces any regressions, but I didn't find any regression:
For Release build, setting UNW_ARM_UNWIND_METHOD as 6 reduces failures from 38~39 into 25~26 (there are some random failures)
It is similar for Debug build (from 35 into 29).
Unfortunately, I'm not sure whether this is also true for ARM (hard-fp) since I tested only ARM (soft-fp)
@parjong I've observed that same DWARF inforamtion which cannot be interpreted correctly by libunwind for ARM hard-fp and soft-fp.(#6698)
I'll close this issue as recent commit that disables the use of DWARF information during stack unwinding addressed it.