Zeev Suraski wrote:

> After some more investigation, it *might* be related to a bug that 
> existed in 4.0.7 with multiple levels of internal output buffering, so I 
> may have spoken too soon.  I can't really reproduce it, so I asked Yasuo 
> Ohgaki to take a look at it.  If it's indeed the issue, it's a one line 


I've tested and updated bug reports. It seems the problem (output 
compression) is fixed in 4.2.0-dev. There is this problem in 
4.1.0RC sitll.

> fix that can be MFH'd today, and at any rate, it'll only affect people 
> who use zlib.output_compression, plus the mbstring automatic conversion 
> feature.


I've tested with and without mbstring. The result was the same for 
me. (My glibc 2.2.2 or kernel 2.4.4 is broken? I using patched 
kernel 2.4.4 from distribution. It does not hang at least by now. 
However, your linux kernel may freeze if you try this, be careful) 
4.1.0RC still have problem with output compression.

'./configure' \
'--with-apxs' \
'--disable-short-tags' \
'--without-mysql' \
'--without-pear' \
'--with-bz2' \
'--with-zlib' \
'--enable-debug' \

httpd keeps getting larger and larger...
I attached backtrace.


> Another option is that it may be a bug in the mbstring auto conversion, 
> as there's at least one more bug report that may be related (#13698).  
> It crashes under both HEAD and 4.1.0RC1 (HEAD requires a more complex 
> script, but the bug is there).


For both 4.2.0-dev and 4.1.0RC, I cannot reproduce the problem 
now (segfault at the end of script execution when cgi version is 
built with --enable-debug) It does not segfault with test scripts 
and my scripts so far. (I'll open the bug report when I could 
reproduce the problem again. Or should I open it now?)

Problem may exist, since any NULL zval pointer can cause segfault 
at CHECK_ZVAL_STRING/CHECK_ZVAL_STRING_REL when PHP is shutting down.

I haven't checked with Apache SAPI, but it may be in there, too. I 
see many "child terminted" in apache error log. More tests are 
needed to be sure if the problem is gone.

--
Yasuo Ohgaki


=== script ===
[yohgaki@dev PHP4]$ cat ~/public_html/bugs/13806/more_than_buf.php
<?php

for ($i=0; $i < 1026; $i++) {
         echo "abcd";
}

?>

=== backtrace ===
(gdb) run -X
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/sbin/httpd -X

Program received signal SIGINT, Interrupt.
0x4025e14f in deflate_slow () from /usr/lib/libz.so.1
(gdb) bt
#0  0x4025e14f in deflate_slow () from /usr/lib/libz.so.1
#1  0x4025d02b in deflate () from /usr/lib/libz.so.1
#2  0x4043f7c7 in php_do_deflate (str_length=53381202, 
p_buffer=0xbfffafd4,
     p_buffer_len=0xbfffafd0, do_start=1 '\001', do_end=0 '\000') 
at zlib.c:1004
#3  0x4043fa3c in php_deflate_string (
     str=0x487a302c 
"abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"...,
 
str_length=53381202, newstr=0xbfffafd4,
     new_length=0xbfffafd0, coding=1, do_start=1 '\001', do_end=0 
'\000') at zlib.c:1071
#4  0x40440467 in php_gzip_output_handler (
     output=0x487a302c 
"abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"...,
 
output_len=53381202,
     handled_output=0xbfffafd4, handled_output_len=0xbfffafd0, 
mode=3) at zlib.c:1233
#5  0x40433f25 in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:157
#6  0x4043468a in php_ob_append (text=0x46e2702c "\037\213\b", 
text_length=26689716)
     at output.c:356
#7  0x40434784 in php_b_body_write (str=0x46e2702c "\037\213\b", 
str_length=26689716)
     at output.c:416
#8  0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#9  0x4043468a in php_ob_append (
     text=0xbfffb144 "<br>\n<b>Fatal error</b>:  Maximum execution 
