ID:               34581
 Updated by:       [EMAIL PROTECTED]
 Reported By:      phpbugrep-20050921 at pgregg dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Reproducible crash
 Operating System: FreeBSD5.4-STABLE
 PHP Version:      5CVS-2005-09-21 (snap)
 New Comment:

Try adding the rules into httpd.conf.



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

[2005-09-21 16:19:12] phpbugrep-20050921 at pgregg dot com

Description:
------------
Similar to: http://bugs.php.net/bug.php?id=34204

PHP5.1-RC2-dev snaps (d/l today) crashes (segfaults) when a mod_rewrite
is used with a .htaccess file (have not tried it hard coded into
httpd.conf).   PHP-5.1b2 works correctly without crashing.


Reproduce code:
---------------
Code to reproduce is available at: http://www.pgregg.com/crash/

the .htaccess file used there is live and accessing the url:
http://www.pgregg.com/crash/d/123-123/foobar  (to match one of the
rules) will cause the httpd child to segfault.

I have posted a backtrace there also.

This is the .htaccess file from PHP Gallery (G2) modified to work in my
example dir.

Expected result:
----------------
I expect the test.php to be called like:
test.php?arg1=123&arg2=123


Actual result:
--------------
>gdb /usr/local/apache/bin/httpd  2:42PM
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-unknown-freebsd5.4"...
(gdb) run -X
Starting program: /usr/local/apache2/bin/httpd -X

Program received signal SIGSEGV, Segmentation fault.
0x28565acd in _zend_hash_index_update_or_next_insert (ht=0x286d83b4,
h=0, pData=0xbfbfd9a0,
    nDataSize=12, pDest=0x0, flag=1,
    __zend_filename=0x2863112c
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/Zend/zend_list.c",
__zend_lineno=47)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/Zend/zend_hash.c:354
354             p = ht->arBuckets[nIndex];
(gdb) bt
#0  0x28565acd in _zend_hash_index_update_or_next_insert
(ht=0x286d83b4, h=0,
    pData=0xbfbfd9a0, nDataSize=12, pDest=0x0, flag=1,
    __zend_filename=0x2863112c
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/Zend/zend_list.c",
__zend_lineno=47)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/Zend/zend_hash.c:354
#1  0x28568106 in zend_list_insert (ptr=0x828f124, type=2)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/Zend/zend_list.c:47
#2  0x2856820c in zend_register_resource (rsrc_result=0x0,
rsrc_pointer=0x828f124,
    rsrc_type=2) at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/Zend/zend_list.c:99
#3  0x2852bbd8 in _php_stream_alloc (ops=0x286be5e0,
abstract=0x828f024, persistent_id=0x0,
    mode=0x28617290 "rb", __php_stream_call_depth=5,
    __zend_filename=0x28619b78
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/plain_wrapper.c",
__zend_lineno=205,
    __zend_orig_filename=0x28616f70
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/main.c",
__zend_orig_lineno=855)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/streams.c:263
#4  0x2853249f in _php_stream_fopen_from_fd (fd=16, mode=0x28617290
"rb",
    persistent_id=0x0, __php_stream_call_depth=4,
    __zend_filename=0x28619b78
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/plain_wrapper.c",
__zend_lineno=882,
    __zend_orig_filename=0x28616f70
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/main.c",
__zend_orig_lineno=855)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/plain_wrapper.c:205
#5  0x285337b9 in _php_stream_fopen (
    filename=0x828d4c0 "/web/www.pgregg.com/source/test.php",
mode=0x28617290 "rb",
    opened_path=0xbfbfe338, options=133, __php_stream_call_depth=3,
    __zend_filename=0x28619b78
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/plain_wrapper.c",
__zend_lineno=1233,
    __zend_orig_filename=0x28616f70
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/main.c",
__zend_orig_lineno=855)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/plain_wrapper.c:882
#6  0x28534432 in _php_stream_fopen_with_path (
    filename=0x828d4c0 "/web/www.pgregg.com/source/test.php",
mode=0x28617290 "rb",
    path=0x28616d76 ".:/usr/local/lib/php", opened_path=0xbfbfe338,
