Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-16
14:37
Fix [e484a8]: pipe: time-related sporadic hangs in io/chan-io tests check-in: de9d1dcb7c user: jan.nijtmans tags: trunk, main
2026-10-14
10:29 • Ticket [e484a8407c] pipe: time-related sporadic hangs in io/chan-io tests st... artifact: 11c8f2de61 user: serhiy.storchaka
10:21
Fix the async pipe close tests, see [e484a8407c]. io-27.6, io-29.32, chan-io-27.6 and chan-io-29.32 ... check-in: 9b3b167cb5 user: serhiy.storchaka tags: tests-async-pipe-close
2020-08-10
15:38 • New ticket [7cf7cce423] windows: `socket -async localhost $port` can hang sporad... artifact: ed0826597b user: sebres
2019-09-05
10:03 • Ticket [1adeb65446] chan-io-29.34 hangs on Windows status still Closed with ... artifact: b7866f6f90 user: sebres
2019-09-04
22:24 • Ticket [1adeb65446]: 5 changes artifact: d46f4fb95b user: sebres
2019-08-23
15:17 • Ticket [e484a8407c] pipe: time-related sporadic hangs in io/chan-io tests st... artifact: f5b56011d7 user: sebres
12:27 • Ticket [e484a8407c]: 3 changes artifact: 2c197bbc56 user: sebres
2019-08-22
10:02 • Ticket [e484a8407c]: 3 changes artifact: 618aa576db user: sebres
2019-08-12
07:32 • Ticket [e484a8407c]: 3 changes artifact: f4c510ae9d user: jan.nijtmans
2019-08-11
22:01
Mark 3 testcases as knownMsvcBug. See: [e484a8407cb9ec45]: pipe: time-related sporadic hangs in io/c... check-in: da771f407e user: jan.nijtmans tags: core-8-6-branch
2019-08-05
07:19 • Ticket [e484a8407c] pipe: time-related sporadic hangs in io/chan-io tests st... artifact: dd960fffd5 user: fvogel
2019-08-04
22:39 • Ticket [e484a8407c]: 3 changes artifact: 5f1d931f39 user: sebres
22:38 • New ticket [e484a8407c]. artifact: 1e4e1f6bdb user: sebres

pipe: time-related sporadic hangs in io/chan-io tests

Opene484a8407cb9ec45ea0a6f3127ae4a3a1780b8a0Created 7 years agoUpdated 49 days ago
Descriptionwiki2019-08-04 22:38:51
Trying to fix all windows/mingw tests in travis, I found some sporadic hangs (io-27.6, io-29.32 etc), which are pretty reproducible if sleep times becomes reduced (after 20 will be replaced with after 1).

As one can see build # 567003451 is passed, and after some small changes the heisenbug is reproduced in all build jobs build # 567076288.

The shorter the sleep intervals, the better it is reproducible.

Here is the code to reproduce it in shell:

package require tcltest
namespace import -force ::tcltest::*
tcltest::configure -match io-29.32

proc ::tcltest::cleanupTestsHook {} { if {$::tcltest::numTests(Failed)} {error failed} } timerate {source tests/io.test} 10000

Referenced by4
  • 9b3b167cb5Fix the async pipe close tests, see [e484a8407c]. io-27.6, io-29.32, chan-io-27.6 and chan-io-29.32 returned before the child process closed the output file, so deleting it in the next test failed on Windows ("permission denied"); wait for a marker file the child creates after closing it. The chan-io tests never ran: their asyncPipeClose constraint was mangled into "asyncPipeChan Close" when chanio.test was created. check-in2026-10-14 10:21:14
  • ed0826597bNew ticket [7cf7cce423] windows: `socket -async localhost $port` can hang sporadically in gethostbyname. ticket2020-08-10 15:38:12
  • b7866f6f90Ticket [1adeb65446] chan-io-29.34 hangs on Windows status still Closed with 5 other changes ticket2019-09-05 10:03:25
  • d46f4fb95bTicket [1adeb65446] chan-io-29.34 hangs on Windows status still Closed with 5 other changes ticket2019-09-04 22:24:16
sebres Ticket [e484a8407c]: 3 changes [History diff]2019-08-04 22:39:52
fvogelwiki2019-08-05 07:19:56

I'm seeing a repeatable hang for (unmodified) chanio-29.34 on Windows, see [1adeb65446].

jan.nijtmansplain2019-08-12 07:32:46
Those test-case are marked knownMsvcBug now. That doesn't mean it's solved, but at least Travis builds don't fail any more for those test-cases, if they are the only ones failing: It should not block a release, since it's likely a long-time problem not a regression.
sebreswiki2019-08-22 10:02:23

just as an interim info: this is not reproducible at all with RFE [fdfbd5e10] (together with fix for [815e246806], but I think it is not really affected here), seems to be fixed in RFE using ChannelScheduledEvent (previously timer-event) with new prolongation handling (retarding).

sebreswiki2019-08-23 12:27:15

Nope, reproduced the hang also (with RFE [fdfbd5e10]) testing that in VM...
Just needed some more time (1h), possibly because the event-handling is several times faster there, so 1ms is "too" long (quasi same as not reduced "after 20" in original tcl-core).

sebreswiki2019-08-23 15:17:58

Found it, branch core-8-5-branch-fix-1997007 with few small changes fixed it for win & mingw, so after fix (without RFE) got applied, I see no hangs anymore approximately within 1 hour testing (where it hung in at the latest in 10 seconds previously), so I'll rebase it to fossil and provide the fix soon.

serhiy.storchakawiki2026-10-14 10:29:15

The hangs do not reproduce on Windows 11 with 9.1 and 8.6, even with after 1 in the child scripts (over 1400 runs of io-27.6, io-29.32, chan-io-27.6 and chan-io-29.32).

With the shortened sleep the tests failed sporadically for another reason: they returned before the child closed the output file, so file delete $path(output) in the next test failed with "permission denied". The chan-io tests never ran at all: their constraint asyncPipeClose was mangled into "asyncPipeChan Close" when chanio.test was created.

Proposed fix in branch tests-async-pipe-close: the tests wait for a marker file the child creates after closing the output file, and the chan-io constraint is fixed. 1200 runs on Windows without failures.

Log in (anonymous is fine) to add a comment.