Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 531b4d19a96515769c6a202351fa940b91b2af5d
Ticket: 3104471fffffffffffffffffffffffffffffffff
"command returned bad code: 2" in bgerror
User & Date: andygoth on 2010-11-07 05:34:29
Changes

  1. assignee changed to: "mistachkin"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I really don't know what to make of this one.  I'll just give you the facts and let you decide what the heck is going on. :^)
    
    Earlier today I updated to the latest CVS HEAD (ChangeLog revision 1.5291), compiled, and installed.  I confirmed that the infinite loop on [append]ing to empty string is fixed.  But I then spotted a new problem while working on Wibble.  When the client closes its connection, this triggers the "finally" code at the end of [process].  On the "catch {chan close $socket}" line, I get a bgerror popup box saying: "Error: command returned bad code: 2".  This didn't happen before I did the CVS update.  I should mention that I [source]d wibble.tcl into tkcon; also, I have not changed versions of tkcon.  I used gdb to confirm that this error is being generated by TclDefaultBgErrorHandlerObjCmd() in tclEvent.c.
    
    I replaced the "finally" code with:
    
            puts a
            if {[llength [chan names $socket]]} {
                puts b
                chan close $socket
                puts c
            }
            puts d
    
    This caused "a" and "d" to be printed, and the error details are:
    
    command returned bad code: 2
    couldn't open "c:/msys/local/lib/tclIndex": no such file or directory
        while executing
    "open [file join $dir tclIndex]"
    
    which is completely mystifying.  This code appears in neither Wibble nor tkcon.  It's in [auto_load_index] in library/init.tcl, *inside* a [catch] block!
    
    Changing the "finally" code to:
    
    puts a
    catch {chan close $socket}
    puts b
    
    causes "a", "b", and "d" to be printed, and I get this error detail:
    
    command returned bad code: 2
    can not find channel named "sock252"
        while executing
    "chan close $socket"
    
    What is that catch doing, anyway?
    
  4. foundin changed to: "obsolete: 8.6b1.1"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "andygoth"
  10. subsystem changed to: "04. Async Events"
  11. title changed to: ""command returned bad code: 2" in bgerror"
  12. type changed to: "Bug"