[Mlir-commits] [mlir] fix a concurrent destruction issue for FallbackTypeIDResolver::registerImplicitTypeID due to function static variable (PR #85471)

Stella Laurenzo llvmlistbot at llvm.org
Sat Mar 16 16:24:44 PDT 2024


stellaraccident wrote:

This seems suspect to me: there is all kinds of undefined behavior that can happen if you don't shut your program down properly. Shutdown sequencing is a frequent thing to not be done right, and I suspect that this use is merely the victim of an application bug.

LLVM has the ManagedStatic facility that can be used if you wish to deterministically destruct statics as part of a shutdown sequence that you control, but this sounds like you are doing an uncontrolled shutdown and that is always going to cause problems (this is just one permutation: on Windows, there are cases where the OS Will just immediately stop all other threads, regardless of lock state, etc).

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


More information about the Mlir-commits mailing list