You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
createdump fails with libunwind assert: Assertion `ip >= di->start_ip && ip < di->end_ip' failed. #64168
area-PAL-coreclronly for closed issuesblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'untriagedNew issue has not been triaged by the area owner
I was looking into it. The problem is not in libunwind - runtime asks it to unwind with instruction pointer in the context set to 0.
Based on the dump from the CI I was looking at, I seems it was because the loop in the LazyMachState::unwindLazyState has iterated twice. In the first iteration, it went to the managed frame, but the ExecutionManager::IsManagedCode didn't recognize it as managed for some reason. So it did another unwind, but since it was a managed frame, there was no native unwind info, hence the 0 IP.
Although the OS in the CI has generated a dump for both the createdump and the crashed process that the createdump was attempting to dump, the dump from the crashed process didn't contain memory from the executables like libcoreclr.dylib and so SOS cannot work with it. It took me a while to figure out that it was the reason why SOS didn't work with the dump. I was hoping that SOS stack walking would repro the problem when opening the crashing process dump and I could debug it that way, but that was unfortunately not possible.
Looking at the dump from the crashing thread stack again now, I can see though that the crash must have happened when only Main was on the stack, so maybe I can simulate it by making GC always crash at the point where it crashed in the dump.
So, I was able to make SOS work with dumps that don't contain copy of the libcoreclr.so (dotnet/diagnostics#2827). Now I can repro the issue with the SOS clrstack command.
So far I can see that my theory was incorrect, the unwinding actually returns zero PC for the first call to PAL_VirtualUnwindOutOfProc in the LazyMachState::unwindLazyState in DAC. The PC/SP in the input context are correct addresses in the JIT_NewArr1, so it is not as I have thought that we would unwind correctly to the managed frame and then fail to recognize it as managed.
The problem then seems to be either in the libunwind or in the unwind info generated by the compiler.
area-PAL-coreclronly for closed issuesblocking-clean-ciBlocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'untriagedNew issue has not been triaged by the area owner
Activity
jkotas commentedon Jan 23, 2022
More context:
#64162 (comment)
#63854 (comment)
jkotas commentedon Jan 23, 2022
@janvorli Are you looking into this? We need to get this fixed with high priority since it prevents us from diagnosing CI crashes.
cc @agocke
janvorli commentedon Jan 24, 2022
I was looking into it. The problem is not in libunwind - runtime asks it to unwind with instruction pointer in the context set to 0.
Based on the dump from the CI I was looking at, I seems it was because the loop in the
LazyMachState::unwindLazyStatehas iterated twice. In the first iteration, it went to the managed frame, but theExecutionManager::IsManagedCodedidn't recognize it as managed for some reason. So it did another unwind, but since it was a managed frame, there was no native unwind info, hence the 0 IP.Although the OS in the CI has generated a dump for both the createdump and the crashed process that the createdump was attempting to dump, the dump from the crashed process didn't contain memory from the executables like libcoreclr.dylib and so SOS cannot work with it. It took me a while to figure out that it was the reason why SOS didn't work with the dump. I was hoping that SOS stack walking would repro the problem when opening the crashing process dump and I could debug it that way, but that was unfortunately not possible.
Looking at the dump from the crashing thread stack again now, I can see though that the crash must have happened when only
Mainwas on the stack, so maybe I can simulate it by making GC always crash at the point where it crashed in the dump.I am back on it.
janvorli commentedon Jan 24, 2022
So, I was able to make SOS work with dumps that don't contain copy of the libcoreclr.so (dotnet/diagnostics#2827). Now I can repro the issue with the SOS
clrstackcommand.So far I can see that my theory was incorrect, the unwinding actually returns zero PC for the first call to
PAL_VirtualUnwindOutOfProcin theLazyMachState::unwindLazyStatein DAC. The PC/SP in the input context are correct addresses in theJIT_NewArr1, so it is not as I have thought that we would unwind correctly to the managed frame and then fail to recognize it as managed.The problem then seems to be either in the libunwind or in the unwind info generated by the compiler.
janvorli commentedon Jan 24, 2022
I believe this is the commit in the libunwind that has broken us:
libunwind/libunwind@a4014f3
I have enabled debugging logs in the libunwind and got this:
Notice the IP in the
_Uaarch64_dwarf_search_unwind_table: lookup IP 0xffffff8033e42694. Is is a nonsense value. It gets logged here:runtime/src/coreclr/pal/src/libunwind/src/dwarf/Gfind_proc_info-lsb.c
Line 963 in 2713e11
The above-mentioned commit has added the
- di->load_offsetpart.Dumping the values of the stuff used in the expression:
janvorli commentedon Jan 24, 2022
The load_offset doesn't seem to match anything sane. Here is the modules list from the dump:
I am trying to investigate where that offset came from. There is a number of places in the libunwind that sets the
load_offset.janvorli commentedon Jan 24, 2022
I've found the culprit, preparing PR...