Bug #13239: server child crashes during use of mcrypt...
| From: | ivo at wettinet dot de | Date: | Mon, 10 Sep 2001 21:15:21 +0000 |
| Subject: | Bug #13239: server child crashes during use of mcrypt... | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-65696@lists.php.net to get a copy of this message | ||
From: ivo@wettinet.de
Operating system: Linux 2.4.2 (SuSE 7.1 / 7.2)
PHP version: 4.0CVS-2001-09-10
PHP Bug Type: Reproducible crash
Bug description: server child crashes during use of mcrypt...
i'm trying out a groupware in php (downloaded
from http://www.horde.org/, latest cvs)...
according to that documentation it was recommend
to download the latest cvs-revision from php in
order to get everything working...
cause earlyer versions of php (including 4.0.6)
don't support all the functions used there, i
wasn't able to check the them against the bug, too.
(p.s: please excuse my bad english... :->)
server child crashes during the call of "mdecrypt_generic",
but not allways on every call (just the 2nd or 3rd...)
example follows:
----- cut -----
<?php
function testit()
{
if (function_exists('mcrypt_module_open')) {
$key="3224e91c21ee5dd7e9bd83c79290bbda";
$ciphertext="3224e91c21ee5dd7e9bd83c79290bbda";
$td = mcrypt_module_open(MCRYPT_GOST, '',
MCRYPT_MODE_ECB, '');
$iv =
mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
@mcrypt_generic_init($td, $key, $iv);
error_log("BEFORE");
$decrypted_data = mdecrypt_generic($td,
$ciphertext);
error_log("AFTER");
mcrypt_generic_end($td);
return $decrypted_data;
} else {
include_once 'Crypt/HCEMD5.php';
$hcemd5 = new Crypt_HCEMD5($key);
return $hcemd5->decodeMimeSelfRand($ciphertext);
}
}
testit();
echo("aaaa");
?>
----- cut -----
now the backtrace follows:
---------- cut ----------
(gdb) run -X -f /etc/httpd/httpd.conf -D STATUS -D SSL
Starting program: /usr/sbin/httpd -X -f
/etc/httpd/httpd.conf -D STATUS -D SSL
Program received signal SIGSEGV, Segmentation fault.
0x42b2905c in gost_LTX__mcrypt_decrypt () from
/usr/lib/libmcrypt/gost.so
(gdb) bt
#0 0x42b2905c in gost_LTX__mcrypt_decrypt () from
/usr/lib/libmcrypt/gost.so
#1 0x42b2b990 in ecb_LTX__mdecrypt () from
/usr/lib/libmcrypt/ecb.so
#2 0x4001fd65 in mcrypt_enc_get_algorithms_name ()
from /usr/lib/libmcrypt.so.4
#3 0x4001f188 in mdecrypt_generic () from
/usr/lib/libmcrypt.so.4
#4 0x40490a4e in zif_mdecrypt_generic (ht=2,
return_value=0x81dbfc4,
this_ptr=0x0, return_value_used=1) at mcrypt.c:578
#5 0x40424e39 in execute (op_array=0x825ef34) at
./zend_execute.c:1590
#6 0x4042508c in execute (op_array=0x825b3c4) at
./zend_execute.c:1630
#7 0x4042508c in execute (op_array=0x82b7b94) at
./zend_execute.c:1630
#8 0x40434013 in zend_execute_scripts (type=8, retval=0x0,
file_count=3)
at zend.c:809
#9 0x40442eb6 in php_execute_script
(primary_file=0xbffff3a8) at main.c:1310
#10 0x4043e86e in apache_php_module_main (r=0x8175310,
display_source_mode=0)
at sapi_apache.c:90
#11 0x4043f430 in send_php (r=0x8175310,
display_source_mode=0, filename=0x0)
at mod_php4.c:575
#12 0x4043f4a3 in send_parsed_php (r=0x8175310) at
mod_php4.c:590
#13 0x8055250 in ap_invoke_handler ()
#14 0x80679cc in ap_some_auth_required ()
#15 0x8067a43 in ap_process_request ()
#16 0x805fe27 in ap_child_terminate ()
#17 0x805ffd5 in ap_child_terminate ()
#18 0x8060116 in ap_child_terminate ()
#19 0x8060738 in ap_child_terminate ()
#20 0x8060fb5 in main ()
#21 0x40120baf in __libc_start_main () from /lib/libc.so.6
(gdb)
--
Edit bug report at: http://bugs.php.net/?id=13239&edit=1