|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-09-22 14:39 UTC] achapkis at dls dot net
I just upgraded PHP 4.0.3pl1 to PHP 4.0.6 and I keep getting Segmentation fault (11) in function mcrypt_generic. Yesterday I downloaded new libmcrypt v. 2.4.16b and recompiled everything, still get this error. It used to worked before with this script: $td = mcrypt_module_open MCRYPT_TripleDES, "",MCRYPT_MODE_ECB, ""); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init ($td, $keystr, $iv); $enc_pas= mcrypt_generic ($td, $ascii_pass); mcrypt_generic_end ($td); Here's my phpinfo(): http://yakov.dls.net/~achapkis/test.php3 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 18:00:02 2025 UTC |
Here's the gdb trace of core file: yakov:/usr/local/apache$ gdb bin/httpd ./core GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "alpha-redhat-linux"... Core was generated by `/usr/local/apache/bin/httpd'. Program terminated with signal 11, Segmentation fault. Reading symbols from /lib/libm.so.6.1...done. Loaded symbols for /lib/libm.so.6.1 Reading symbols from /lib/libcrypt.so.1.1...done. Loaded symbols for /lib/libcrypt.so.1.1 Reading symbols from /usr/lib/libdb.so.3...done. Loaded symbols for /usr/lib/libdb.so.3 Reading symbols from /lib/libdl.so.2.1...done. Loaded symbols for /lib/libdl.so.2.1 Reading symbols from /lib/libc.so.6.1...done. Loaded symbols for /lib/libc.so.6.1 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /lib/libnss_files.so.2...done. Loaded symbols for /lib/libnss_files.so.2 Reading symbols from /usr/local/apache/libexec/libphp4.so...done. Loaded symbols for /usr/local/apache/libexec/libphp4.so Reading symbols from /lib/libpam.so.0...done. Loaded symbols for /lib/libpam.so.0 Reading symbols from /usr/local/lib/libmcrypt.so.4...done. Loaded symbols for /usr/local/lib/libmcrypt.so.4 Reading symbols from /usr/lib/libltdl.so.0...done. Loaded symbols for /usr/lib/libltdl.so.0 Reading symbols from /usr/lib/libbz2.so.1...done. Loaded symbols for /usr/lib/libbz2.so.1 Reading symbols from /lib/libresolv.so.2.1...done. Loaded symbols for /lib/libresolv.so.2.1 Reading symbols from /lib/libnsl.so.1.1...done. Loaded symbols for /lib/libnsl.so.1.1 #0 _dl_lookup_versioned_symbol (undef_name=0x120006778 "unlink", undef_map=0x2000002cc08, ref=0x11ffff700, symbol_scope=0x2000002ce88, version=0x200002747a8, reloc_type=26, explicit=0) at do-lookup.h:79 79 do-lookup.h: No such file or directory. (gdb) bt #0 _dl_lookup_versioned_symbol (undef_name=0x120006778 "unlink", undef_map=0x2000002cc08, ref=0x11ffff700, symbol_scope=0x2000002ce88, version=0x200002747a8, reloc_type=26, explicit=0) at do-lookup.h:79 #1 0x2000001035c in fixup (l=0x2000002cc08, reloc_offset=2574048) at dl-runtime.c:89 #2 0x200000107b8 in _dl_runtime_resolve () at dl-runtime.c:203 #3 0x120053470 in standalone_main () #4 0x120053c48 in main () #5 0x200002c28fc in __libc_start_main (main=0x120053740 <main>, argc=1, ubp_av=0x11ffff998, init=0x12000a100 <_init>, fini=0x2000002c6f0 <_dl_debug_mask>, rtld_fini=0x1200b841c <priorities+5052>, stack_end=0x11ffff980) at ../sysdeps/generic/libc-start.c:129 (gdb)Ooops :((( Sorry, I just refreshed the page. Anyway, the whole script is an include file with a lot of functions defined, here's the exact function I use to encrypt the passwords: function encrypt_pass($ascii_pass) { if ($ascii_pass) { $keystr="Veni, vidi, vici!!!"; $td = mcrypt_module_open(MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, ""); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init ($td, $keystr, $iv); $enc_pas= mcrypt_generic ($td, $ascii_pass); mcrypt_generic_end ($td); }else {$enc_pas="";} return $enc_pas; } Then I just call it anywhere I want in my scripts.Just as an update, I upgraded glibc to glibc-2.2.4-19 and I used a Compaq C/C++ compiler (it's an Alpha), I still get this error, even though the backtrace is different now (I've got CVS tree, PHP Version 4.2.0-dev). Here's the code I used: #!/usr/local/bin/php -q <? function encrypt_pass($ascii_pass) { if ($ascii_pass) { $keystr="Veni, vidi, vici!!!"; $td = mcrypt_module_open(MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, ""); $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init ($td, $keystr, $iv); $enc_pas= mcrypt_generic ($td, $ascii_pass); mcrypt_generic_end ($td); }else {$enc_pas="";} return $enc_pas; } echo encrypt_pass("It$myPass"); ?> Here's the gdb's backtrace: (gdb) bt #0 0x0 in ?? () #1 0x1201b97b4 in mcrypt_enc_is_block_algorithm_mode (td=0x12036ea50) at mcrypt_modules.c:440 Cannot access memory at address 0x20 Please, let me know if you would like an additional information or maybe a shell on my machine. Thank you.