Message-ID: <002d01c2cff6$a9ba2b90$0100a8c0@acp42g> From: "Andrew Cottrell" To: , "Richard Dawe" References: <3E286C07 DOT 7040200 AT mif DOT vu DOT lt> <3E2943DA DOT 523770FC AT phekda DOT freeserve DOT co DOT uk> <3E297258 DOT 50906 AT mif DOT vu DOT lt> <3E2A9396 DOT EF36FE73 AT phekda DOT freeserve DOT co DOT uk> <3E305DAB DOT 8090607 AT mif DOT vu DOT lt> <3E305D5A DOT 16693047 AT phekda DOT freeserve DOT co DOT uk> <3E386A1C DOT 9050303 AT mif DOT vu DOT lt> <3E3940F9 DOT A66C7217 AT phekda DOT freeserve DOT co DOT uk> <3E39880C DOT 4060607 AT mif DOT vu DOT lt> <3E398E01 DOT F62E2163 AT phekda DOT freeserve DOT co DOT uk> <3E450859 DOT 9090508 AT mif DOT vu DOT lt> Subject: Re: Take on __solve_symlinks() Date: Sun, 9 Feb 2003 15:49:22 +1100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Reply-To: djgpp-workers AT delorie DOT com > Richard Dawe wrote: > >>Very interesting, given that the first thing __solve_symlink does is to > >>copy __symlink_path to __real_path. I don't see how this patch could > >>make any difference, and it doesn't at my sandbox. The testcase gives > >>correct results both ways. I strongly suspect that we are testing two > >>different versions of __solve_symlinks... Maybe you could try copy > >>somewhere the directory with testsuite sources, copy here up to the date > >>CVS version of __solve_symlinks and add it to makefile ? > > > > > > I've just tried building with another CVS that has _no_ source changes and > > only changes to the Cygnus test suite (C++ build fixes). I just did a 'cvs > > update -dA', so it has your latest check-in for xsymlink.c ("Rearrange symlink > > loop detection"). This is my "reference" read-only tree. The test fails there > > too. > > I've created separate clean DJGPP installation with CVS libc and binaries > from clio.rice.edu dated 2003-02-01 and symlink testsuite still does not > fail here. Frankly, I think I've done everything I could at this point. > Maybe it's W98 vs W2K thing? Could somebody else with W98/W2K test > tests/libc/compat/unistd/xsymlink.c to see if it fails? In any case, I'm > unable to debug it here, so I won't for now until someone gives a clue. I could not run the test as the check for access("dir1/dir2", D_OK) fails. Did I miss something? I commented out the access(...) check and can run the test. Here are the results of the test on XP with all of the updates as of Friday 7-Feb-2003 from MS, excluding Direct X 9.0 and Movie Maker updates. The LIBC is from 1-Feb-2003 and has one patch for inode generation of files as included below. DJ204 D:\dj204\tests\libc\compat\unistd>xsymlink Running __solve_symlinks() and readlink() testsuite: Tests that check __solve_symlinks() works: Test 1 passed Test 2 passed Test 3 passed Test 4 passed Test 5 passed Test 6 passed Test 7 passed Test 8 passed Test 9 passed Test 10 passed Test 11 passed Test 12 passed Test 13 passed Tests that check __solve_symlinks() based on current directory: Test 1: Solving d:/dj204/tests/libc/compat/unistd/../../../../../dj204/tests/lib c/compat/unistd/test1 Test 1 passed Test 2: Solving d:../../../../../dj204/tests/libc/compat/unistd/test1 Test 2 passed Test 3: Solving d:../../../../../../dj204/tests/libc/compat/unistd/test1 Test 3 passed Tests that check __solve_symlinks() failure cases: Test 1 passed Test 2 passed PASS I have doen a CVS get and will be trying a complete re-build tonight with the latest LIBC, GCC 3.2.2 and an updated Text Info 4.5 and will try this again tomorow night (if all goes well) to see if there are any problems with any of the CVS updates since 1-Feb-2003. Here is the fstat.c diffs. Richard is still working on the inode patch. *** fstat.c Sun Dec 15 13:08:44 2002 --- \djgppcvs\src\libc\posix\sys\stat\fstat.c Sun Dec 15 10:43:58 2002 *************** *** 380,387 **** unsigned short trusted_ftime = 0, trusted_fdate = 0; long trusted_fsize = 0; int is_link = 0; - const char *filename; - char fixed_filename[PATH_MAX + 1]; if ((dev_info = _get_dev_info(fhandle)) == -1) return -1; /* errno set by _get_dev_info() */ --- 380,385 ---- *************** *** 398,404 **** /* Initialize buffers. */ memset(stat_buf, 0, sizeof(struct stat)); - memset(fixed_filename,0,sizeof(fixed_filename)); dos_ftime = 0; /* Get some info about this handle by conventional DOS calls. These --- 396,401 ---- *************** *** 440,445 **** --- 437,444 ---- #ifndef NO_ST_BLKSIZE if (__get_fd_name(fhandle)) { + const char *filename; + char fixed_filename[PATH_MAX + 1]; filename = __get_fd_name(fhandle); _fixpath(filename, fixed_filename); *************** *** 810,817 **** if ( (_djstat_flags & _STAT_INODE) == 0 ) { _djstat_fail_bits |= _STFAIL_HASH; ! /* fixed_filename may be either the filename or NULL */ ! stat_buf->st_ino = _invent_inode(fixed_filename, dos_ftime, trusted_fsize); } if (trusted_fsize == 510) --- 809,815 ---- if ( (_djstat_flags & _STAT_INODE) == 0 ) { _djstat_fail_bits |= _STFAIL_HASH; ! stat_buf->st_ino = _invent_inode("", dos_ftime, trusted_fsize); } if (trusted_fsize == 510) Below is the section of code that I changed. if (!__file_exists("test1") || !__file_exists("test4") || !__file_exists("test5") || !__file_exists("dirtest") || !__file_exists("fail1") || !__file_exists("fail2") || !__file_exists("fail3") || !__file_exists("dir1/fail1") || !__file_exists("dir1/test1") || !__file_exists("dir1/test2") || !__file_exists("dir1/test3") || !__file_exists("dir1/test4") || !__file_exists("dir1/test5") || !__file_exists("dir1/test6") || !__file_exists("dir1/test7")) // !__file_exists("dir1/test7") || access("dir1/dir2", D_OK)) { fprintf(stderr, "Required data files not found :- "); if (!__file_exists("test1")) fprintf(stderr, "test1"); if (!__file_exists("test4")) fprintf(stderr, "test4"); if (!__file_exists("test5")) fprintf(stderr, "test5"); if (!__file_exists("dirtest")) fprintf(stderr, "dirtest"); if (!__file_exists("fail1")) fprintf(stderr, "fail1"); if (!__file_exists("fail2")) fprintf(stderr, "fail2"); if (!__file_exists("fail3")) fprintf(stderr, "fail3"); if (!__file_exists("dir1/fail1")) fprintf(stderr, "dir1/fail1"); if (!__file_exists("dir1/test1")) fprintf(stderr, "dir1/test1"); if (!__file_exists("dir1/test2")) fprintf(stderr, "dir1/test2"); if (!__file_exists("dir1/test3")) fprintf(stderr, "dir1/test3"); if (!__file_exists("dir1/test4")) fprintf(stderr, "dir1/test4"); if (!__file_exists("dir1/test5")) fprintf(stderr, "dir1/test5"); if (!__file_exists("dir1/test6")) fprintf(stderr, "dir1/test6"); if (!__file_exists("dir1/test7")) fprintf(stderr, "dir1/test7"); if (access("dir1/dir2", D_OK)) fprintf(stderr, "access(dir1/dir2, D_OK)"); fprintf(stderr, "\n"); exit(1); }