This is an archive of the discontinued LLVM Phabricator instance.

[trace] Avoid a crash in the dumper when disassembling fails
ClosedPublic

Authored by wallace on Jul 12 2022, 1:14 PM.

Details

Summary

In rare situations, disassemblying would fail that produce an invalid
InstructionSP object. We need to check that it's valid before using.

With this change, now the dumper doesn't crash with dumping instructions of
ioctl. In fact, it now dumps this output

{

"id": 6135,
"loadAddress": "0x7f4bfe5c7515",
"module": "libc.so.6",
"symbol": "ioctl",
"source": "glibc/2.34/src/glibc-2.34/sysdeps/unix/syscall-template.S",
"line": 120,
"column": 0

}

Anyway, we need to investigate why the diassembler failed disassembling that
instruction. From over 2B instructions I was disassembling today, just this
one failed, so this could be a bug in LLVM's core disassembler.

Diff Detail

Event Timeline

wallace created this revision.Jul 12 2022, 1:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2022, 1:14 PM
wallace requested review of this revision.Jul 12 2022, 1:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 12 2022, 1:14 PM
jj10306 accepted this revision.Jul 12 2022, 1:30 PM
This revision is now accepted and ready to land.Jul 12 2022, 1:30 PM
This revision was landed with ongoing or failed builds.Jul 12 2022, 4:23 PM
This revision was automatically updated to reflect the committed changes.