Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:22333 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21484 invoked by uid 1010); 10 Mar 2006 15:19:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21469 invoked from network); 10 Mar 2006 15:19:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Mar 2006 15:19:07 -0000 X-Host-Fingerprint: 204.11.219.142 unknown Received: from ([204.11.219.142:63305] helo=lt4.firehawksystems.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 93/21-27106-AE891144 for ; Fri, 10 Mar 2006 10:19:07 -0500 Received: from [10.0.0.2] ([69.219.226.176]) (authenticated bits=0) by lt4.firehawksystems.com (8.13.5/8.13.3) with ESMTP id k2A8UJZS089499; Fri, 10 Mar 2006 08:30:19 GMT In-Reply-To: <44112364.7070607@lerdorf.com> References: <0FF5C589-6436-45E0-8626-F0B9944046ED@firehawksystems.com> <7.0.1.0.2.20060309222503.08a04930@zend.com> <44111D29.8030407@lerdorf.com> <44112364.7070607@lerdorf.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: Cc: Andi Gutmans , internals@lists.php.net Content-Transfer-Encoding: 7bit Date: Fri, 10 Mar 2006 10:19:14 -0500 To: Rasmus Lerdorf X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: ClamAV version 0.88, clamav-milter version 0.87 on lt4.firehawksystems.com X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on lt4.firehawksystems.com Subject: Re: [PHP-DEV] primary file realpath change From: list@firehawksystems.com ("Brian J. France") On Mar 10, 2006, at 1:57 AM, Rasmus Lerdorf wrote: > Rasmus Lerdorf wrote: >> Andi Gutmans wrote: >>> Are you sure VCWD_REALPATH doesn't use the realpath cache? It did >>> last time I checked and I think is still the right method to use >>> there... >> quite >> #define VCWD_REALPATH(path, real_path) realpath(path, real_path) > > By the way, I agree that expand_filepath() is not the right fix > here since the first thing it does is a getcwd. We have just done > a chdir and haven't executed any script yet so we know the cwd. > Feed that directly to virtual_file_ex() there perhaps? I haven't > really dug into it. Were you seeing two getcwd calls? I can remove one, but I don't see away around the second one. I changed to virtual_realpath which does remove the getcwd in php_execute_script function, but it seems that is shows up a little later when it uses the stream open which called expand_filepath: #0 0x203ab410 in __getcwd () from /usr/lib/libc.so.4 #1 0x203b2ab6 in getcwd () from /usr/lib/libc.so.4 #2 0x2060de86 in expand_filepath (filepath=0x2cbc08 "/ bench_main.php", real_path=0x0) at main/fopen_wrappers.c:521 #3 0x2061c1bd in _php_stream_fopen (filename=0x2cbc08 "/ bench_main.php", mode=0x206f1fe3 "rb", opened_path=0x9fbff7cc, options=133) at /main/streams/plain_wrapper.c:855 #4 0x2061c974 in _php_stream_fopen_with_path (filename=0x2cbc08 "/bench_main.php", mode=0x206f1fe3 "rb", path=0x12b640 ".://pear", opened_path=0x9fbff7cc, options=133) at /main/streams/plain_wrapper.c:1238 #5 0x2061c338 in php_plain_files_stream_opener (wrapper=0x2077c008, path=0x2cbc08 "/bench_main.php", mode=0x206f1fe3 "rb", options=133, opened_path=0x9fbff7cc, context=0x0) at/main/streams/plain_wrapper.c:931 #6 0x2061962e in _php_stream_open_wrapper_ex (path=0x2cbc08 "bench_main.php", mode=0x206f1fe3 "rb", options=141, opened_path=0x9fbff7cc, context=0x0) at main/streams/streams.c:1771 #7 0x2060943b in php_stream_open_for_zend (filename=0x2cbc08 "/ bench_main.php", handle=0x9fbff7c4) at main/main.c:901 #8 0x2064a866 in zend_stream_open (filename=0x2cbc08 "/ bench_main.php", handle=0x9fbff7c4) at Zend/zend_stream.c:47 #9 0x2064a8dc in zend_stream_fixup (file_handle=0x9fbff7c4) at Zend/ zend_stream.c:62 #10 0x20623ee7 in open_file_for_scanning (file_handle=0x9fbff7c4) at Zend/zend_language_scanner.c:2982 #11 0x20623fce in compile_file (file_handle=0x9fbff7c4, type=2) at Zend/zend_language_scanner.c:3068 #12 0x2063cd1c in zend_execute_scripts (type=8, retval=0x0, file_count=3) at Zend/zend.c:1093 #13 0x2060a653 in php_execute_script (primary_file=0x9fbff7c4) at main/main.c:1724 Brian