-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making
proof_trace_parser
and llvm_rewrite_trace_iterator
use a s…
…hared_ptr of `kore_header` (#1156) The Math Proof Team has had an issue with `llvm_rewrite_trace_iterator` where they start iteration in one function, and finish in another function, passing the iterator as an argument to this second function. This second function also generates an Iterable object that is then returned in the first function. This complex workflow was raising a `Python Segmentation Fault` on the call of `get_next_event` inside our `class LLVMRewriteTraceIterator`. After many hours of debugging, I reached a point where I discovered that the `arities_` of the `kore_header` object were corrupted, and then the parser threw a Segmentation Fault when trying to execute `get_arity`. I believe the Pybind deleted the `kore_header` object when the function finishes, as it was the only const ref on the function, and then when we tried to access it lazily using the Iterable object created by the MPG team, the memory where kore_header lived was already freed. By making it a `shared_ptr`, we ensure it's only deleted when the whole object is deleted, sharing the ownership of it with the C++ code.
- Loading branch information
1 parent
db7ebd0
commit a8704ec
Showing
4 changed files
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters