Artifacts Associated With Ticket baa51423c2
Ticket change [2e1c732755] (rid 203147) by fvogel on 2022-08-20 07:04:13:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Since [c085b9090c8ae821] (<i>New Windows console driver. Fixes [21280817d1] thread proliferation and [44bbccdd8c] fconfigure std{out,err}.</i>), in a freshly built Tcl from core-8-branch, when running "package require Tk" I get a MSVC Runtime Library debug check triggering: "Run-Time Check Failure #3: The variable 'needEvent' is being used without being initialized." I believe this comes from a missing initialization in ConsoleCheckProc in tclWinConsole.c:838 but there must be something more about this because when I add this initialization: int needEvent = 0; then the console runs (run-time check error is gone) but the continuation lines are broken in the console: it is no longer possible to enter more characters. Example: just enter: "proc a {} {", hit the enter key and it's stuck. - foundin initialized to: "core-8-branch"
- is_private initialized to: "0"
- login: "fvogel"
- priority initialized to: "5 Medium"
- private_contact initialized to: "a013af67114eccc19ad12b04f14923acea9e96b7"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "fvogel"
- subsystem initialized to: "52. Portability Support"
- title initialized to:
tclWinConsole: needEvent variable is used uninitialized
- type initialized to: "Bug"
Ticket change [52ec2a6684] (rid 203148) by fvogel on 2022-08-20 07:05:02:
- assignee changed to: "apnadkarni"
- icomment:
Ashok, may I assign to you since you touched this very recently? Thanks!
- login: "fvogel"
- mimetype: "text/plain"
Ticket change [f3c587148c] (rid 203153) by sebres on 2022-08-20 10:36:36:
- icomment:
Fixed in [fce5cfe1c7e872fe]... Just I must admit, I saw something that may be potentially dangerous: ConsoleCheckProc locks two mutexes in a nested way. This is theoretically a candidate for a deadlock in certain circumstances.<br/> Ashok, can we be sure there are no constellations where it could happen?<br/> I mean TH-A locks gConsoleLock and want to lock handleInfoPtr->lock, in the same time TH-B that still hold the lock on handleInfoPtr->lock attempting to lock gConsoleLock for some reason, what would cause a freezing. We can have one actor more that (especially by read/write locks) make some exclusive (W) lock for some of them, so finally it could lead to hardly reproducible heisenbug.
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [5b62a3191f] (rid 203154) by sebres on 2022-08-20 10:37:00:
- closedate changed to: "2459811.94237022"
- closer changed to: "sebres"
- login: "sebres"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [e29b321fec] (rid 203155) by apnadkarni on 2022-08-20 11:53:52:
- closedate changed to: "2459811.99574449"
- closer changed to: "apnadkarni"
- icomment:
Found the issue and fixed it. Testing now. @sebres - just initializing needEvent does not suffice. @sebres - regarding lock deadlocks, pretty much all my code (here, iocp, isapi) uses lock hierarchies to prevent deadlocks. See comments in the code (search for hierarchy) /Ashok
- login: "apnadkarni"
- mimetype: "text/plain"
Ticket change [80e47ad075] (rid 203156) by apnadkarni on 2022-08-20 11:55:46:
- closedate changed to: "2459811.99706951"
- icomment:
As an aside, I'm a little surprised the compiler did not warn of uninitialized use. I thought they would.
- login: "apnadkarni"
- mimetype: "text/plain"
Ticket change [b7a059fd69] (rid 203159) by fvogel on 2022-08-20 13:17:23:
- closedate changed to: "2459812.05373847"
- closer changed to: "fvogel"
- icomment:
Comfirm [189e348c49] works for me. Thanks!
- login: "fvogel"
- mimetype: "text/x-fossil-wiki"