I have PHP4.1.2 with libmcrypt4.2.22. I had a script that worked just fine yesterday 
testing an mcrypt scenario, and (of course) today it just kills the httpd serving the 
page and I get this in error_log:
[Sun Mar 24 08:31:36 2002] [notice] child pid 1049 exit signal Segmentation fault (11)

The script looks more or less as follows:

$input="text";
$key="key";
$enc_descr=mcrypt_module_open(MCRYPT_RIJNDAEL_256,"",MCRYPT_MODE_CBC,"");
srand((double)microtime()*1000000);
$init_vector=mcrypt_create_iv(mcrypt_enc_get_iv_size($enc_descr),MCRYPT_RAND);
mcrypt_generic_init($enc_descr,$key,$init_vector);
$max_key_len=mcrypt_enc_get_key_size($enc_descr);
if(strlen($key)>=$max_key_len){
    //truncate the key to a valid length
    $key=substr($key,0,$max_key_len);
}
$encrypted_data=mcrypt_generic($enc_descr,$input);
$base64enc_encrypted_data=base64_encode($encrypted_data);
mcrypt_generic_end($enc_descr);

Something I'm missing? I found somewhere on the mcrypt page saying "compile with 
--disable-posix-threads". Can anyone verify this is the problem before I get into 
recompiling everything?

TIA,
thalis


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to