This is an archive of the discontinued LLVM Phabricator instance.

[mlir] ExecutionEngine: fix assertion on the error path
ClosedPublic

Authored by ftynse on Mar 3 2020, 1:57 AM.

Details

Summary

MLIR ExecutionEngine and derived tools (e.g., mlir-cpu-runner) would trigger an
assertion inside ORC JIT while ExecutionEngine is being destructed after a
failed linking due to a missing function definition. The reason for this is the
JIT lookup that may return an Error referring to strings stored internally by
the JIT. If the Error outlives the ExecutionEngine, it would want have a
dangling reference, which is currently caught by an assertion inside JIT thanks
to hand-rolled reference counting. Rewrap the error message into a string
before returning.

Diff Detail

Event Timeline

ftynse created this revision.Mar 3 2020, 1:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2020, 1:57 AM
ftynse updated this revision to Diff 247826.Mar 3 2020, 1:58 AM

drop debug

Harbormaster completed remote builds in B47881: Diff 247825.
nicolasvasilache accepted this revision.Mar 3 2020, 6:52 AM
This revision is now accepted and ready to land.Mar 3 2020, 6:52 AM
This revision was automatically updated to reflect the committed changes.