Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 11c618ba0598a2cb42318d2a95159c6d0a868051babc99ed5ec59894ac45bdab
Ticket: d402ffe76f90c650bcf18d5b5c58a0b77770ed48
Win32 potential crash when using main()
User & Date: anonymous on 2026-11-10 18:10:43
Changes

  1. closedate changed to: "2461355.2574499655"
  2. closer changed to: "anonymous"
  3. 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.
    
  4. login: "anonymous"
  5. mimetype: "text/plain"
  6. username: "[email protected]"