time of 30 seconds exceeded in 
<b>/home/yohgaki/public_html/bugs/13806/more_than_buf.php</b> on 
line <b>4</b><br>\n", text_length=158) at output.c:356
#10 0x40434784 in php_b_body_write (
     str=0xbfffb144 "<br>\n<b>Fatal error</b>:  Maximum execution 
time of 30 seconds exceeded in 
<b>/home/yohgaki/public_html/bugs/13806/more_than_buf.php</b> on 
line <b>4</b><br>\n", str_length=158) at output.c:416
#11 0x40433d56 in php_body_write (
     str=0xbfffb144 "<br>\n<b>Fatal error</b>:  Maximum execution 
time of 30 seconds exceeded in 
<b>/home/yohgaki/public_html/bugs/13806/more_than_buf.php</b> on 
line <b>4</b><br>\n", str_length=158) at output.c:100

#12 0x40428e69 in php_printf (
     format=0x404e80c0 "<br>\n<b>%s</b>:  %s in <b>%s</b> on line 
<b>%d</b><br>\n")
     at main.c:350
#13 0x404291dc in php_error_cb (type=1,
     error_filename=0x816404c 
"/home/yohgaki/public_html/bugs/13806/more_than_buf.php",
     error_lineno=4, format=0x404e5ca0 "Maximum execution time of 
%d second%s exceeded",
     args=0xbfffca3c) at main.c:431
#14 0x40418405 in zend_error (type=1,
     format=0x404e5ca0 "Maximum execution time of %d second%s 
exceeded") at zend.c:686
#15 0x4040e456 in zend_timeout (dummy=27) at zend_execute_API.c:666
#16 <signal handler called>
#17 0x4025d728 in longest_match () from /usr/lib/libz.so.1
#18 0x4025e1b1 in deflate_slow () from /usr/lib/libz.so.1
#19 0x4025d02b in deflate () from /usr/lib/libz.so.1
#20 0x4043f7c7 in php_do_deflate (str_length=26691328, 
p_buffer=0xbfffcf00,
---Type <return> to continue, or q <return> to quit---
     p_buffer_len=0xbfffcefc, do_start=1 '\001', do_end=0 '\000') 
at zlib.c:1004
#21 0x4043fa3c in php_deflate_string (
     str=0x43b3702c <Address 0x43b3702c out of bounds>, 
str_length=26691328,
     newstr=0xbfffcf00, new_length=0xbfffcefc, coding=1, 
do_start=1 '\001',
     do_end=0 '\000') at zlib.c:1071
#22 0x40440467 in php_gzip_output_handler (
     output=0x43b3702c <Address 0x43b3702c out of bounds>, 
output_len=26691328,
     handled_output=0xbfffcf00, handled_output_len=0xbfffcefc, 
mode=3) at zlib.c:1233
#23 0x40433f25 in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:157
#24 0x4043468a in php_ob_append (text=0x42e7902c "\037\213\b", 
text_length=13343695)
     at output.c:356
#25 0x40434784 in php_b_body_write (str=0x42e7902c "\037\213\b", 
str_length=13343695)
     at output.c:416
#26 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#27 0x4043468a in php_ob_append (text=0x41b5d02c "\037\213\b", 
text_length=6671347)
     at output.c:356
#28 0x40434784 in php_b_body_write (str=0x41b5d02c "\037\213\b", 
str_length=6671347)
     at output.c:416
#29 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#30 0x4043468a in php_ob_append (text=0x411cd02c "\037\213\b", 
text_length=3335421)
     at output.c:356
#31 0x40434784 in php_b_body_write (str=0x411cd02c "\037\213\b", 
str_length=3335421)
     at output.c:416
#32 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#33 0x4043468a in php_ob_append (text=0x40d0302c "\037\213\b", 
text_length=1667583)
     at output.c:356
#34 0x40434784 in php_b_body_write (str=0x40d0302c "\037\213\b", 
str_length=1667583)
     at output.c:416
#35 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')

     at output.c:226
