You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https://reviews.llvm.org/D129120 (and many other commits) removed uses of ManagedStatic and replaced the uses with a function-scoped static. This introduced subtle issues for multithreaded programs that dlopen libLLVM (eg. users of the jit).
Since static objects are destructed in reverse order of registration (alongside atexit handlers), multithreaded programs can encounter a situation where the main thread calls exit() and starts executing function-scoped static destructors. This can result in failed assertions or segfaults when compiling as the function-scoped static objects have been pulled out from under libLLVM.
Moving function-scoped statics back to ManagedStatic would fix this issue. Not sure if there are complexities with that approach.
Reproducer: https://github.com/patrick-rivos/llvm-function-scoped-statics
https://reviews.llvm.org/D129120 (and many other commits) removed uses of ManagedStatic and replaced the uses with a function-scoped static. This introduced subtle issues for multithreaded programs that dlopen libLLVM (eg. users of the jit).
Since static objects are destructed in reverse order of registration (alongside atexit handlers), multithreaded programs can encounter a situation where the main thread calls exit() and starts executing function-scoped static destructors. This can result in failed assertions or segfaults when compiling as the function-scoped static objects have been pulled out from under libLLVM.
Moving function-scoped statics back to ManagedStatic would fix this issue. Not sure if there are complexities with that approach.
Some relevant commits: ede6003 c4ccf60 ebbbd93
cc @nhaehnle
The text was updated successfully, but these errors were encountered: