Commit 5618bb1
authored
Fix RNG crash on Windows (#2871)
This PR adds a Windows workaround for a crash on Battlemage during test
runs.
In oneMKL 2026.0 `mkl_rng::mt19937` destructor may crash with
`STATUS_STACK_BUFFER_OVERRUN` during `DLL_PROCESS_DETACH` when using the
Level Zero backend and static storage inside a DLL.
The workaround heap-allocates `backend_sycl` singleton on Windows to
avoid running its destructor at shutdown. Although `~backend_sycl()` is
empty, it triggers destruction of its members (including
`mkl_rng::mt19937`) which causes the crash.
Since `backend_sycl` is a process-lifetime singleton, skipping its
destruction is safe because OS reclaims all
resources at process exit.1 parent d67d3e3 commit 5618bb1
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
70 | 78 | | |
71 | 79 | | |
| 80 | + | |
72 | 81 | | |
73 | 82 | | |
74 | 83 | | |
| |||
0 commit comments