ID:               35791
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jgmtfia at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Filesystem function related
 Operating System: Linux
 PHP Version:      5CVS-2006-01-03 (snap)
 New Comment:

I'm still waiting for the php_config.h from the build the test fails
with..


Previous Comments:
------------------------------------------------------------------------

[2006-01-03 22:48:28] jgmtfia at gmail dot com

When I use the configure line:
./configure --disable-all --disable-cgi --enable-debug

The test passes and the strace output looks very much like that of php
4.3.10-15.

write(1, "Checking A.\n", 12) = 12
access("A", F_OK) = 0
write(1, "Checking C.\n", 12) = 12
access("C", F_OK) = 0
write(1, "Unlinking C.\n", 13) = 13
unlink("C") = 0
write(1, "Checking C: ", 12) = 12
access("C", F_OK) = -1 ENOENT (No such file or directory)

Which is the expected output.

I also tried ./configure with no arguments, which worked.  I then went
back to my original configure was: 
 ./configure --with-apxs2=/usr/bin/apxs2 --enable-so \
 --with-xsl --with-xmlreader

I have narrowed it down to the 
 --with-apxs2=/usr/bin/apxs2 
flag.

When this ./configure flag is given the problem occurs in the cli
version of PHP.  When this flag is not given the test passes.

------------------------------------------------------------------------

[2006-01-03 18:31:37] [EMAIL PROTECTED]

Configure PHP with this configure line:

# rm config.cache ; ./configure --disable-all --disable-cgi
--enable-debug
# make 

Then test, if it fails -> send your main/php_config.h to me.

------------------------------------------------------------------------

[2006-01-03 17:19:45] jgmtfia at gmail dot com

I want to ensure that I have made my point clear.  I have made a
simplier example, and have included an edited strace of PHP built from
yesterdays source.

The test:
<?php
`touch A; ln -s A C`;

echo "Checking A.\n";
if(!file_exists('A')){
    echo "A does not exist.\n";
    exit;
}

echo "Checking C.\n";
if(!file_exists('C')){
    echo "C does not exist.\n";
    exit;
}

echo "Unlinking C.\n";
unlink('C');

clearstatcache();

echo "Checking C: ";
if(file_exists('C'))
    echo "(FAIL) exists\n";
?>

The ouput: 
Checking A.
Checking C.
Unlinking C.
Checking C: (FAIL) exists

The edited strace:
write(1, "Checking A.\n", 12)
lstat64("/home", ...) = 0
lstat64("/home/user", ...) = 0
lstat64("/home/user/x", ...) = 0
lstat64("/home/user/x/A", ...) = 0
access("/home/user/x/A", F_OK) = 0

write(1, "Checking C.\n", 12)
lstat64("/home", ...) = 0
lstat64("/home/user", = 0
lstat64("/home/user/x", = 0
lstat64("/home/user/x/C", = 0
readlink("/home/user/x/C", "A", 4096) = 1
lstat64("/home/user/x/A", ...) = 0
access("/home/user/x/A", F_OK) = 0

write(1, "Unlinking C.\n", 13) = 13
unlink("/home/user/x/C") = 0
write(1, "Checking C: ", 12) = 12
***ERROR SHOULD BE "/home/user/x/C" BELOW ***
access("/home/user/x/A", F_OK) = 0
***END***
write(1, "(FAIL) exists\n", 14) = 14

So the question is why is PHP calling access("/home/user/x/A") when the
code calls file_exists('C')?

Also note that if the file_exists('C') call is removed from the start
code, the code then executes correctly.
<?php
`touch A; ln -s A C`;

echo "Unlinking C.\n";
unlink('C');

clearstatcache();

echo "Checking C: ";
if(file_exists('C'))
    echo "(FAIL) exists\n";

?>

I don't know if it would be the operating system that would cause PHP
to access("/home/user/x/A") when I call file_exists('C').

debain php4.3.10-15 does pass the test and there are no lstat64 or
readlink calls.

write(1, "Checking A.\n", 12) = 12
access("A", F_OK) = 0
write(1, "Checking C.\n", 12) = 12
access("C", F_OK) = 0
write(1, "Unlinking C.\n", 13) = 13
unlink("C") = 0
write(1, "Checking C: ", 12) = 12
access("C", F_OK) = -1 ENOENT (No such file or directory)

------------------------------------------------------------------------

[2006-01-02 17:15:11] [EMAIL PROTECTED]

You can strace the script and see what files are actually being
accessed.

------------------------------------------------------------------------

[2006-01-02 17:10:27] jgmtfia at gmail dot com

I tested the "lastest" version (php5.1-200601021330) on debian stable
and it failed.  Over the holidays I tried 5.1.1 with debian testing and
it passed.

A summary of results:
4.3.10 - debian stable - pass
5.1.0b3 - debian stable - fail
5.1.0 - debian stable - fail
5.1.1 - debian stable - fail
5.1.1 - debian testing - pass
php5.1-200601021330 - debian stable - fail
5.1.2RC2-dev - SUSE Linux 10 x86_64 - pass

Common to all failures is Debian stable.  Do you have any suggestions
on how to approach finding what is causing the fault?

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/35791

-- 
Edit this bug report at http://bugs.php.net/?id=35791&edit=1

Reply via email to