This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add a fuzzer for target create
ClosedPublic

Authored by JDevlieghere on Mar 24 2022, 10:32 PM.

Details

Reviewers
labath
Group Reviewers
Restricted Project
Commits
rG61efe14e21b2: [lldb] Add a fuzzer for target creation
Summary

This patch adds a fuzzer that interprets inputs as object files and makes lldb create targets from them. It is very similar to the llvm-dwarfdump fuzzer which found a bunch of issues in libObject. I let it run in the background for an hour or so and it identified 15 or so inputs that cause lldb to crash.

Diff Detail

Event Timeline

JDevlieghere created this revision.Mar 24 2022, 10:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 10:32 PM
Herald added a subscriber: mgorny. · View Herald Transcript
JDevlieghere requested review of this revision.Mar 24 2022, 10:32 PM

Fix ASCII art

labath accepted this revision.Mar 25 2022, 1:46 AM
labath added subscribers: cmtice, labath.

I like this.

lldb/tools/lldb-fuzzer/lldb-fuzzer-target.cpp
24 ↗(On Diff #418133)

Not an ideal use of auto -- it's clear that this returns some form of TempFile, but if this were say Expected<TempFile>, then the code would be incorrect (but still compile).

This revision is now accepted and ready to land.Mar 25 2022, 1:46 AM
JDevlieghere marked an inline comment as done.Mar 25 2022, 9:06 AM
JDevlieghere added inline comments.
lldb/tools/lldb-fuzzer/lldb-fuzzer-target.cpp
24 ↗(On Diff #418133)

Agreed. Originally I was returning a llvm::Expected<std::unqique_ptr<TempFile>> but the inability to create a temp file isn't all that interesting and without the expected the logic can be a lot simpler.

This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 25 2022, 9:34 AM