ID:               35940
 User updated by:  cristic at interaktonline dot com
 Reported By:      cristic at interaktonline dot com
 Status:           Open
 Bug Type:         Apache related
 Operating System: Windows XP
 PHP Version:      5CVS-2006-01-09 (snap)
 New Comment:

Now I am able to understand better the problem after studying the
manual.

http://www.php.net/virtual
" To run the sub-request, all buffers are terminated and flushed to the
browser, pending headers are sent too."

This means that the headers are sent to the browser when virtual() is
used.

Now, my code from the a.php beeing:

<?php virtual('/b.php'); ?>
<?php header('Location:c.php'); ?>

The normal PHP error message should be on both Linux and Windows
machines:

Warning: Cannot modify header information - headers already sent by
(output started at /var/www/html/a.php:1) in /var/www/html/a.php on
line 2

Windows Bug: Right now the PHP on Windows crashes (by seeing the
trace), I suppose, when tries to get the line number either where the
headers were sent or where the Warning is generated.

Linux Bug: The error line that is reported to generate the Warning is 0
instead of the line where the header() statement is used meaning line 2.


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

[2006-01-11 12:29:22] cristic at interaktonline dot com

I don't know if this is correct but here is what appears into the call
stack window:

        >       php5ts.dll!zend_get_executed_lineno(void * * * 
tsrm_ls=0x015ee1a0) 
Line 367 + 0x2 bytes    C
        php5ts.dll!zend_error(int type=2, const char * format=0x00a60e3c,
...)  Line 930 + 0x8 bytes      C
        php5ts.dll!sapi_header_op(int op=0, void * arg=0x0175fa00, void * * *
tsrm_ls=0x015ee1a0)  Line 533 + 0xf bytes       C
        php5ts.dll!zif_header(int ht=1, _zval_struct *
return_value=0x013c2d98, _zval_struct * * return_value_ptr=0x00000000,
_zval_struct * this_ptr=0x00000000, int return_value_used=0, void * * *
tsrm_ls=0x015ee1a0)  Line 49 + 0x17 bytes       C
        php5ts.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data=0x0175fa98, void * * * tsrm_ls=0x015ee1a0)  Line 192 +
0x35 bytes      C
        php5ts.dll!ZEND_DO_FCALL_SPEC_CONST_HANDLER(_zend_execute_data *
execute_data=0x00000000, void * * * tsrm_ls=0x015ee1a0)  Line 1587 +
0xe bytes       C
        php5ts.dll!execute(_zend_op_array * op_array=0x00000000, void * * *
tsrm_ls=0x00000000)  Line 92 + 0xc bytes        C
        msvcrt.dll!77c39f8e()   
        [Frames below may be incorrect and/or missing, no symbols loaded for
msvcrt.dll]     
        user32.dll!77d510c7()   
        user32.dll!77d5110e()   
        php5ts.dll!php_execute_script(_zend_file_handle *
primary_file=0x0175fdcc, void * * * tsrm_ls=0x015ee1a0)  Line 1720 +
0x12 bytes      C
        php5apache.dll!apache_php_module_main(request_rec * r=0x007bd2f8, int
display_source_mode=0, void * * * tsrm_ls=0x015ee1a0)  Line 53 + 0x1b
bytes   C
        php5apache.dll!send_php(request_rec * r=0x007bd2f8, int
display_source_mode=0, char * filename=0x007bde68)  Line 643 + 0xb
bytes   C
        php5apache.dll!send_parsed_php(request_rec * r=0x007bd2f8)  Line 657
+ 0xe bytes     C
        ApacheCore.dll!6ff64bc7()       
        ApacheCore.dll!6ff74a73()       
        ApacheCore.dll!6ff74746()       
        ApacheCore.dll!6ff6be0f()       
        ws2_32.dll!71ab3a91()   
        ApacheCore.dll!6ff6bc5a()       
        msvcrt.dll!77c3a3b0()   
        ws2_32.dll!71ab3a91()   
        ws2_32.dll!71ab87a9()   
        kernel32.dll!7c80b50b()         
        ws2_32.dll!71ab3a91()   
        ws2_32.dll!71ab87a9()   
        kernel32.dll!7c8399f3()         


