PHP 4.0 Bug #4953: function max causes crash.

From: Date: Sat, 10 Jun 2000 20:59:21 +0000
Subject: PHP 4.0 Bug #4953: function max causes crash.
Groups: php.dev 
Request: Send a blank email to php-dev+get-20973@lists.php.net to get a copy of this message
From: dr_mac@mail.utexas.edu Operating system: RedHat Linux 6.1 PHP version: 4.0 Latest CVS (10/06/2000) PHP Bug Type: Misbehaving function Bug description: function max causes crash. Here is the 4 lines of code that cause the crash: <?php $a = array(1,2,3); $m = max($a); print $m; ?> These lines are the only lines in graphtest.php. My browser says "Couldn't load page: graphtest.php" and then I viewed the Apache 1.3.12 logs and saw this: [notice] child pid 663 exit signal Segmentation fault (11) Here is my gdb backtrace of apache when accessing that page: #0 0x0 in ?? () #1 0x80f33ca in array_data_compare (a=0xbffff910, b=0xbffff914) at array.c:272 #2 0x809453b in zend_hash_minmax (ht=0x81f578c, compar=0x80f33a4 <array_data_compare>, flag=1, pData=0xbffff944) at zend_hash.c:1081 #3 0x80f4834 in php_if_max (ht=1, return_value=0x82187bc, this_ptr=0x0, return_value_used=1) at array.c:913 #4 0x80e9fac in execute (op_array=0x8218704) at ./zend_execute.c:1574 #5 0x807ff4b in php_execute_script (primary_file=0xbffffb8c) at main.c:1200 #6 0x809ab20 in apache_php_module_main (r=0x820136c, fd=19, display_source_mode=0) at sapi_apache.c:93 #7 0x807c46b in send_php () #8 0x807c4ac in send_parsed_php () #9 0x8106023 in ap_invoke_handler () #10 0x81199c9 in process_request_internal () #11 0x8119a2c in ap_process_request () #12 0x811123e in child_main () #13 0x81113ec in make_child () #14 0x8111549 in startup_children () #15 0x8111b76 in standalone_main () #16 0x8112313 in main () #17 0x401161eb in __libc_start_main (main=0x8111fbc <main>, argc=2, argv=0xbffffd44, init=0x8062a70 <_init>, fini=0x814860c <_fini>, rtld_fini=0x4000a610 <_dl_fini>, stack_end=0xbffffd3c) at ../sysdeps/generic/libc-start.c:90 I gave those lines to other people and they said it ran fine and they got the correct output of 3. Did I do something wrong? Thanks, Matthew

« previous php.dev (#20973) next »