[Mlir-commits] [mlir] [MLIR][Python] remove `liveOperations` (PR #155114)
John Demme
llvmlistbot at llvm.org
Mon Sep 29 14:46:06 PDT 2025
teqdruid wrote:
> I don't think you can catch this kind of crash. _Maybe_ if you were just dealing with segmentation faults due to null pointers (this is how things like Java work: translating such segfaults into NPE). But what you are actually dealing with is stale pointers into random parts of the heap. These may even be valid allocations, because the way the heap gets used in mlir is pretty deterministic in a lot of cases. So you'd just be randomly stomping memory, sometimes doing dirty reads, sometimes doing stray writes and sometimes deallocating memory owned by something else. No catching any of that -- you just need to not do such things
Yeah, I realized that like 15 minutes after posting that thought.
> Most of the time, it's time to acknowledge a design flaw when you start going down the path of implementing some kind of pointer tracking GC :)
I recognize that. As a thought experiment, what would be a better design to make the MLIR Python bindings "safe"/"robust" to this sort of behavior? I can't think of one though I'm not _that_ creative.
https://github.com/llvm/llvm-project/pull/155114
More information about the Mlir-commits
mailing list