Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cddd9f8b01e1427dbb83bb8b304e584b365cc269
Ticket: 528284ffffffffffffffffffffffffffffffffff
Fix filesystem crashed under win98
User & Date: mdejong on 2002-03-10 23:52:46
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    I noticed that Tcl is not able to make it through
    the tests in winFCmd.test without crashing or
    going into an infinite loop under Windows 98.
    
    I created this patch, which fixes the crashes
    and returns ENOENT when a path like "" is
    passed in. The comments for these functions
    state that ENOENT should be returned, but I
    am not sure that jives with the test cases
    in winFCmd.test. I would ask that someone
    run the tests in winFCmd.test under NT to
    see if this patch changes any of the test
    results. Further changes to the expected
    test results may be needed, but I am not sure
    how the 98/NT thing plays into it just now.
    
    Also, this patch changes a check that looked
    like so:
    
    if (tclWinProcs->useWide) {
      if (((WCHAR *) nativePath)[0] == '\0') {
        Tcl_SetErrno(ENOENT);
          return TCL_ERROR;
      }
    } else {
      if (((char *) nativePath)[0] == '\0') {
        Tcl_SetErrno(ENOENT);
        return TCL_ERROR;
      }
    }
    
    to:
    
    if (nativePath == NULL || nativePath[0] == '\0') {
      Tcl_SetErrno(ENOENT);
      return TCL_ERROR;
    }
    
    
    I could not see any reason to make this extra
    useWide check, so I took a peek at the generated
    ASM:
    
    9:            cond = ((WCHAR *) path[0] == '\0');
    0040102A   mov         eax,dword ptr [path]
    0040102D   movsx       ecx,byte ptr [eax]
    00401030   neg         ecx
    00401032   sbb         ecx,ecx
    00401034   inc         ecx
    00401035   mov         dword ptr [cond],ecx
    10:       } else {
    00401038   jmp         main+38h (00401048)
    11:           cond = ((char *) path[0] == '\0');
    0040103A   mov         edx,dword ptr [path]
    0040103D   movsx       eax,byte ptr [edx]
    00401040   neg         eax
    00401042   sbb         eax,eax
    00401044   inc         eax
    00401045   mov         dword ptr [cond],eax
    
    The code certainly looks exactly the same,
    except for the registers that are used.
    Since I could not come up with any reason
    for this extra complexity, I removed it.
    
    
  4. foundin changed to: "None"
  5. priority changed to: "9 Immediate"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "mdejong"
  9. subsystem changed to: "37. File System"
  10. title changed to: "Fix filesystem crashed under win98"
  11. type changed to: "Patch"