Menu

#2250 stub entry != function --> infinite loop

obsolete: 8.4.2
closed-fixed
5
2003-03-21
2003-03-20
Don Porter
No

On RedHat Linux 6.2 on Alpha, using the compiler:

$ ccc -V
Compaq C V6.2-504 on Linux 2.2.18 alpha
Compiler Driver V6.2-504 (Linux) cc Driver

And using the default configuration options
(--enable-shared in particular), I see:

$ make test
...
TCL_LIBRARY="/home/dgp/itl/tcl/library"; export
TCL_LIBRARY; \ ./tcltest ./../tests/all.tcl
make: *** [test] Error 139

Just trying to run the tcltest executable:
$ ./tcltest
Segmentation fault

The problem is an infinite loop in Tcl_DeleteFileHandler.
Lines 489-492:

if (tclStubs.tcl_DeleteFileHandler !=
Tcl_DeleteFileHandler) {
tclStubs.tcl_DeleteFileHandler(fd);
return;
}

With this platform/compiler/linker, the two addresses
compared
are in fact not the same, yet calling each of them lead
(eventually)
to the same routine, Tcl_DeleteFileHandler executing.
Perhaps
these are some unwise shenanigans by this linker, but
it would
be best if Tcl were not broken out of the box.

Strangely, the tclsh executable works fine, and everything
is fine if built with --disable-shared.

Discussion

  • Don Porter

    Don Porter - 2003-03-20

    Logged In: YES
    user_id=80530

    here's a patch to test

     
  • Don Porter

    Don Porter - 2003-03-20

    Logged In: YES
    user_id=80530

    corrected patch to work
    on alternative platforms.

     
  • Don Porter

    Don Porter - 2003-03-20
     
  • Kevin B KENNY

    Kevin B KENNY - 2003-03-21

    Logged In: YES
    user_id=99768

    Original patch fails to compile on Windows, because tclStubLib.c refers to
    the Unix-only functions Tcl_CreateFileHandler and Tcl_DeleteFileHandler.
    Revised patch (attached) compiled and tests correctly; please verify that
    it hasn't broken the Unix build.

     
  • Kevin B KENNY

    Kevin B KENNY - 2003-03-21

    Revised patch with conditional for non-Unix systems

     
  • Kevin B KENNY

    Kevin B KENNY - 2003-03-21
    • assigned_to: kennykb --> dgp
     
  • Don Porter

    Don Porter - 2003-03-21

    Logged In: YES
    user_id=80530

    patch fixes problem on original
    platform, and tests well on
    four different OS/Compiler combinations
    in the Unix world.

    Commtting to core-8-4-branch and HEAD.

     
  • Don Porter

    Don Porter - 2003-03-21
    • status: open --> closed-fixed
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902

    Just a follow-up note to say that (IIRC) this strange piece
    of code is there to deal with the requirements of making Tk
    a loadable package on MacOS (or is it OSX?) I thought it
    was odd code then, and I was right...

     
  • Nobody/Anonymous

    Logged In: NO

    well the code is used in
    Tcl_SetNotifier, and that's
    apparently to allow the
    XtNotifier to go in, which
    I think supported some version
    of the Netscape plugin.