Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a2ede902fe1b4467ced9d6f315be6ba937b7101c
Ticket: 97069ea11aca3783949c0379725eed90f5573c23
close returns empty error message if failed non-blocking write flush pending
User & Date: oehhar on 2014-04-01 07:45:19
Changes

  1. icomment:
    I tried today to populate the unreportedMsg field by the following patch.
    <verbatim>
    --- C:/test/tcl-bug-97069ea11a_no_error_message/generic/tclIO_ori.c	Tue Apr 01 08:29:28 2014
    +++ C:/test/tcl-bug-97069ea11a_no_error_message/generic/tclIO.c	Tue Apr 01 09:03:48 2014
    @@ -2531,10 +2531,15 @@
     
     		if (statePtr->unreportedError == 0) {
     		    statePtr->unreportedError = errorCode;
    -		    statePtr->unreportedMsg = msg;
    -		    if (msg != NULL) {
    -			Tcl_IncrRefCount(msg);
    +		    /*
    +		     * Bug 97069ea11a: If unreportedError is set, always set
    +		     * an error message to.
    +		     */
    +		    if (msg == NULL) {
    +			msg = Tcl_NewStringObj(Tcl_ErrnoMsg(errorCode),-1);
     		    }
    +		    Tcl_IncrRefCount(msg);
    +		    statePtr->unreportedMsg = msg;
     		} else {
     		    /*
     		     * An old unreported error is kept, and this error thrown
    </verbatim>
    Unfortunately, this field attends a 4 elements list structure to report in:
       *   TclChanCaughtErrorBypass()
       *   > UnmarshallErrorResult(interp,msg="host is not connected")
    and only the errorNo is set, not the message.
    The following patch
    
  2. login: "oehhar"
  3. mimetype: "text/x-fossil-wiki"
  4. username: "oehhar"