https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128197
--- Comment #5 from 13330742392 at wo dot cn --- Thanks both. @Drea: yes — moving `t` into `main` makes it work. If `t` is a local variable in `main`, so that it is joined inside `main` rather than during static destruction, the program exits normally (I ran it 10 times and it never hung). @LIU Hao: thanks for the explanation. To be transparent: the analysis in comment 2, including the backtraces, was produced with AI assistance. I ran the reproductions on my machine and can confirm the hang, but I am not able to discuss libstdc++/UCRT internals myself. If this is a known Microsoft UCRT limitation rather than something libstdc++ can fix, please feel free to close this as such — or keep it as a searchable note for the "process hangs at exit" symptom. Either way is fine by me.
