Overflow exception
| From: | Curt Zirzow | Date: | Wed, 24 May 2000 14:45:29 +0000 |
| Subject: | Overflow exception | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-19414@lists.php.net to get a copy of this message | ||
I can't get to bugs.php.net so for now I'll post this here.
This is related to bug #2962 but I've narrowed it down to it
affecting all conversions from a double to int where there
is a overflow exception.
My main question is should I close bug #2962 and open a new one
or just merge this into it?
bug is as follows:
FreeBSD 3.2
Php 4.0.0
Apache/1.3.9
<?
$var = 2147483647+1; //or < -2147483648
echo $var."<br>\n";
settype($var, 'string'); //removing this makes a SIGFPE
settype($var, 'integer');
settype($var, 'double');
echo $var."<br>\n"; //overflow!!
?>
Program received signal SIGFPE, Arithmetic exception.
0x809cbea in convert_to_long_base (op=0x821358c, base=10)
at zend_operators.c:203
203 op->value.lval = (long) op->value.dval;
(gdb) backtrace
#0 0x809cbea in convert_to_long_base (op=0x821358c, base=10)
at zend_operators.c:203
#1 0x809cb95 in convert_to_long (op=0x821358c) at zend_operators.c:185
#2 0x80c3079 in php_if_settype (ht=2, return_value=0x82135ac, this_ptr=0x0,
return_value_used=0) at basic_functions.c:1057
#3 0x80f82fd in execute (op_array=0x8211e0c) at ./zend_execute.c:1574
#4 0x8090b29 in php_execute_script (primary_file=0xbfbfd5d0) at main.c:1200
#5 0x80a9c3d in apache_php_module_main (r=0x821a034, fd=30,
display_source_mode=0) at sapi_apache.c:93
#6 0x808d18e in send_php ()
#7 0x808d1d0 in send_parsed_php ()
#8 0x8117f7b in ap_invoke_handler ()
#9 0x812aa01 in process_request_internal ()
#10 0x812aa60 in ap_process_request ()
#11 0x81224a9 in child_main ()
#12 0x8122634 in make_child ()
#13 0x812278f in startup_children ()
#14 0x8122d40 in standalone_main ()
#15 0x8123593 in main ()
#16 0x8060829 in _start ()
Curt.
--
Any time things appear to be going better, you have overlooked
something.