When instructions with metadata are accidentally leaked, the result is a difficult-to-find memory corruption in ~LLVMContextImpl that leads to random crashes.
This patch implements the detection and graceful handling of such issues.
Differential D48476
Detecting leaked instructions with metadata and freeing the metadata to avoid use-after-free akokins on Jun 22 2018, 3:19 AM. Authored by
Details
When instructions with metadata are accidentally leaked, the result is a difficult-to-find memory corruption in ~LLVMContextImpl that leads to random crashes. This patch implements the detection and graceful handling of such issues.
Diff Detail Event TimelineComment Actions Thanks for the patch. I like the idea of having a cheap leak check in debug builds. However, I don’t think we should add a mitigation for improper use of the API, because it can build up to code confusion/bloat over time. It becomes less clear what the API does/doesn’t support. Could you please:
Comment Actions Please ignore the previous diff, I missed that the comment didn't make sense after the changes. |