Overview
| Artifact ID: | 11c618ba0598a2cb42318d2a95159c6d0a868051babc99ed5ec59894ac45bdab |
|---|---|
| Ticket: | d402ffe76f90c650bcf18d5b5c58a0b77770ed48
Win32 potential crash when using main() |
| User & Date: | anonymous on 2026-11-10 18:10:43 |
Changes
- closedate changed to: "2461355.2574499655"
- closer changed to: "anonymous"
- icomment:
This issue still exists in 9.0 due to TclFinalizeIOSubsystem() calling TclGetEnv() around line 598 of tclIO.c. It's possible for trivial apps to initialise and finalise and hit this path. I encountered this creating a minimal repro for a build issue with CPython. The fix I'd suggest is to have TclpFindVariable (in tclWinInit.c) check for a NULL _wenviron and do an arbitrary _wgetenv to initialise before continuing. I assume there's some reason for doing your own search rather than using _wgetenv (or _wgetenv_s), but if not, switching to that for the search ought to be fine too.
- login: "anonymous"
- mimetype: "text/plain"
- username: "[email protected]"