#36 0x4043468a in php_ob_append (text=0x40a9b02c "\037\213\b", 
text_length=833729)
     at output.c:356
#37 0x40434784 in php_b_body_write (str=0x40a9b02c "\037\213\b", 
str_length=833729)
     at output.c:416
#38 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#39 0x4043468a in php_ob_append (text=0x4096502c "\037\213\b", 
text_length=416832)
     at output.c:356
#40 0x40434784 in php_b_body_write (str=0x4096502c "\037\213\b", 
str_length=416832)
     at output.c:416
#41 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#42 0x4043468a in php_ob_append (text=0x408a702c "\037\213\b", 
text_length=208401)
     at output.c:356
#43 0x40434784 in php_b_body_write (str=0x408a702c "\037\213\b", 
str_length=208401)
---Type <return> to continue, or q <return> to quit---
     at output.c:416
#44 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#45 0x4043468a in php_ob_append (text=0x83d58dc "\037\213\b", 
text_length=104204)
     at output.c:356
#46 0x40434784 in php_b_body_write (str=0x83d58dc "\037\213\b", 
str_length=104204)
     at output.c:416
#47 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#48 0x4043468a in php_ob_append (text=0x838c5a4 "\037\213\b", 
text_length=52152)
     at output.c:356
#49 0x40434784 in php_b_body_write (str=0x838c5a4 "\037\213\b", 
str_length=52152)
     at output.c:416
#50 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#51 0x4043468a in php_ob_append (text=0x835606c "\037\213\b", 
text_length=26086)
     at output.c:356
#52 0x40434784 in php_b_body_write (str=0x835606c "\037\213\b", 
str_length=26086)
     at output.c:416
#53 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#54 0x4043468a in php_ob_append (text=0x832963c "\037\213\b", 
text_length=13052)
     at output.c:356
#55 0x40434784 in php_b_body_write (str=0x832963c "\037\213\b", 
str_length=13052)
     at output.c:416
#56 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#57 0x4043468a in php_ob_append (text=0x830159c "\037\213\b", 
text_length=6537)
     at output.c:356
#58 0x40434784 in php_b_body_write (str=0x830159c "\037\213\b", 
str_length=6537)
     at output.c:416
#59 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')

     at output.c:226
#60 0x4043468a in php_ob_append (text=0x82db9cc "\037\213\b", 
text_length=3278)
     at output.c:356
#61 0x40434784 in php_b_body_write (str=0x82db9cc "\037\213\b", 
str_length=3278)
     at output.c:416
#62 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#63 0x4043468a in php_ob_append (text=0x82b746c "\037\213\b", 
text_length=1643)
     at output.c:356
#64 0x40434784 in php_b_body_write (str=0x82b746c "\037\213\b", 
str_length=1643)
     at output.c:416
#65 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#66 0x4043468a in php_ob_append (text=0x82943b4 "\037\213\b", 
text_length=816)
     at output.c:356
#67 0x40434784 in php_b_body_write (str=0x82943b4 "\037\213\b", 
str_length=816)
     at output.c:416
---Type <return> to continue, or q <return> to quit---
#68 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#69 0x4043468a in php_ob_append (text=0x8162754 "\037\213\b", 
text_length=673)
     at output.c:356
#70 0x40434784 in php_b_body_write (str=0x8162754 "\037\213\b", 
str_length=673)
     at output.c:416
#71 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#72 0x4043468a in php_ob_append (text=0x8162754 "\037\213\b", 
text_length=537)
     at output.c:356
#73 0x40434784 in php_b_body_write (str=0x8162754 "\037\213\b", 
str_length=537)
     at output.c:416
#74 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#75 0x4043468a in php_ob_append (text=0x8162754 "\037\213\b", 
text_length=419)
     at output.c:356
#76 0x40434784 in php_b_body_write (str=0x8162754 "\037\213\b", 
str_length=419)
     at output.c:416
