#27759 [Com]: bcadd() causes crash if first parameter is empty string

From: Date: Mon, 26 Apr 2004 11:26:07 +0000
Subject: #27759 [Com]: bcadd() causes crash if first parameter is empty string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-58778@lists.php.net to get a copy of this message
 ID:               27759
 Comment by:       marv at cyberia dot net dot lb
 Reported By:      patrick at rap-x dot com
 Status:           Closed
 Bug Type:         BC math related
 Operating System: win32 only
 PHP Version:      5.0.0RC1
 New Comment:

This bug still exists in PHP5RC2. There isn't a problem with bcmath
itself, but something is corrupting heap memory that bcmath uses.
bcmath allocates three numbers (zero, one, and two) when it first
starts up. If any of these numbers is then used (such as when adding
zero to a number in bcadd) Apache crashes.


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

[2004-04-11 23:03:46] hagen at xiag dot ch

Latest snapshot crashes on both Apaches 2.0.48 and 1.3.29 on WinXP.

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

[2004-04-07 05:56:45] sniper@php.net

works fine for me using latest CVS snapshot.


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

[2004-04-04 23:54:50] patrick at rap-x dot com

The same code causes the same problem with PHP5 RC2. Output from the
first section of phpinfo() below.
-----------------------------
PHP Version 5.0.0RC2-dev
System 	Windows NT ME 5.1 build 2600
Build Date 	Apr 3 2004 04:32:40
Configure Command 	cscript /nologo configure.js
"--enable-snapshot-build" "--with-gd=shared"
Server API 	Apache 2.0 Handler
Virtual Directory Support 	enabled
Configuration File (php.ini) Path 	C:\WINDOWS\php.ini
PHP API 	20031224
PHP Extension 	20040316
Zend Extension 	90021012
Debug Build 	no
Thread Safety 	enabled
IPv6 Support 	enabled
Registered PHP Streams 	php, file, http, ftp, compress.zlib
Registered Stream Socket Transports 	tcp, udp
.............
BCMath support 	enabled

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

[2004-04-04 21:32:50] magnus@php.net

Latest snapshot

For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

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

[2004-04-04 20:48:23] patrick at rap-x dot com

The bug is still reproducible, on the same code base. I don't have a
windows compiler for C, so I can't try the hugely useful suggestion
from polita. 

I've commented out or replaced all instances of bcmath functions in my
code. I don't have a windows compiler for C, so I can't try the hugely
useful suggestion from polita. 

If someone can point me to some binaries I'll test them.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/27759

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


Thread (17 messages)

« previous php.bugs (#58778) next »