This is an archive of the discontinued LLVM Phabricator instance.

emit bitcode to file when Verifier fails
Needs ReviewPublic

Authored by vtjnash on Feb 20 2020, 11:32 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Sometimes we get bug reports from the Verifier triggering, but need to rest of the module context to see what might have happened (for example https://github.com/JuliaLang/julia/issues/31156). This tries to automatically dump it to a file before killing the process, so that the information is preserved if you want it.

Tested with this:

$ cat broken.ll 
define void @"broken\\bad/filename"(i64) {
top:
  br label %top
}

$ opt -disable-verify -verify broken.ll
Entry block to function must not have predecessors!
label %top
in function broken\bad/filename
LLVM ERROR: Broken function found, compilation aborted!
Broken bitcode dumped to "llvm-broken_bad_filename-2f459a.ll"

Event Timeline

vtjnash created this revision.Feb 20 2020, 11:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 20 2020, 11:32 AM
vtjnash edited the summary of this revision. (Show Details)Feb 20 2020, 11:53 AM
vtjnash added a subscriber: Restricted Project.
vtjnash updated this revision to Diff 245712.Feb 20 2020, 12:01 PM

formatting

vtjnash edited the summary of this revision. (Show Details)Feb 20 2020, 12:04 PM
fhahn added a subscriber: fhahn.Feb 20 2020, 12:26 PM

Should probably be an optional feature to the verifier pass, like FatalErrors?

I thought about that, but I didn't think it felt like it needed to. If the cwd is readonly, it'll just silently turn itself off.