Bug #12748 Updated: changing allow_url_fopen from "off" to "on" crashes fopen()

From: Date: Wed, 10 Oct 2001 23:01:52 +0000
Subject: Bug #12748 Updated: changing allow_url_fopen from "off" to "on" crashes fopen()
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-67727@lists.php.net to get a copy of this message
ID: 12748 User updated by: phpman@toowards.com Reported By: phpman@toowards.com Status: Open Bug Type: Reproducible crash Operating System: redhat-7.1b PHP Version: 4.0.6 New Comment: See #13633 which describes a similar problem - I am not alone :-) Previous Comments: ------------------------------------------------------------------------ [2001-08-18 05:56:51] phpman@toowards.com Also, phpinfo() shows a blank cell for the 'Master Value' and "1" for the 'Local Value' of 'allow_url_fopen' when using; in php.ini: allow_url_fopen = Off & in httpd.conf php_admin_flag allow_url_fopen On I tried using "allow_url_fopen = 0" (Master Value becomes "0", fopen() still crashes). I also tried "php_admin_value allow_url_fopen 1" (Local Value still "1", fopen() still crashes). When I leave out the setting in httpd.conf, and just have "allow_url_fopen = Off" in the php.ini file, phpinfo() has "no value" written for the Master Value and Local Value. Maybe this helps? ------------------------------------------------------------------------ [2001-08-18 05:23:43] phpman@toowards.com Todays snapshot - php4-200108180135.tar.bz2 - still shows the problem. Same config, same test script. redhat-7.1b == redhat 7.1 Beta (Fisher) Backtrace from today: Program received signal SIGSEGV, Segmentation fault. 0x402c0ad1 in zend_hash_find (ht=0x40395ae0, arKey=0x810c8dc "http://www.php.net", nKeyLength=4, pData=0xbfffe208) at zend_hash.c:861 861 p = ht->arBuckets[nIndex]; #0 0x402c0ad1 in zend_hash_find (ht=0x40395ae0, arKey=0x810c8dc "http://www.php.net", nKeyLength=4, pData=0xbfffe208) at zend_hash.c:861 #1 0x402ca732 in php_fopen_url_wrapper (path=0x810c8dc "http://www.php.net", mode=0x81075cc "r", options=4, issock=0xbfffe248, socketd=0xbfffe24c, opened_path=0x0) at fopen_wrappers.c:533 #2 0x4030aa87 in php_if_fopen (ht=2, return_value=0x81075ac, this_ptr=0x0, return_value_used=1) at file.c:661 #3 0x402adaf8 in execute (op_array=0x810750c) at ./zend_execute.c:1590 #4 0x402bbd05 in zend_execute_scripts (type=8, file_count=3) at zend.c:806 #5 0x402c945f in php_execute_script (primary_file=0xbffff740) at main.c:1310 #6 0x402c562e in apache_php_module_main (r=0x8101264, display_source_mode=0) at sapi_apache.c:90 #7 0x402c6112 in send_php (r=0x8101264, display_source_mode=0, filename=0x0) at mod_php4.c:575 #8 0x402c6166 in send_parsed_php (r=0x8101264) at mod_php4.c:590 #9 0x08055823 in ap_invoke_handler () at eval.c:41 #10 0x080695b3 in process_request_internal () at eval.c:41 #11 0x08069614 in ap_process_request () at eval.c:41 #12 0x08060ab9 in child_main () at eval.c:41 #13 0x08060c64 in make_child () at eval.c:41 #14 0x08060dd8 in startup_children () at eval.c:41 #15 0x08061427 in standalone_main () at eval.c:41 #16 0x08061c43 in main () at eval.c:41 #17 0x400ca6b7 in __libc_start_main (main=0x80618ac <main>, argc=2, ubp_av=0xbffffb84, init=0x804ea24 <_init>, fini=0x80968fc <_fini>, rtld_fini=0x4000db64 <_dl_fini>, stack_end=0xbffffb7c) at ../sysdeps/generic/libc-start.c:129 (gdb) print *ht $7 = {nTableSize = 0, nTableMask = 0, nNumOfElements = 0, nNextFreeElement = 0, pInternalPointer = 0x0, pListHead = 0x0, pListTail = 0x0, arBuckets = 0x0, pDestructor = 0, persistent = 0 '\000', nApplyCount = 0 '\000', bApplyProtection = 0 '\000'} Looks like 'fopen_url_wrappers_hash' in fopen_wrappers.c isn't being setup right? I'm lost though - I don't see how the apache directives work. ------------------------------------------------------------------------ [2001-08-15 02:17:03] sniper@php.net Could you please try latest CVS snapshot from http://snaps.php.net/ to verify if this still exists.. Also, what is redhat-7.1b ? (the b there..?) --Jani ------------------------------------------------------------------------ [2001-08-14 20:24:01] phpman@toowards.com Using Apache-1.3.20 PHP-4.0.6 glibc-2.2.3 PHP compiled as DSO, no other options ./configure --with-apxs=/usr/local/apache/bin/apxs Note, this is not the same as bug #9672 Updating glibc does solve that problem see http://bugs.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2181 /usr/local/lib/php.ini [PHP] engine = On allow_url_fopen = Off My httpd.conf contains (in a VirtualHost), php_admin_flag allow_url_fopen On A test script <?php $fp = fopen( "http://www.php.net", "r" ); if( $fp ) { fclose($fp); print "fopen() success\n"; } ?> Backtrace: #0 __strtol_internal (nptr=0x403adba0 "", endptr=0x81128bc, base=4, group=-1073748792) at eval.c:36 #1 0x402bee14 in zend_hash_find (ht=0x403adba0, arKey=0x81128bc "http://www.php.net", nKeyLength=4, pData=0xbfffe4c8) at zend_hash.c:850 #2 0x402cd259 in php_fopen_url_wrapper (path=0x81128bc "http://www.php.net", mode=0x810d5c4 "r", options=4, issock=0xbfffe508, socketd=0xbfffe50c, opened_path=0x0) at fopen_wrappers.c:445 #3 0x4031f2fb in php_if_fopen (ht=2, return_value=0x810d5a4, this_ptr=0x0, return_value_used=1) at file.c:639 #4 0x402acd5c in execute (op_array=0x8109efc) at ./zend_execute.c:1504 #5 0x402bae95 in zend_execute_scripts (type=8, file_count=3) at zend.c:752 #6 0x402cc30b in php_execute_script (primary_file=0xbffff890) at main.c:1206 #7 0x402c8bae in apache_php_module_main (r=0x8107644, display_source_mode=0) at sapi_apache.c:89 #8 0x402c9541 in send_php (r=0x8107644, display_source_mode=0, filename=0x0) at mod_php4.c:536 #9 0x402c956a in send_parsed_php (r=0x8107644) at mod_php4.c:547 #10 0x080558d3 in ap_invoke_handler () at eval.c:41 #11 0x08069667 in process_request_internal () at eval.c:41 #12 0x080696c8 in ap_process_request () at eval.c:41 #13 0x08060b69 in child_main () at eval.c:41 #14 0x08060d14 in make_child () at eval.c:41 #15 0x08060e88 in startup_children () at eval.c:41 #16 0x080614d7 in standalone_main () at eval.c:41 #17 0x08061cf3 in main () at eval.c:41 #18 0x400ca6b7 in __libc_start_main (main=0x806195c <main>, argc=2, ubp_av=0xbffffb64, init=0x804ead0 <_init>, fini=0x80969bc <_fini>, rtld_fini=0x4000db64 <_dl_fini>, stack_end=0xbffffb5c) at ../sysdeps/generic/libc-start.c:129 ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=12748&edit=1

« previous php.dev (#67727) next »