Skip to content
Tcl Source Code History Of Ticket 723502ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 723502ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 723502ffffffffffffffffffffffffffffffffff

  1. Ticket change [4f2d9d7472] (rid 125780) by peterdrexel on 2003-04-18 05:04:31:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Version: TCL 8.4.2
      
      OS: Mac OSX 10.1.5 (or any platform where TCL_THREADS is 
      defined)
      
      Behavior: Directory entries are not read correctly when TCL 
      commands such as glob are used. Instead the result indicates 
      that no entries could be found.
      
      Expected Behavior: glob *.o should return a list of .o files within a 
      directory (it there are any of course)
      
      The last argument in the call to memcpy in the function 
      TclpReaddir in source file tclUnixThrd.c is incorrect. The sizeof 
      operator is applied to the address of the item being copied instead 
      of the item itself and consequently only a fraction of the 
      necessary directory information is being copied.
      
      8.4.2 code:
      
              memcpy((VOID *) &tsdPtr->rdbuf.ent, (VOID *) ent,
                      sizeof(&tsdPtr->rdbuf));
      
      should read:
      
              memcpy((VOID *) &tsdPtr->rdbuf.ent, (VOID *) ent,
                      sizeof(tsdPtr->rdbuf));
      
      
    4. foundin initialized to: "obsolete: 8.4.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "peterdrexel"
    9. subsystem initialized to: "49. Threading"
    10. title initialized to: "Directory Read Bug w/TCL_THREADS"
    11. type initialized to: "Bug"
  2. Add attachment "tclUnixThrd.c" [3c77d4dadc] (rid 120922) by peterdrexel on 2003-04-18 12:04:31.

  3. Ticket change [c7d0056730] (rid 122005) by peterdrexel on 2003-04-18 12:04:31:

    1. icomment:
      
      
      File Added - 48090: tclUnixThrd.c
      
      
      
    2. login: "peterdrexel"
    3. mimetype: "text/plain"
    4. username: "peterdrexel"
  4. Ticket change [c3010178e1] (rid 111583) by hobbs on 2003-04-19 02:09:54:

    1. assignee changed to: "das"
    2. priority changed to: "7 High"
  5. Ticket change [005ac6d072] (rid 119308) by hobbs on 2003-05-11 07:04:06:

    1. assignee changed to: "vasiljevic"
    2. priority changed to: "8"
  6. Ticket change [ca51c8eb0c] (rid 95324) by vasiljevic on 2003-05-12 14:52:13:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
       Well, this is happening for older 10.1.xxx OSX since  
      newer ones have readdir_r already. 
      But the bug report is correct, i.e. there is a  
      mistake in the code, as described. I will correct 
      this in both CVS HEAD and in 8.4 branch if  
      nobody objects. 
       
      Th problem is: even the newer readdir_r with its 
      opendir/closedir companions is broken for MT. 
       
      I will have to avait the new OSX update and if it  
      shows same problems, I might talk to Daniel Steffen 
      and Jim Ingham how best to correct that. 
       
      Zoran 
       
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  7. Ticket change [2e9bc0fde7] (rid 92924) by das on 2003-05-12 15:00:26:

    1. priority changed to: "9 Immediate"
  8. Ticket change [b271b24626] (rid 98336) by das on 2003-05-12 15:00:27:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      Zoran,
      could you check this soon so that it makes it into 8.4.3 (or I can 
      do it if you prefer), 8.4.2 is completely broken on 10.1 due to 
      this...
      
      are you saying that we should use the tcl provided version of 
      readdir_r  on 10.2 and later as well (similar to what we need to 
      do for realpath in bug 711232)?
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  9. Ticket change [24000ca540] (rid 131031) by das on 2003-05-12 15:10:48:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      oops, I meant "check this in", not "check this"...
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  10. Ticket change [c512361917] (rid 111933) by vasiljevic on 2003-05-12 15:14:40:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      Oh yes. The readdir_r in 10.2 (at least the version I have) 
      is also broken when multiple threads are engaged in file tree 
      walks. The problem is difficult to reproduce (as with all MT 
      problems, phew) but it's there.  
      We have our own kind of "find" utility employing MT 
      and written for the AOLserver. Now, for that, I had to write 
      my own readdir/opendir/closedir wrappers. 
      I hope to see the problem solved with the new release  
      of MacOSX. If not, we must/should do something there 
      as well. I wouldn't rush, though, because most of the people 
      won't hit this one. 
       
      Speaking of 10.1 bug, it is ok. I will correct it in the CVS now. 
      Zoran.  
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  11. Ticket change [f5888e7e3f] (rid 130127) by das on 2003-05-12 15:19:41:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      oy, that's bad, the point of _r in readdir_r is supposed to be that 
      it's thread safe... I hope you have reported this as a bug to 
      Apple?
      Given that I have to do something for realpath in the 
      makesystem already, I'll see about removing HAVE_READDIR_R  
      as well so that the tcl version gets used.
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  12. Ticket change [437a60c101] (rid 116559) by vasiljevic on 2003-05-12 15:32:28:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      Well, the readdir_r is supposed to be thread-safe, but 
      on osx, when many threads are doing: 
       
        opendir 
        readdir_r 
        closedir 
       
      in parallel, you get memory corruption in closedir 
      after a while.  
      What I did was wrap all those with my own wrappers 
      with my_opendir doing the actual opendir, slurping 
      all dir entries in an linked list with readdir_r and 
      my_readdir simply traversing this list. The my_closedir 
      frees the whole thing. All work of my_opendir is done 
      under mutex protection. This was the only way I could 
      solve the memory-trashing, which happens otherwise. 
       
      I'm not sure you can plug this into Tcl current layout 
      easily. That's why I suggest to wait for Apple to catch 
      up and update the OS and correct the bug. 
       
      No; I haven't posted a bug to Apple yet. Somehow I have 
      a very bad feeling about that (i.e. waste of time) judging 
      from my own previous experiences with the company.  
      But I may be wrong and things may have changed since... 
       
      Zoran 
       
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  13. Ticket change [f569679a03] (rid 130102) by das on 2003-05-12 15:42:00:

    1. icomment:
      Logged In: YES 
      user_id=90580
      
      so does this mean that the code in tclUnixThrd.c fails on OS X 
      even if HAVE_READDIR_R is not defined due to the opendir/
      closedir bug?
      
      I have had good experiences with bug reports to
      http://bugreporter.apple.com
      but I fear it may already be too late now to get a fix into 10.3, 
      you should ask if this bug is known and if it will be fixed in 10.3 
      on the darwin developers list
      http://www.lists.apple.com/mailman/listinfo/darwin-development
      many apple engineers working at the libc level hang out there.
      Might be useful to mention the realpath issue as well.
      
      
    2. login: "das"
    3. mimetype: "text/plain"
    4. username: "das"
  14. Ticket change [507517269f] (rid 125971) by vasiljevic on 2003-05-12 15:54:01:

    1. icomment:
      Logged In: YES 
      user_id=95086
      
      I can't say for sure, without actually testing this, but I suppose 
      yes, it will break. 
      So, the better way, as I said is to try the regular bug-report 
      path. 
      I will try the bugreporter.apple.com. Lets see how this works. 
       
      BTW, this one is now fixed both in 8.4 branch and in head. 
      Zoran  
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  15. Ticket change [64b1b62114] (rid 92814) by hobbs on 2003-05-15 00:38:16:

    1. closedate changed to: "2003-05-14T17:38:16"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      Closing as Zoran noted it was fixed.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "hobbs"