Tcl Source Code

View Ticket
Login
Ticket UUID: 0d1a98ce9d8f8eb7cbb2ce09f92ec4289f8aba29
Title: Custom notifiers (Xt) broken on 9.1: timers never fire
Type: Bug Created on: 2026-05-22 17:31:43
Submitter: emiliano Assigned to: jan.nijtmans
Subsystem: 05. XT Notifier Severity: Important
Priority: 5 Medium Last modified: 2026-10-14 10:39:11
Status: Closed Closed by: jan.nijtmans
Resolution: Fixed Closed on: 2026-10-14 10:37:04
Version: 9.1.0
Description:

The Xt notifier (unix/tclXtNotify.c) doesn't build on trunk due to a small typo here.

However, after fixing this bug and a few warnings and building xttest, trying to run the following script (derived from the ones in tests/winNotify.test) hangs

  set x 0
  after 1000 {
    incr x
    testeventloop done
  }
  testeventloop wait
  set x

On 8.6 this works as expected but on trunk it never returns from [testeventloop wait].

OS: linux x86_64.

User Comments:
emiliano added on 2026-05-22 17:32:52:
Attached a fix for building xttest

emiliano added on 2026-05-22 17:36:40:

Attached the adapted Windows tests. Currently the only way to run them is by hand

$ ./xttest ../tests/unixNotify.test

serhiy.storchaka added on 2026-10-14 08:54:58:

The hang is a 9.1 regression from def988e9cd: Tcl_SetMaxBlockTime() and Tcl_ServiceAll() now call the internal TclpSetTimer() instead of Tcl_SetTimer(), bypassing the setTimerProc hook installed by Tcl_SetNotifier(). The timer of a custom notifier is never set, so this affects any custom notifier, not only Xt. 8.6 and 9.0 are not affected.

Proposed fix in branch xt-notifier: call Tcl_SetTimer2() there, plus your tclXtNotify.c, tclXtTest.c and unixNotfy.test patches. With it your script returns 1 and xttest unixNotfy.test passes.


jan.nijtmans added on 2026-10-14 10:37:04:

Fixed in [de395db403|trunk]. Build problem also backported to 9.0

Many thanks!


Attachments: