This is an archive of the discontinued LLVM Phabricator instance.

[lldb/crashlog] Skip null image dsym fetching on interactive mode
ClosedPublic

Authored by mib on Aug 2 2022, 5:43 PM.

Details

Summary

Sometimes, it can happen that a crash report has null images in its list
of used binaries. This manifests like such:

0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

When fetching debug symbols to symbolicate the crashlog stackframe,
having null images causes dsymForUUID to hang for few seconds.

This patch addresses that by skipping null images from being load by the
scripted process.

rdar://97419487

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>

Diff Detail

Event Timeline

mib created this revision.Aug 2 2022, 5:43 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2022, 5:43 PM
mib requested review of this revision.Aug 2 2022, 5:43 PM
jasonmolenda added inline comments.
lldb/examples/python/scripted_process/crashlog_scripted_process.py
28

One of the things I noticed working on https://reviews.llvm.org/D130813 was that our UUID class's IsValid() method detects if the object has any bytes or not, and I wonder if it should check for a null uuid value (all zeroes) and return IsValid()==false in that case. In my patch, I was reading a UUID out of a corefile and I needed to check if it was a null uuid before I copied the bytes into a UUID object to work around it.

JDevlieghere added inline comments.Aug 3 2022, 10:59 AM
lldb/examples/python/scripted_process/crashlog_scripted_process.py
28

According to the spec [1], the all-zero UUID is indeed a special case called the "Nil UUID". I think it makes sense to have IsValid return false for that.

[1] https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.7

mib marked 2 inline comments as done.Aug 4 2022, 10:53 AM
mib added inline comments.
lldb/examples/python/scripted_process/crashlog_scripted_process.py
28

Sounds good to me but I think that change is unrelated to this patch: The problem here that we call dsymForUUID from crashlog.py -> DarwinImage:locate_module_and_debug_symbols with a nil UUID, so the issue is external to lldb. I'll make the UUID::IsValid change on a follow-up patch

JDevlieghere accepted this revision.Aug 4 2022, 1:41 PM

LGTM module the inline comment.

lldb/examples/python/scripted_process/crashlog_scripted_process.py
27–30

Sounds good. I would remove the print and just ignore the null images. There's nothing actionable there for the user.

This revision is now accepted and ready to land.Aug 4 2022, 1:41 PM
This revision was landed with ongoing or failed builds.Aug 9 2022, 9:02 PM
This revision was automatically updated to reflect the committed changes.
mib marked an inline comment as done.