|
2022-08-20
| ||
| 17:09 | Merged fix for bug [baa51423c2] check-in: 87687f362f user: apnadkarni tags: trunk, main | |
| 16:56 | Added test for bug [baa51423c2] check-in: 90989a0ac8 user: apnadkarni tags: core-8-branch | |
| 13:17 | • Ticket [baa51423c2] tclWinConsole: needEvent variable is used uninitialized ... artifact: b7a059fd69 user: fvogel | |
| 12:16 | Really closes [baa51423c28a3baf] check-in: 189e348c49 user: apnadkarni tags: core-8-branch | |
| 11:55 | • Ticket [baa51423c2] tclWinConsole: needEvent variable is used uninitialized ... artifact: 80e47ad075 user: apnadkarni | |
| 11:53 | • Ticket [baa51423c2]: 5 changes artifact: e29b321fec user: apnadkarni | |
| 10:37 | • Closed ticket [baa51423c2]. artifact: 5b62a3191f user: sebres | |
| 10:36 | • Ticket [baa51423c2]: 3 changes artifact: f3c587148c user: sebres | |
| 10:13 | closes [baa51423c28a3baf]: needEvent must be initialized in cycle (for each watching channel) check-in: fce5cfe1c7 user: sebres tags: core-8-branch | |
| 07:05 | • Ticket [baa51423c2] tclWinConsole: needEvent variable is used uninitialized ... artifact: 52ec2a6684 user: fvogel | |
| 07:04 | • New ticket [baa51423c2]. artifact: 2e1c732755 user: fvogel | |
tclWinConsole: needEvent variable is used uninitialized
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.
87687f362fMerged fix for bug [baa51423c2] check-in2022-08-20 17:09:5490989a0ac8Added test for bug [baa51423c2] check-in2022-08-20 16:56:10
Ashok, may I assign to you since you touched this very recently? Thanks!
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.
Ashok, can we be sure there are no constellations where it could happen?
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.
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
As an aside, I'm a little surprised the compiler did not warn of uninitialized use. I thought they would.
Comfirm [189e348c49] works for me. Thanks!