From:             adrian at psoft dot biz
Operating system: RHEL ES 3
PHP version:      4.3.6
PHP Bug Type:     mhash related
Bug description:  Seg Fault when using mhash

Description:
------------
Apache child seg faults when calling the mhash() function from a PHP
script. 

PHP 4.3.6, 4.3.5, 4.2.2
mhash 0.8.18 and 0.9.1

If I enable debug mode to generate a backtrace it doesn't seg fault, but
the script below gives 000...0000 as a result, so I generated the
backgrace without debug enabled.

This works using the php binary, just seg faults when called from within
apache.


Reproduce code:
---------------
<?php

$str = "test string!";
echo bin2hex(mhash(MHASH_MD5, $str));

?>


Expected result:
----------------
[EMAIL PROTECTED] httpdocs]# php -q mhash.php
cff1fa7b32de5979c35874350570dd74


Actual result:
--------------
#0  0xb719ecd9 in _int_free () from /lib/tls/libc.so.6
#1  0xb719dc88 in free () from /lib/tls/libc.so.6
#2  0xb6544171 in mhash_deinit (td=0xb7262720, result=0x839d948) at
mhash.c:366
#3  0xb65441d3 in mhash_end_m (td=0x839d8e8, hash_malloc=0xb719da80
<malloc>) at mhash.c:384
#4  0xb6544201 in mhash_end (td=0x839d8c0) at mhash.c:391
#5  0xb65623a8 in zif_mhash () from /usr/lib/php4/mhash.so
#6  0xb6e0e788 in execute () from /etc/httpd/modules/libphp4.so
#7  0xb6dffe76 in zend_execute_scripts () from
/etc/httpd/modules/libphp4.so
#8  0xb6dd46b4 in php_execute_script () from
/etc/httpd/modules/libphp4.so


-- 
Edit bug report at http://bugs.php.net/?id=28372&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28372&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28372&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28372&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28372&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28372&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28372&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28372&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28372&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28372&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28372&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28372&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28372&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28372&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28372&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28372&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28372&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28372&r=float

Reply via email to