Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround crash on exit for MinGW 32bit
There is a bug in GCC for 32bit MinGW until version 11. This causes a use-after free for destruction of `thread_local` variables that crash the application when the destructor accesses any member. In the tests it shows up as exit code/status `-1073741819` i.e. `0xC0000005`. Workaround this by not destructing the `stackstring` instance used to hold the value of the last `getenv` result. In the case where any call to `getenv` of a thread yielded a large value heap memory will be allocated and not freed due to this missing destructor call causing a memory leak, possibly for each thread. However values up to some length are stored on stack memory and hence the missing destructor call does not cause a memory leak as the type is essentially trivial in this state. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83562 Fixed by https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=7fc0f78c3f43af1967cb7b1ee8f4947f3b890aa2
- Loading branch information