Tcl Source Code

View Ticket
Login
Ticket UUID: d1bf3f53a6e19c6b068352dd25449e8a90eab580
Title: tip#511 proposed implementation
Type: RFE Version: core-8-branch
Submitter: chw Created on: 2021-08-04 16:49:15
Subsystem: 04. Async Events Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2021-11-16 16:34:32
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2021-11-16 16:34:32
Description:

The attachment contains a diff against core-8-branch at [c8be6c32f12bd5f112654cdb4482ae3dc0f88110]

User Comments: jan.nijtmans added on 2021-11-16 16:34:32:

Implementation in 8.7 branch now: [1a6b389968]


chw added on 2021-08-20 21:20:22:

Fine. Now, that tip-511 almost went into production, let us hope that FlightAware will pick it up, somewhat. As stated earlier TclX will be the most prominent test case. And please FlightAware people, find ideas for patching on www.androwish.org


chw added on 2021-08-20 08:40:54:

Jan, when no more errors show up in the CI, yes please merge. I'm aware that it requires still more test cases in the tests directory and infrastructure for it in tclTest.c but let's go ahead anyways.


jan.nijtmans added on 2021-08-20 07:59:50:

MacOS Build on GITHUB succeeded now.

@chw, any more final tweaks you want to make? Is it ready now to be merged to core-8-branch?


chw added on 2021-08-18 22:26:51:

Musing over the latest patch: that problem is only manifest for use cases of the fork command in TclX. Not at all for the usual Tcl test cases, where in a subprocess something is immediately exec'ed. But anyway, since Tcl can be used as a toolbox/library forking should be fully supported.


chw added on 2021-08-18 19:13:14:

Please try the attached macos-tip511.diff (should fix the issue hopefully).


chw added on 2021-08-18 18:01:22:

Just a guess: there's a call to StartNotifierThread() at the end of AtForkChild() in order to have early signal handling proper. Maybe this is the culprit.


jan.nijtmans added on 2021-08-18 14:08:06:

MacOS Build on GITHUB failed: https://github.com/tcltk/tcl/runs/3358643773?check_suite_focus=true. Any idea what could be the reason?

Tests began at Wed Aug 18 07:43:24 UTC 2021
aaa_exit.test
Test file error: child killed: illegal instruction
append.test
Test file error: child killed: illegal instruction
....


jan.nijtmans added on 2021-08-17 16:30:19:

There's a 'tip-511' implementation branch now, derived from tip511.diff5 with a few additional tweaks:

1) Adapted unix/configure.ac to autoconf-70, and re-generated unix/configure

2) Moved stub entry, preventing a conflict with TIP #568 (which will - hopefully - be voted on soon)

I didn't review it further, but will do that soon. Other people wanting to review the implementation, please go ahead! If nothing comes up the coming weeks, I'll be happy to sponsor this TIP.


chw added on 2021-08-05 19:59:41:

A typo is fixed in attachment tip511.diff5


chw added on 2021-08-05 17:52:49:

A missing if block in Tcl_AsyncInvoke is fixed in the attached tip511.diff4 plus the Async.3 man page is updated.


chw added on 2021-08-04 22:24:32:

Forgot a function for the MacOSX version. This is now in tip511.diff3 which hopefully is the final candidate.


chw added on 2021-08-04 22:12:26:

The second attachment (tip511.diff2) replaces the first and improves the code path for signal handlers not to use pthread_get_specific(), which according to the documentation available on the internet is not listed as a async-signal-safe function.


Attachments: