From: SourceForge.net <no...@so...> - 2006-11-07 17:31:29
|
Bugs item #1586470, was opened at 2006-10-28 17:38 Message generated for change (Comment added) made by andreas_kupries You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1586470&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 36. File System Group: current: 8.5a5 >Status: Closed >Resolution: Fixed Priority: 8 Private: No Submitted By: Tiago Dionizio (tngd) >Assigned to: Andreas Kupries (andreas_kupries) Summary: [file copy] doesn't copy file contents on afs Initial Comment: Environment: Linux Gentoo Dual Processor AMD64 Tcl 8.5a6(CVS) - problem located (and solved) here Tcl 8.4.9 - system version, displays same problem In my university shell account, we use afs filesystems on our home directories. When i try to use [file copy $src $dst] and the $src file is located on the afs filesystem, the $dst file will be an empty file (size = 0). I tracked the problem to the following code located in the file tcl/unix/tclUnixFCmd.c(TclUnixCopyFile): #ifdef HAVE_ST_BLKSIZE blockSize = statBufPtr->st_blksize; #else in this case, blockSize will have the value 0, which leads to (un)expected results when reading from the source file and it treats it as EOF. Why does this happen (blockSize = 0)? I have no idea... but most likely related to the fact that the source filesystem is afs. A workaround would be to test the blockSize value when it has a nonpositive value and replace it with a default value when it happens. With this check all files were copied correctly. I noticed there is another similar situation when this also might happen; when statfs information is used on the source file i guess this behaviour might lead to similar problems, but i'm just guessing on this one. The problem was found while building/testing tcl from cvs HEAD, but the tcl installed on the system - tcl8.4.9 - was showing the same problem. ---------------------------------------------------------------------- >Comment By: Andreas Kupries (andreas_kupries) Date: 2006-11-07 09:31 Message: Logged In: YES user_id=75003 Committed the proposed fix to both 8.4 and 8.5 branches, with an additional comment describing the reason for the change. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2006-11-07 09:09 Message: Logged In: YES user_id=75003 Thank you for doing the tests and checking them out. ---------------------------------------------------------------------- Comment By: Tiago Dionizio (tngd) Date: 2006-11-05 07:23 Message: Logged In: YES user_id=699329 I finally had some time to take a better look at the test output. All the errors are related with filesystem permissions (read/write) which is understandable. The filesystem i tested tcl on is using ACLs for filesystem permissions and the tests ignore that, and the test results get unexpected results. The only serious problem, copying files (the contents), is the only one worth fixing and the proposed fix is given in the patch file attached to the bug report. Hope to see the fix included in CVS soon (both 8.4 and 8.5 versions). ---------------------------------------------------------------------- Comment By: Tiago Dionizio (tngd) Date: 2006-11-04 04:21 Message: Logged In: YES user_id=699329 I didn't think about running the test suite... I did it now, after doing a cvs update on the HEAD branch, but i am getting some errors and most, if not all, seem to be related with filesystem operations. I will upload the test output and will try to investigate the problem further in the next few days (as i get some free time to do it). As it seems, the problem initially reported may be only one of the issues related with afs filesystem. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2006-11-03 15:57 Message: Logged In: YES user_id=75003 Thank you for the patch. I begin to understand the problem, and I see that the fix is truly trivial. I guess that you ran the core testsuite and no problems appeared which were not present in the unchanged core, right ? I see no problem in putting that in. ---------------------------------------------------------------------- Comment By: Tiago Dionizio (tngd) Date: 2006-11-03 01:22 Message: Logged In: YES user_id=699329 I attached a diff file with my changes to fix the problem described initially. The main problem is that tcl sources trust values given by the OS to get an optimal buffer size to use when copying files and sometimes that value is zero (0). And when tcl starts copying the file, it will behave as if an EOF was reached when it did not copy a thing at all. ---------------------------------------------------------------------- Comment By: Andreas Kupries (andreas_kupries) Date: 2006-11-02 15:18 Message: Logged In: YES user_id=75003 IMHO it is a bit difficult to re-create your work from this description. As you have the changed Tcl sources available, and also the unchanged Tcl sources, can you please create a patch comparing unchanged and modified sources ? ... Please use 'diff -u' so that the result is a patch in the 'unified diff' format, which is human-readable. ---------------------------------------------------------------------- Comment By: Tiago Dionizio (tngd) Date: 2006-11-02 05:46 Message: Logged In: YES user_id=699329 has anyone even looked at this problem? i believe this is a very serious problem and should be fixed soon. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1586470&group_id=10894 |