Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 48e9cf7ceaa79e90e3faad80195f847b352eb24e
Ticket: 3104471fffffffffffffffffffffffffffffffff
"command returned bad code: 2" in bgerror
User & Date: andygoth on 2010-11-08 07:56:37
Changes

  1. icomment:
    [wibble::getline] calls [return -level [info level]] on [chan eof $chan], which is exactly the code path that's giving me trouble.  The intention is to terminate the coroutine.  [return -level [info level]] allows the finally's to trigger, which is what I need.  [rename [info coroutine] ""; yield] bypasses finally, so I can't use it.
    
    The coroutine is being invoked by [chan event].  More accurately, [chan event] schedules it to be invoked when the channel is readable.
    
    The problem goes away if I modify [listen] to change this line:
    
    chan event $socket readable [namespace code $socket]
    
    to this wordier version that inserts a stack level between the coroutine and the event loop:
    
    chan event $socket readable [list apply [list {} [list $socket] [namespace current]]]
    
    However, I don't think this is the solution.  This appears to be a regression in Tcl, because my code worked without complaint in previous CVS revisions of Tcl 8.6.
    
    See http://wiki.tcl.tk/_/revision?N=27377.txt&V=11 for the version of Wibble I'm using.  Also, thanks for looking into this.
    
    
  2. login: "andygoth"
  3. mimetype: "text/plain"
  4. username: "andygoth"