[Rd] Tcl socket server (tcltk) does not work any more on R 4.3.2

Ivan Krylov |kry|ov @end|ng |rom d|@root@org
Tue Feb 20 17:13:58 CET 2024


В Tue, 20 Feb 2024 12:27:35 +0100
"webmail.gandi.net" <phgrosjean using sciviews.org> пишет:

> When R process #1 is R 4.2.3, it works as expected (whatever version
> of R #2). When R process #1 is R 4.3.2, nothing is sent or received
> through the socket apparently, but no error is issued and process #2
> seems to be able to connect to the socket.

The difference is related to the change in
src/library/tcltk/src/tcltk_unix.c.

In R-4.2.1, the function static void TclSpinLoop(void *data) says:

    int max_ev = 100;
    /* Tcl_ServiceAll is not enough here, for reasons that escape me */
    while (Tcl_DoOneEvent(TCL_DONT_WAIT) && max_ev) max_ev--;

In R-devel, the function instead says:

    int i = R_TCL_SPIN_MAX;	
    while (i-- && Tcl_ServiceAll())
        ;

Manually calling Tcl_DoOneEvent(0) from the debugger at this point
makes the Tcl code respond to the connection. Tcl_ServiceAll() seems to
be still not enough. I'll try reading Tcl documentation to investigate
this further.

-- 
Best regards,
Ivan



More information about the R-devel mailing list