This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Clear running passes in crashreporter
ClosedPublic

Authored by jpienaar on Dec 21 2022, 10:40 AM.

Details

Summary

Clear active contexts and running passes whenever finalizing crash
report message. Ran into segfault where a failure in dynamic pipeline
resulted in querying a pass whose passmanager had already been destroyed
come time for creating summary of running passes. Conservatively clear
both running states as I don't think there is recovery intended from
pass pipeline failure.

Additionally restrict to one reproducer per report - else we end up
clobbering the same reproducer file over and over again. So instead of
ending with last reproducer we now end up with the first reproducer
while not creating and clobbering reproducers over and over again.

Diff Detail

Event Timeline

jpienaar created this revision.Dec 21 2022, 10:40 AM
jpienaar requested review of this revision.Dec 21 2022, 10:40 AM
rriddle accepted this revision.Dec 21 2022, 10:43 AM

Seems reasonable to me. Is there a way we could test this at all? Okay if it requires really weird interactions.

This revision is now accepted and ready to land.Dec 21 2022, 10:43 AM

I couldn't find a good one yet, but I'm going to keep on trying (submit to avoid segfault and will follow up with adding test if I can get one that isn't terrible/fails reliably without relying on thread interleaving).

This revision was automatically updated to reflect the committed changes.

Thank you Jacques/River -- I found this one in the field when only running release binaries on windows. It was not fun to get the repro that triggered it. Really glad we're continuing to improve reprocucers as they are a life saver.