for the following error:

The thread 'Win32 Thread' (0x13d4) has exited with code 0 (0x0).
Unhandled exception at 0x00876d6c (php5ts.dll) in Apache.exe:
0xC0000005: Access violation reading location 0x0001ee6c.


with this build: php5.1-win32-200601110730.zip

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

[2006-01-10 23:34:02] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.



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

[2006-01-10 16:59:09] cristic at interaktonline dot com

OK, I installed a new machine from scratch:
Windows XP Home SP2
Apache 1.3.34
PHP Version 5.1.2RC3-dev ( Build Date Jan 9 2006 12:14:14)

The PHP is installed as ISAPI:
httpd.conf:
LoadModule php5_module "C:/php5/php5apache.dll"
AddModule mod_php5.c
AddType application/x-httpd-php .php

php.ini changes over php.ini-distribution:
short_open_tag = Off
precision    =  14
output_buffering = 4096
zlib.output_compression = On

allow_call_time_pass_reference = Off
error_reporting  =  E_ALL
log_errors = On
variables_order = "GPCS"
register_long_arrays = Off
register_argc_argv = Off
default_charset = "iso-8859-1"

extension_dir = "c:/php5/ext"

extension=php_mbstring.dll
extension=php_bz2.dll
extension=php_gd2.dll
extension=php_mysql.dll
extension=php_sqlite.dll
extension=php_xsl.dll

session.save_path = "C:\Windows\Temp"
session.gc_divisor     = 1000
session.bug_compat_42 = 0
session.hash_bits_per_character = 5
url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=fakeentry"


When calling into the browser (IE 6.0) http://localhost/a.php the
Apache crash:

Error signature:
szAppName : Apache.exe     szAppVer : 0.0.0.0     szModName :
php5ts.dll     
szModVer : 5.1.2.2     offset : 00096d6c

The following files will be included into this report:
C:\DOCUME~1\dbarascu\LOCALS~1\Temp\WERA2.tmp.dir00\Apache.exe.mdmp
C:\DOCUME~1\dbarascu\LOCALS~1\Temp\WERA2.tmp.dir00\appcompat.txt

If you want I may provide you a link to these 2 files as well if is
needed.

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

[2006-01-09 12:51:28] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip

This is most likely fixed in CVS already.

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

[2006-01-09 10:55:06] cristic at interaktonline dot com

Description:
------------
When a redirect (header('Location:')) is used with a virtual include
the Apache crash:

---------------------------
Apache.exe - Application Error
---------------------------
The instruction at "0x008736ac" referenced memory at "0x0001ee6c". The
memory could not be "read".


Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK   Cancel   
---------------------------


Reproduce code:
---------------
a.php:
<?php virtual(/b.php);?>
<?php header('Location: http://server.com/c.php');?>

b.php:
<?php ?>

c.php:
<?php phpinfo(); ?>

Expected result:
----------------
When doing this I just expect to be redirected to the c.php.

Actual result:
--------------
1. Windows XP and Apache/1.3.33(Win32):
---------------------------
Apache.exe - Application Error
---------------------------
The instruction at "0x008736ac" referenced memory at "0x0001ee6c". The
memory could not be "read".


Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK   Cancel   
---------------------------

The php.ini differences with php.ini-dist:

short_open_tag = Off
output_buffering = 65535
output_handler = ob_gzhandler
allow_call_time_pass_reference = Off
memory_limit = 100M
error_reporting  = E_ALL 
log_errors = On
error_log = errors_php
register_long_arrays = Off
register_argc_argv = Off

2.Linux Fedora RC 4, Apache 2.0.54:

The Apache is not crashing anymore but the header() is still not
working: 

Warning: Cannot modify header information - headers already sent by
(output started at /var/www/html/a.php:1) in /var/www/html/a.php on
line 0

------------------------------------
The problem I could reproduce on Linux on PHP 4.3.11 as well.


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


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

Reply via email to