ID:               41899
 Updated by:       [EMAIL PROTECTED]
 Reported By:      geoffwa at cs dot rmit dot edu dot au
 Status:           Assigned
 Bug Type:         Streams related
 Operating System: Solaris 10
 PHP Version:      5.2.3
 Assigned To:      tony2001
 New Comment:

Thanks, but I need to do it myself in order to understand it.

I know quite well that realpath() on Solaris is badly broken, that's
known issue and Sun is not going to do anything about as far as I
understand.
The problem is that we need to invent a workaround for it so that we
don't break working realpath() implementations.
And to do that I need to reproduce it myself and investigate it using
GDB.


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

[2007-07-06 15:00:30] geoffwa at cs dot rmit dot edu dot au

Doing a bit of tracing of expand_filepath nets:

(from PHP-5.2.3)
expand_filepath(filepath = 0xffbff5f4 "test2.php",
                real_path = 0xffbfee20 "")
                called from function php_execute_script
expand_filepath returns 0xffbfee20 "/home/g/geoffwa/test/test2.php"
expand_filepath(filepath = 0xffbfdec0 "./a",
                real_path = 0xffbfe2c4 "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe2c4 "/home/g/geoffwa/test/a"
expand_filepath(filepath = 0xffbfe108 "./a/b/file",
                real_path = 0xffbfe50c "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe50c "/home/g/geoffwa/test/a/b/file"
expand_filepath(filepath = 0xffbfe098 "./a",
                real_path = 0xffbfe49c "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe49c "/home/g/geoffwa/test/a"
expand_filepath(filepath = 0xffbfe028 "./a",
                real_path = 0xffbfe42c "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe42c "/home/g/geoffwa/test/a"
expand_filepath(filepath = 0xffbfe120 "./a/b",
                real_path = 0xffbfe524 "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe524 "/home/g/geoffwa/test/a/b"
expand_filepath(filepath = 0xffbfdfd8 "../b/file",
                real_path = 0xffbfe3dc "")
                called from function php_checkuid_ex
expand_filepath returns (nil)

(from PHP 5.2 snap 200707060030)
expand_filepath(filepath = 0xffbff5ef "test2.php",
                real_path = 0xffbfee18 "")
                called from function php_execute_script
expand_filepath returns 0xffbfee18 "/home/g/geoffwa/test/test2.php"
expand_filepath(filepath = 0xffbfdeb8 "./a",
                real_path = 0xffbfe2bc "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe2bc "/home/g/geoffwa/test/a"
expand_filepath(filepath = 0xffbfe100 "./a/b/file",
                real_path = 0xffbfe504 "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe504 "/home/g/geoffwa/test/a/b/file"
expand_filepath(filepath = 0xffbfe090 "./a",
                real_path = 0xffbfe494 "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe494 "/home/g/geoffwa/test/a"
expand_filepath(filepath = 0xffbfe020 "./a",
                real_path = 0xffbfe424 "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe424 "/home/g/geoffwa/test/a"
expand_filepath(filepath = 0xffbfe118 "./a/b",
                real_path = 0xffbfe51c "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe51c "/home/g/geoffwa/test/a/b"
expand_filepath(filepath = 0xffbfdfd0 "../b/file",
                real_path = 0xffbfe3d4 "")
                called from function php_checkuid_ex
expand_filepath returns 0xffbfe3d4 "../b/file"
expand_filepath(filepath = 0x53d1c0 "../b/file",
                real_path = (nil))
                called from function _php_stream_fopen
expand_filepath returns 0x53d398 "../b/file"

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

[2007-07-06 14:02:04] [EMAIL PROTECTED]

Which configure options did you use?
As I said, I don't see any difference between 5.2.3 and the snapshot
and there should not be any difference since I don't remember any
changes that could affect it.

>We use Sun Studio's C compiler, so I can use dbx for debugging
I can use that too, but I prefer GDB.

>Is there anything I can trace for you?
No, I'm still hoping to get GCC & GDB working there.

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

[2007-07-06 13:56:10] geoffwa at cs dot rmit dot edu dot au

I've updated
http://goanna.cs.rmit.edu.au/~geoffwa/relative_path_bug.php
with a shorter test script and two syscall traces of 5.2.3 and
5.2-200707060030.

Looking through these the main difference is that 5.2.3 makes a stat()
call with an empty path, whereas 5.2-snap makes a stat() call using
the
relative path supplied to fopen() in the PHP script.

We use Sun Studio's C compiler, so I can use dbx for debugging
(gdb crashes on most Sun-compiled binaries I give it). Is there
anything I can trace for you?

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

[2007-07-06 09:26:43] [EMAIL PROTECTED]

I'm still able to reproduce it, though I'm not able to debug it since
both GDB and GCC fail to compile on Solaris.
I'm working on that atm..

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

[2007-07-06 07:54:46] [EMAIL PROTECTED]

Since it's fixed in CVS -> closed.

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

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/41899

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

Reply via email to