[Mlir-commits] [mlir] [MLIR] Fix use-after-free in DistinctAttr when using crash recovery (PR #148666)

Tobias Gysi llvmlistbot at llvm.org
Mon Jul 14 12:12:32 PDT 2025


gysit wrote:

> Do you mean "storage" instead of "cache" here? 

I meant the `ThreadLocalCache<llvm::BumpPtrAllocator>` cache/storage. It will free the bump pointer allocators once the thread pool is destroyed (at least that was my understanding).

I tried to follow the PR and I do not yet understand why this solution works. Disabling the threading seems fundamentally incompatible with using a `ThreadLocalCache<llvm::BumpPtrAllocator>`?

I wonder if it would make sense to abandon `ThreadLocalCache` in favor of a simple lock based solution. That would significantly simplify the solution and it would be much easier to understand correctness. Should there be a performance problem we can still follow up at some point. 


https://github.com/llvm/llvm-project/pull/148666


More information about the Mlir-commits mailing list