options=133,
    __php_stream_call_depth=2,
    __zend_filename=0x28619b78
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/plain_wrapper.c",
__zend_lineno=931,
    __zend_orig_filename=0x28616f70
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/main.c",
__zend_orig_lineno=855)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/plain_wrapper.c:1233
#7  0x28533958 in php_plain_files_stream_opener (wrapper=0x286be688,
    path=0x828d4c0 "/web/www.pgregg.com/source/test.php",
mode=0x28617290 "rb",
    options=133, opened_path=0xbfbfe338, context=0x0,
__php_stream_call_depth=1,
    __zend_filename=0x2861937c
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/streams.c",
__zend_lineno=1773,
    __zend_orig_filename=0x28616f70
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/main.c",
__zend_orig_lineno=855)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/plain_wrapper.c:931
#8  0x2852eec8 in _php_stream_open_wrapper_ex (
    path=0x828d4c0 "/web/www.pgregg.com/source/test.php",
mode=0x28617290 "rb",
    options=141, opened_path=0xbfbfe338, context=0x0,
__php_stream_call_depth=0,
    __zend_filename=0x28616f70
"/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/main.c",
__zend_lineno=855, __zend_orig_filename=0x0, __zend_orig_lineno=0)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/streams/streams.c:1771
#9  0x2851a2f4 in php_stream_open_for_zend (
    filename=0x828d4c0 "/web/www.pgregg.com/source/test.php",
handle=0xbfbfe330)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/main/main.c:855
#10 0x2856f72c in zend_stream_open (
    filename=0x828d4c0 "/web/www.pgregg.com/source/test.php",
handle=0xbfbfe330)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/Zend/zend_stream.c:47
#11 0x2856f7db in zend_stream_fixup (file_handle=0xbfbfe330)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/Zend/zend_stream.c:62
#12 0x2853e0a4 in open_file_for_scanning (file_handle=0xbfbfe330)
    at Zend/zend_language_scanner.c:3068
#13 0x2853e1e7 in compile_file (file_handle=0xbfbfe330, type=2)
    at Zend/zend_language_scanner.c:3154
#14 0x2855db19 in zend_execute_scripts (type=2, retval=0x0,
file_count=1)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/Zend/zend.c:1079
#15 0x285cb940 in php_handler (r=0x8289a30)
    at
/usr/local/src/Web/Apache2_PHP5/php5-200509211030/sapi/apache2handler/sapi_apache2.c:570
#16 0x080828aa in ap_run_handler (r=0x8289a30) at config.c:152
#17 0x08082c75 in ap_invoke_handler (r=0x8289a30) at config.c:364
#18 0x0806ae55 in ap_internal_redirect (new_uri=0x0, r=0x0) at
http_request.c:465
#19 0x0807b607 in handler_redirect (r=0x827c050) at mod_rewrite.c:1735
#20 0x080828aa in ap_run_handler (r=0x827c050) at config.c:152
#21 0x08082c75 in ap_invoke_handler (r=0x827c050) at config.c:364
#22 0x0806b1d1 in ap_process_request (r=0x827c050) at
http_request.c:249
#23 0x08066af9 in ap_process_http_connection (c=0x8276128) at
http_core.c:251
#24 0x0808c12a in ap_run_process_connection (c=0x8276128) at
connection.c:43
#25 0x080810c1 in child_main (child_num_arg=0) at prefork.c:610
#26 0x080812b5 in make_child (s=0x80c4c48, slot=0) at prefork.c:650
#27 0x0808137c in startup_children (number_to_start=5) at
prefork.c:722
#28 0x080819ff in ap_mpm_run (_pconf=0xbfbfe6c0, plog=0x80f8018,
s=0xbfbfe6c8)
    at prefork.c:941
#29 0x08086c07 in main (argc=2, argv=0xbfbfe7b0) at main.c:618

 (gdb) print p
 $1 = (Bucket *) 0x28567fdb
 (gdb) print ht
 $2 = (HashTable *) 0x286d83b4
 (gdb) print nIndex
 $3 = 0
 (gdb) print *ht
 $4 = {nTableSize = 0, nTableMask = 0, nNumOfElements = 0,
nNextFreeElement = 0,
   pInternalPointer = 0x0, pListHead = 0x0, pListTail = 0x0, arBuckets
= 0x0, pDestructor = 0,
   persistent = 0 '\0', nApplyCount = 0 '\0', bApplyProtection = 0
'\0', inconsistent = 0}




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


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

Reply via email to