Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 32218aa89faf9e8cdf48c5bf425747e244e086ff
Ticket: 8f559999fa000614504de7a7eefbc99dc7beea2b
background error swallowed with command delete trace on a coroutine
User & Date: pooryorick on 2017-06-22 17:11:10
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    When an error occurs in a coroutine that has a delete trace set on it, the
    delete trace is invoked before the background error handler is invoked. When a
    coroutine is acting as the main routine in a script it may then carry out the
    remainder of the program, oblivious to the error:
    
    <code><verbatim>
    proc bgerror {error options} {
        puts stderr [dict get $options -errorinfo]
        exit 1
    }
    
    proc p1 {} {
        yield [info coroutine]
        error {never gonna give you up}
    }
    
    coroutine main ::apply [list {} {
        yield [info coroutine]
        coroutine c1 p1
        trace add command c1 delete [info coroutine]
        yieldto c1
        exit 0
    } [namespace current]]
    after idle main
    interp bgerror {} [namespace which bgerror]
    vwait forever
    </verbatim></code>
    
  5. foundin changed to: "head"
  6. is_private changed to: "0"
  7. login: "pooryorick"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "e476148cded301ffff84bcdc432536dc0c949e88"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "pooryorick"
  14. subsystem changed to: "20. [interp]"
  15. title changed to:
    background error swallowed with command delete trace on a coroutine
    
  16. type changed to: "Bug"