php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12792 mhash seg fault
Submitted: 2001-08-16 10:03 UTC Modified: 2002-03-01 00:00 UTC
From: james dot jones at firstinvestors dot com Assigned:
Status: No Feedback Package: mhash related
PHP Version: 4.0.6 OS: Red Hat 7.1
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2001-08-16 10:03 UTC] james dot jones at firstinvestors dot com
PHP causes a seg fault when I try to use any mhash functions.

Versions:

PHP 4.0.6
Apache 1.3.20
RedHat 7.1
mhash 0.8.9

PHP was configured with these options:

"./configure" \
"--with-apxs" \
"--with-ibm-db2=shared" \
"--with-ldap=shared" \
"--with-fdftk=shared,/usr/local" \
"--with-mcrypt=shared" \
"--with-mhash=shared" \
"--enable-ftp" \
"--with-config-file-path=/etc" \
"--enable-trans-sid" \
"--enable-debug" \

Everything other than the mhash and mcrypt functions works.

As a test, I tried to run this script:

<?php
$key = 'test key';
$message = 'This is a test message.';
$md5hash = bin2hex(mhash(MHASH_MD5, $message, $key));
echo "Message: $message<br/>\n";
echo "Key: $key<br/>\n";
echo "MD5 Hash: $md5hash<br/>\n";
?>

The following backtrace was generated:

#0  0x400099f2 in _dl_lookup_versioned_symbol () at eval.c:41
#1  0x4000d206 in fixup () at eval.c:41
#2  0x4000d3a0 in _dl_runtime_resolve () at eval.c:41
#3  0x406dc50a in mhash_hmac_init () from /usr/lib/libmhash.so.2
#4  0x4054c6d0 in php_if_mhash (ht=3, return_value=0x8137064, this_ptr=0x0,
    return_value_used=1) at mhash.c:171
#5  0x40420de9 in execute (op_array=0x8136ef4) at ./zend_execute.c:1504
#6  0x404315f1 in zend_execute_scripts (type=8, file_count=3) at zend.c:752
#7  0x404487a4 in php_execute_script (primary_file=0xbffff870) at main.c:1206
#8  0x4044403a in apache_php_module_main (r=0x80a21c0, display_source_mode=0)
    at sapi_apache.c:89
#9  0x40444ccc in send_php (r=0x80a21c0, display_source_mode=0,
    filename=0x80a3c78 "/var/www/html/smart/hash-crypt-test.php")
    at mod_php4.c:536
#10 0x40444d01 in send_parsed_php (r=0x80a21c0) at mod_php4.c:547
#11 0x80551bd in ap_invoke_handler () at eval.c:41
#12 0x806735c in ap_some_auth_required () at eval.c:41
#13 0x80673d3 in ap_process_request () at eval.c:41
#14 0x805fa37 in ap_child_terminate () at eval.c:41
#15 0x805fbda in ap_child_terminate () at eval.c:41
#16 0x805fd1d in ap_child_terminate () at eval.c:41
#17 0x806033e in ap_child_terminate () at eval.c:41
#18 0x8060c03 in main () at eval.c:41
#19 0x40151777 in __libc_start_main () from /lib/libc.so.6

As a separate test, I also ran this script:

<?php
$key = 'test key';
$message = 'This is a test message.';
$md5hash = bin2hex(mhash(MHASH_MD5, $message));
echo "Message: $message<br/>\n";
echo "Key: $key<br/>\n";
echo "MD5 Hash: $md5hash<br/>\n";
?>

(since not using a key changes the call made in mhash.c). This also failed, and here's the backtrace:

#0  0x400099f2 in _dl_lookup_versioned_symbol () at eval.c:41
#1  0x4000d206 in fixup () at eval.c:41
#2  0x4000d3a0 in _dl_runtime_resolve () at eval.c:41
#3  0x406dc159 in mhash_init () from /usr/lib/libmhash.so.2
#4  0x4054c6eb in php_if_mhash (ht=2, return_value=0x8136fc4, this_ptr=0x0,
    return_value_used=1) at mhash.c:176
#5  0x40420de9 in execute (op_array=0x8136ef4) at ./zend_execute.c:1504
#6  0x404315f1 in zend_execute_scripts (type=8, file_count=3) at zend.c:752
#7  0x404487a4 in php_execute_script (primary_file=0xbffff870) at main.c:1206
#8  0x4044403a in apache_php_module_main (r=0x80a21c0, display_source_mode=0)
    at sapi_apache.c:89
#9  0x40444ccc in send_php (r=0x80a21c0, display_source_mode=0,
    filename=0x80a3c78 "/var/www/html/smart/hash-crypt-test.php")
    at mod_php4.c:536
#10 0x40444d01 in send_parsed_php (r=0x80a21c0) at mod_php4.c:547
#11 0x80551bd in ap_invoke_handler () at eval.c:41
#12 0x806735c in ap_some_auth_required () at eval.c:41
#13 0x80673d3 in ap_process_request () at eval.c:41
#14 0x805fa37 in ap_child_terminate () at eval.c:41
#15 0x805fbda in ap_child_terminate () at eval.c:41
#16 0x805fd1d in ap_child_terminate () at eval.c:41
#17 0x806033e in ap_child_terminate () at eval.c:41
#18 0x8060c03 in main () at eval.c:41
#19 0x40151777 in __libc_start_main () from /lib/libc.so.6

Let me know if there's any other information I can supply.

- James

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-16 06:07 UTC] lobbin@php.net
Works for me on 4.1.0, please verify.
 [2002-03-01 00:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Aug 23 23:01:26 2019 UTC