#2397 NotifierThreadProc is spinning on 64 bit machine

obsolete: 8.4.3


Seen in 8.4.3

The use of vars. "found" and "word" in
NotifierThreadProc() in tclUnixNotfy.c shall be long,
not int,
as they are used to hold long values in the select tests.

This error results in the select spinning if int and long is
not the same size.

First seen on HP-UX 11i running Tcl/Tk in 64 bit mode.


  • Henning Godske

    Henning Godske - 2003-07-08

    Logged In: YES

    The code change needed n tcl8.4.3/unix/tclUnixNotfy.c is:

    < int i, status, index, bit, numFdBits, found, receivePipe,
    > int i, status, index, bit, numFdBits, receivePipe;
    > long found, word;

  • Donal K. Fellows

    Logged In: YES

    Any reason not to declare those variables as fd_mask
    instead? That's the official type of the members of the
    array that they are manipulating...

    In fact, I think those variables ought to be declared much
    closer to where they are used (somewhere around line 971)
    but that's just a general stylistic point.

  • Donal K. Fellows

    • milestone: --> obsolete: 8.4.3
    • priority: 5 --> 9
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-07-08

    Logged In: YES

    I believe going with the proper type is best. Is there a
    particular test I can use to verify this (although logically it is
    clear ... tests are always nice).

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-07-08
    • assigned_to: nijtmans --> hobbs
  • Henning Godske

    Henning Godske - 2003-07-09

    Logged In: YES

    The bug was not found using Tcl/Tk tests, but when
    imbedding Tk into another application on a HP-UX 11i.

    The Tcl part runs OK, but it started spinning when the main
    Tk window was raised, because on the HP platform this sets
    a bit in the high-end of the select mask.

    The same code was running without any problems on Tru64
    UNIX and on Solaris.

    So I don't have at test, except that the fix worked on HP-UX
    and did not break anything on Tru64 and Solaris.

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-07-16
    • status: open --> closed-fixed
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-07-16

    Logged In: YES

    corrected for 8.4.4 and 8.5a