Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 262e4595938f6238b55fdc06e595ad85d4d0b7fc
Ticket: 1582671fffffffffffffffffffffffffffffffff
crash in tclAsync.c:Tcl_AsyncDelete()
User & Date: vasiljevic on 2008-04-26 16:19:26
Changes

  1. closedate changed to: "2008-04-26T09:19:26"
  2. closer changed to: "vasiljevic"
  3. icomment:
    Logged In: YES 
    user_id=95086
    Originator: NO
    
    So... I finally got time to look at this one.
    
    Failure to locate the async token in (thread's own) list of generated tokens is
    a sign of a big problem and the only (right) thing to do at that place is to
    Tcl_Panic.
    
    So, you just cannot create the token in one thread and delete it in another.
    The thread that created the token must be the same thread that destroys it.
    
    You can (and will) need to pass this token to some other thread and issue
    Tcl_Async_Mark on that token that would mark the event in the thread that
    created the token.  BUT be aware that this thread is still arround at that time!
    As, if it is already gone, you will crash. Tcl does not maintain (should it?) a 
    list of threads generated by its own Tcl_CreateThread() command, otherwise
    we could prove originating thread existence and Tcl_Panic more clearly...
    In any case, Tcl_Panic is inevitable, just error logging would be better.
    
    Patch seems allright for me. 
    I will put this into both HEAD and core-8-4-branch.
    
    Zoran
    
    
    
  4. login: "vasiljevic"
  5. mimetype: "text/plain"
  6. resolution changed to: "Fixed"
  7. status changed to: "Closed"
  8. username: "vasiljevic"