Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7c3ec75f9af18dc9baef246d09c2be367246cfaf5a81536e23a108425bc91e39
Ticket: f583715154c6f33d621418e8c9f6dfae5cc5ebc4
Fileevent runs in the wrong thread
User & Date: sebres on 2020-03-31 16:55:22
Changes

  1. icomment:
    There are still few new findings about this:
    
    1. 8.5 is not affected because since 8.6 a new (*nix) notifier got introduced, which handlers are not accurate now related to channel managed thread switch.
    Proposed patch does not really fix that (just retards), so one would simply get a segfault or a panic like "FlushChannel: damaged channel list" later.
    
    2. 8.7 got already an attempt (by pooryorick) to fix similar issue, but also this has a same behavior here, if test continues (SF or panic on Nth iteration mostly larger than 500th).
    
    3. it is hardly possible to fix that properly without some fixes addressed in [815e246806] (and others), just because if two threads are working on same channel or state (basically they do that, as managed thread switches in the interim state), it will be blamed to fail (so just matter of time when it gets broken) - as its ref-counts,  internal descriptors or "handlers" registered outside of tcl get misused by one or the other thread.
    
    4. I understand that this is a bug (and should be fixed or at least prohibit detach during async-connect), but without the fix a correct handling being to create event firstly in helper (so fulfill the asynchronous connect process) and only then transmit it to the other thread, but it would be the proper way to handle such async operations (not the common fix for the bug).
    
  2. login: "sebres"
  3. mimetype: "text/x-fossil-wiki"