Currently we suffer from a severe crash in our application which loads and unloads PyTorch libraries on demand . Basically the issue boils down to some form of use-after-free in the destructors of the static objects scattered though many of torch_* DLLs while portion of those DLLs gets unloaded by the system. I’ve managed to avoid faulty accesses by adding RAII cleanups downstream and provided possible fix as an illustration of the issue in the form of a PR .
Besides purely technical details which are gory but comprehensible, it’s been a while it has been reported. The issue itself seemingly draws little or no attention from upstream developers though. I wonder if I did something wrong. Is the report unclear, incomplete or invalid, or maybe GH issues is just an unsuitable place for discussing such kind of problems? In that case may I kindly ask to be directed to a proper place or a person?
1 [Windows] Crash when unloading torch_cpu.dll using LOCAL SYSTEM account · Issue #61111 · pytorch/pytorch · GitHub
2 Proper deregistration of static types and objects by dorozhkin-stc · Pull Request #61290 · pytorch/pytorch · GitHub