#2397 NotifierThreadProc is spinning on 64 bit machine

obsolete: 8.4.3
closed-fixed
Jeffrey Hobbs
9
2003-07-16
2003-07-08
Anonymous
No

From
hgo@netman.dk

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.

Discussion

  • Henning Godske
    Henning Godske
    2003-07-08

    Logged In: YES
    user_id=818072

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

    865c865,866
    < int i, status, index, bit, numFdBits, found, receivePipe,
    word;
    ---
    > int i, status, index, bit, numFdBits, receivePipe;
    > long found, word;

     
  • Logged In: YES
    user_id=79902

    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.

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

    Logged In: YES
    user_id=72656

    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
    user_id=818072

    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
    user_id=72656

    corrected for 8.4.4 and 8.5a