#77 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#78 0x4043468a in php_ob_append (text=0x8162754 "\037\213\b", 
text_length=319)
     at output.c:356
#79 0x40434784 in php_b_body_write (str=0x8162754 "\037\213\b", 
str_length=319)
     at output.c:416
#80 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#81 0x4043468a in php_ob_append (text=0x8162754 "\037\213\b", 
text_length=230)
     at output.c:356
#82 0x40434784 in php_b_body_write (str=0x8162754 "\037\213\b", 
str_length=230)
     at output.c:416
#83 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#84 0x4043468a in php_ob_append (text=0x8162754 "\037\213\b", 
text_length=154)
     at output.c:356
#85 0x40434784 in php_b_body_write (str=0x8162754 "\037\213\b", 
str_length=154)
     at output.c:416
#86 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#87 0x4043468a in php_ob_append (text=0x8162754 "\037\213\b", 
text_length=85)
     at output.c:356
#88 0x40434784 in php_b_body_write (str=0x8162754 "\037\213\b", 
str_length=85)
     at output.c:416
#89 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
     at output.c:226
#90 0x4043468a in php_ob_append (text=0x8162754 "\037\213\b", 
text_length=39)
     at output.c:356
#91 0x40434784 in php_b_body_write (str=0x8162754 "\037\213\b", 
str_length=39)
     at output.c:416
#92 0x404342cf in php_end_ob_buffer (send_buffer=1 '\001', 
just_flush=1 '\001')
---Type <return> to continue, or q <return> to quit---
     at output.c:226
#93 0x4043468a in php_ob_append (text=0x81654d4 "abcd", 
text_length=4) at output.c:356
#94 0x40434784 in php_b_body_write (str=0x81654d4 "abcd", 
str_length=4) at output.c:416
#95 0x40433d56 in php_body_write (str=0x81654d4 "abcd", 
str_length=4) at output.c:100
#96 0x4042a1c1 in php_body_write_wrapper (str=0x81654d4 "abcd", 
str_length=4)
     at main.c:758
#97 0x40417468 in zend_print_zval_ex (write_func=0x4042a1a0 
<php_body_write_wrapper>,
     expr=0x8164638, indent=0) at zend.c:187
#98 0x404173d9 in zend_print_zval (expr=0x8164638, indent=0) at 
zend.c:168
#99 0x40416dd0 in zend_print_variable (var=0x8164638) at 
zend_variables.c:172
#100 0x4040572b in execute (op_array=0x8163f84) at 
./zend_execute.c:1223
#101 0x40418980 in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at zend.c:814
#102 0x4042b492 in php_execute_script (primary_file=0xbffff600) at 
main.c:1310
#103 0x404260de in apache_php_module_main (r=0x81541b4, 
display_source_mode=0)
     at sapi_apache.c:90
#104 0x40426fcc in send_php (r=0x81541b4, display_source_mode=0,
     filename=0x8155dd4 
"/home/yohgaki/public_html/bugs/13806/more_than_buf.php")
     at mod_php4.c:575
#105 0x40427045 in send_parsed_php (r=0x81541b4) at mod_php4.c:590
#106 0x0805ade7 in ap_invoke_handler () at eval.c:88
#107 0x080702bb in process_request_internal () at eval.c:88
#108 0x08070330 in ap_process_request () at eval.c:88
#109 0x080672b2 in child_main () at eval.c:88
#110 0x08067484 in make_child () at eval.c:88
#111 0x080675f8 in startup_children () at eval.c:88
#112 0x08067ca0 in standalone_main () at eval.c:88
#113 0x0806852f in main () at eval.c:88
#114 0x400ce1be in __libc_start_main (main=0x8068160 <main>, 
argc=2, ubp_av=0xbffffa3c,
     init=0x804f550 <_init>, fini=0x80a162c <_fini>, 
rtld_fini=0x4000ddd0 <_dl_fini>,
     stack_end=0xbffffa2c) at ../sysdeps/generic/libc-start.c:129
(gdb)


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to