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

php_config.h for both a working and non-working configuration were sent
to sniper at php dot net.  The difference between the two was:

diff -puBb  ~/src/php_config.h-*
--- /home/user/src/php_config.h-broken        2006-01-04
09:30:07.000000000 -0700
+++ /home/user/src/php_config.h-working       2006-01-04
09:56:57.000000000 -0700
@@ -907,22 +907,22 @@
 /* #undef ROXEN_USE_ZTS */

 /* whether write(2) works */
-/* #undef PHP_WRITE_STDOUT */
+#define PHP_WRITE_STDOUT 1

 /*   */
-/* #undef FORCE_CGI_REDIRECT */
+#define FORCE_CGI_REDIRECT 0

 /*   */
-/* #undef DISCARD_PATH */
+#define DISCARD_PATH 0

 /*   */
-/* #undef ENABLE_PATHINFO_CHECK */
+#define ENABLE_PATHINFO_CHECK 1

 /*   */
-/* #undef PHP_FASTCGI */
+#define PHP_FASTCGI 0

 /*   */
-/* #undef PHP_FCGI_STATIC */
+#define PHP_FCGI_STATIC 0

 /* Define to the necessary symbol if this constant
                            uses a non-standard name on your system.
*/
@@ -2543,7 +2543,7 @@
 #define PHP_CAN_SUPPORT_PROC_OPEN 1

 /* Whether to enable chroot() function */
-/* #undef ENABLE_CHROOT_FUNC */
+#define ENABLE_CHROOT_FUNC 1

 /*   */
 #define HAVE_RES_NMKQUERY 1
@@ -2798,7 +2798,7 @@
 #define USE_ZEND_ALLOC 1

 /*   */
-#define ZTS 1
+/* #undef ZTS */

 /* Memory limit */
 #define MEMORY_LIMIT 0
@@ -2819,7 +2819,7 @@
 #define ZEND_MM_ALIGNMENT_LOG2 2

 /*   */
-#define ZTS 1
+/* #undef ZTS */

 /* Whether you use GNU Pth */
 /* #undef GNUPTH */
@@ -2831,7 +2831,7 @@
 /* #undef BETHREADS */

 /* Whether to use Pthreads */
-#define PTHREADS 1
+/* #undef PTHREADS */

 /* PHP build date */
 #define PHP_BUILD_DATE "2006-01-04"
@@ -2938,4 +2938,4 @@ int zend_sprintf(char *buffer, const cha
  * indent-tabs-mode: t
  * End:
  */
-#define PTHREADS 1
+/* #undef PTHREADS */


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

[2006-01-04 01:23:20] [EMAIL PROTECTED]

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

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

[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.

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

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