php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13399 Segmentation fault (11) in apache when using mcrypt_generic
Submitted: 2001-09-22 14:39 UTC Modified: 2001-12-14 14:39 UTC
From: achapkis at dls dot net Assigned:
Status: Closed Package: mcrypt related
PHP Version: 4.0.6, 4.0.8-dev OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: achapkis at dls dot net
New email:
PHP Version: OS:

 

 [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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-22 17:11 UTC] achapkis at dls dot net
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)
 [2001-09-22 19:31 UTC] derick@php.net
I'm already working on this.

Derick
 [2001-09-23 10:39 UTC] derick@php.net
Can you please check this with the latest CVS version, I just comitted a fix for this. Please report back if it does not work.

Derick
 [2001-09-23 17:21 UTC] achapkis at dls dot net
 I dowloaded and recompiled CVS (4.0.8-dev) and still have the same error. However, I couldn't get core file, because when I reconfigure with --enable-debug option, make reported and error:

cc -shared  stub.lo -Wl,--whole-archive Zend/.libs/libZend.al sapi/apache/.libs/libsapi.al main/.libs/libmain.al regex/
.libs/libregex.al ext/bz2/.libs/libbz2.al ext/mcrypt/.libs/libmcrypt.al ext/mysql/.libs/libmysql.al ext/pcre/.libs/libpc
re.al ext/posix/.libs/libposix.al ext/session/.libs/libsession.al ext/standard/.libs/libstandard.al ext/xml/.libs/libxml
.al TSRM/.libs/libtsrm.al /usr/local/lib/libmcrypt.a -Wl,--no-whole-archive  -Wl,--rpath -Wl,/usr/local/lib  -L/usr/lib
-L/usr/local/lib Zend/.libs/libZend.al -ldl -ldl -ldl -lcrypt -lresolv -ldl -lresolv -lcrypt sapi/apache/.libs/libsapi.a
l main/.libs/libmain.al regex/.libs/libregex.al ext/bz2/.libs/libbz2.al ext/mcrypt/.libs/libmcrypt.al ext/mysql/.libs/li
bmysql.al ext/pcre/.libs/libpcre.al ext/posix/.libs/libposix.al ext/session/.libs/libsession.al ext/standard/.libs/libst
andard.al ext/xml/.libs/libxml.al TSRM/.libs/libtsrm.al -lpam -ldl /usr/local/lib/libmcrypt.a /usr/lib/libltdl.so -lbz2
-lcrypt -lresolv -lm -ldl -lnsl -lresolv -lcrypt               -Wl,-soname -Wl,libphp4.so -o .libs/libphp4.so
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_algorithm_module_ok':
:292: multiple definition of `mcrypt_algorithm_module_ok'
Zend/.libs/libZend.al(mcrypt_extra.o)::292: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_mode_module_ok':
:334: multiple definition of `mcrypt_mode_module_ok'
Zend/.libs/libZend.al(mcrypt_extra.o)::334: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_readdir':
:37: multiple definition of `mcrypt_readdir'
Zend/.libs/libZend.al(mcrypt_extra.o)::37: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_list_algorithms':
:74: multiple definition of `mcrypt_list_algorithms'
Zend/.libs/libZend.al(mcrypt_extra.o)::74: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_list_modes':
:179: multiple definition of `mcrypt_list_modes'
Zend/.libs/libZend.al(mcrypt_extra.o)::179: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_free_p':
:281: multiple definition of `mcrypt_free_p'
Zend/.libs/libZend.al(mcrypt_extra.o)::281: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_check_version':
:415: multiple definition of `mcrypt_check_version'
Zend/.libs/libZend.al(mcrypt_extra.o)::415: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_generic_init':
:154: multiple definition of `mcrypt_generic_init'
Zend/.libs/libZend.al(mcrypt.o)::154: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_generic':
:160: multiple definition of `mcrypt_generic'
Zend/.libs/libZend.al(mcrypt.o)::160: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mdecrypt_generic':
:169: multiple definition of `mdecrypt_generic'
Zend/.libs/libZend.al(mcrypt.o)::169: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_generic_end':
:177: multiple definition of `mcrypt_generic_end'
Zend/.libs/libZend.al(mcrypt.o)::177: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_generic_deinit':
:188: multiple definition of `mcrypt_generic_deinit'
Zend/.libs/libZend.al(mcrypt.o)::188: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_perror':
:197: multiple definition of `mcrypt_perror'
Zend/.libs/libZend.al(mcrypt.o)::197: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_strerror':
:226: multiple definition of `mcrypt_strerror'
Zend/.libs/libZend.al(mcrypt.o)::226: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_free':
:254: multiple definition of `mcrypt_free'
Zend/.libs/libZend.al(mcrypt.o)::254: first defined here
/usr/local/lib/libmcrypt.a(bzero.o): In function `Bzero':
:27: multiple definition of `Bzero'
Zend/.libs/libZend.al(bzero.o)::27: first defined here
/usr/local/lib/libmcrypt.a(xmemory.o): In function `LOCKMEM':
:35: multiple definition of `LOCKMEM'
Zend/.libs/libZend.al(xmemory.o)::35: first defined here
/usr/local/lib/libmcrypt.a(xmemory.o): In function `mxmalloc':
:50: multiple definition of `mxmalloc'
Zend/.libs/libZend.al(xmemory.o)::50: first defined here
/usr/local/lib/libmcrypt.a(xmemory.o): In function `mxcalloc':
:63: multiple definition of `mxcalloc'
Zend/.libs/libZend.al(xmemory.o)::63: first defined here
/usr/local/lib/libmcrypt.a(xmemory.o): In function `mxrealloc':
:75: multiple definition of `mxrealloc'
Zend/.libs/libZend.al(xmemory.o)::75: first defined here
/usr/local/lib/libmcrypt.a(xmemory.o): In function `mxfree':
:88: multiple definition of `mxfree'
Zend/.libs/libZend.al(xmemory.o)::88: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_close':
:106: multiple definition of `mcrypt_module_close'
Zend/.libs/libZend.al(mcrypt_modules.o)::106: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `end_mcrypt':
:379: multiple definition of `end_mcrypt'
Zend/.libs/libZend.al(mcrypt_modules.o)::379: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_mode_get_size':
:233: multiple definition of `mcrypt_mode_get_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::233: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_set_key':
:250: multiple definition of `mcrypt_set_key'
Zend/.libs/libZend.al(mcrypt_modules.o)::250: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_block_size':
:295: multiple definition of `mcrypt_enc_get_block_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::295: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_iv_size':
:313: multiple definition of `mcrypt_enc_get_iv_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::313: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_key_size':
:323: multiple definition of `mcrypt_enc_get_key_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::323: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_supported_key_sizes':
:332: multiple definition of `mcrypt_enc_get_supported_key_sizes'
Zend/.libs/libZend.al(mcrypt_modules.o)::332: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_is_block_algorithm':
:351: multiple definition of `mcrypt_enc_is_block_algorithm'
Zend/.libs/libZend.al(mcrypt_modules.o)::351: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_algorithms_name':
:360: multiple definition of `mcrypt_enc_get_algorithms_name'
Zend/.libs/libZend.al(mcrypt_modules.o)::360: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `init_mcrypt':
:370: multiple definition of `init_mcrypt'
Zend/.libs/libZend.al(mcrypt_modules.o)::370: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt':
:388: multiple definition of `mcrypt'
Zend/.libs/libZend.al(mcrypt_modules.o)::388: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mdecrypt':
:398: multiple definition of `mdecrypt'
Zend/.libs/libZend.al(mcrypt_modules.o)::398: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_modes_name':
:408: multiple definition of `mcrypt_enc_get_modes_name'
Zend/.libs/libZend.al(mcrypt_modules.o)::408: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_is_block_mode':
:417: multiple definition of `mcrypt_enc_is_block_mode'
Zend/.libs/libZend.al(mcrypt_modules.o)::417: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_mode_has_iv':
:426: multiple definition of `mcrypt_enc_mode_has_iv'
Zend/.libs/libZend.al(mcrypt_modules.o)::426: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_is_block_algorithm_mode':
:435: multiple definition of `mcrypt_enc_is_block_algorithm_mode'
Zend/.libs/libZend.al(mcrypt_modules.o)::435: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_algorithm_version':
:489: multiple definition of `mcrypt_module_algorithm_version'
Zend/.libs/libZend.al(mcrypt_modules.o)::489: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_mode_version':
:522: multiple definition of `mcrypt_module_mode_version'
Zend/.libs/libZend.al(mcrypt_modules.o)::522: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_get_size':
:216: multiple definition of `mcrypt_get_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::216: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_dlsym':
:93: multiple definition of `mcrypt_dlsym'
Zend/.libs/libZend.al(mcrypt_modules.o)::93: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_dlclose':
:85: multiple definition of `mcrypt_dlclose'
Zend/.libs/libZend.al(mcrypt_modules.o)::85: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `_mcrypt_search_symlist_lib':
:51: multiple definition of `_mcrypt_search_symlist_lib'
Zend/.libs/libZend.al(mcrypt_modules.o)::51: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `_mcrypt_search_symlist_sym':
:65: multiple definition of `_mcrypt_search_symlist_sym'
Zend/.libs/libZend.al(mcrypt_modules.o)::65: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_dlopen':
:128: multiple definition of `mcrypt_dlopen'
Zend/.libs/libZend.al(mcrypt_modules.o)::128: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_open':
:162: multiple definition of `mcrypt_module_open'
Zend/.libs/libZend.al(mcrypt_modules.o)::162: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_set_state':
:279: multiple definition of `mcrypt_enc_set_state'
Zend/.libs/libZend.al(mcrypt_modules.o)::279: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_get_algo_iv_size':
:304: multiple definition of `mcrypt_get_algo_iv_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::304: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_self_test':
:444: multiple definition of `mcrypt_enc_self_test'
Zend/.libs/libZend.al(mcrypt_modules.o)::444: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_self_test':
:454: multiple definition of `mcrypt_module_self_test'
Zend/.libs/libZend.al(mcrypt_modules.o)::454: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_is_block_algorithm':
:555: multiple definition of `mcrypt_module_is_block_algorithm'
Zend/.libs/libZend.al(mcrypt_modules.o)::555: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_is_block_algorithm_mode':
:588: multiple definition of `mcrypt_module_is_block_algorithm_mode'
Zend/.libs/libZend.al(mcrypt_modules.o)::588: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_is_block_mode':
:621: multiple definition of `mcrypt_module_is_block_mode'
Zend/.libs/libZend.al(mcrypt_modules.o)::621: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_get_algo_block_size':
:654: multiple definition of `mcrypt_module_get_algo_block_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::654: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_get_algo_key_size':
:687: multiple definition of `mcrypt_module_get_algo_key_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::687: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_get_algo_supported_key_sizes':
:720: multiple definition of `mcrypt_module_get_algo_supported_key_sizes'
Zend/.libs/libZend.al(mcrypt_modules.o)::720: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_threads.o): In function `mcrypt_mutex_register':
:44: multiple definition of `mcrypt_mutex_register'
Zend/.libs/libZend.al(mcrypt_threads.o)::44: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_symb.o)(.rodata+0x0): multiple definition of `mps'
Zend/.libs/libZend.al(mcrypt_symb.o)(.rodata+0x0): first defined here
collect2: ld returned 1 exit status
make[1]: *** [libphp4.la] Error 1
make[1]: Leaving directory `/usr/src/php4'
make: *** [all-recursive] Error 1
yakov:/usr/src/php4$
 [2001-09-23 17:23 UTC] derick@php.net
Can you please mail me the whole script then? I couldn't reproduce it after the fix I did.

Derick
 [2001-09-23 17:30 UTC] achapkis at dls dot net
 I dowloaded and recompiled CVS (4.0.8-dev) and still have the same error. However, I couldn't get core file, because when I reconfigure with --enable-debug option, make reported and error:

cc -shared  stub.lo -Wl,--whole-archive Zend/.libs/libZend.al sapi/apache/.libs/libsapi.al main/.libs/libmain.al regex/
.libs/libregex.al ext/bz2/.libs/libbz2.al ext/mcrypt/.libs/libmcrypt.al ext/mysql/.libs/libmysql.al ext/pcre/.libs/libpc
re.al ext/posix/.libs/libposix.al ext/session/.libs/libsession.al ext/standard/.libs/libstandard.al ext/xml/.libs/libxml
.al TSRM/.libs/libtsrm.al /usr/local/lib/libmcrypt.a -Wl,--no-whole-archive  -Wl,--rpath -Wl,/usr/local/lib  -L/usr/lib
-L/usr/local/lib Zend/.libs/libZend.al -ldl -ldl -ldl -lcrypt -lresolv -ldl -lresolv -lcrypt sapi/apache/.libs/libsapi.a
l main/.libs/libmain.al regex/.libs/libregex.al ext/bz2/.libs/libbz2.al ext/mcrypt/.libs/libmcrypt.al ext/mysql/.libs/li
bmysql.al ext/pcre/.libs/libpcre.al ext/posix/.libs/libposix.al ext/session/.libs/libsession.al ext/standard/.libs/libst
andard.al ext/xml/.libs/libxml.al TSRM/.libs/libtsrm.al -lpam -ldl /usr/local/lib/libmcrypt.a /usr/lib/libltdl.so -lbz2
-lcrypt -lresolv -lm -ldl -lnsl -lresolv -lcrypt               -Wl,-soname -Wl,libphp4.so -o .libs/libphp4.so
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_algorithm_module_ok':
:292: multiple definition of `mcrypt_algorithm_module_ok'
Zend/.libs/libZend.al(mcrypt_extra.o)::292: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_mode_module_ok':
:334: multiple definition of `mcrypt_mode_module_ok'
Zend/.libs/libZend.al(mcrypt_extra.o)::334: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_readdir':
:37: multiple definition of `mcrypt_readdir'
Zend/.libs/libZend.al(mcrypt_extra.o)::37: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_list_algorithms':
:74: multiple definition of `mcrypt_list_algorithms'
Zend/.libs/libZend.al(mcrypt_extra.o)::74: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_list_modes':
:179: multiple definition of `mcrypt_list_modes'
Zend/.libs/libZend.al(mcrypt_extra.o)::179: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_free_p':
:281: multiple definition of `mcrypt_free_p'
Zend/.libs/libZend.al(mcrypt_extra.o)::281: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_extra.o): In function `mcrypt_check_version':
:415: multiple definition of `mcrypt_check_version'
Zend/.libs/libZend.al(mcrypt_extra.o)::415: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_generic_init':
:154: multiple definition of `mcrypt_generic_init'
Zend/.libs/libZend.al(mcrypt.o)::154: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_generic':
:160: multiple definition of `mcrypt_generic'
Zend/.libs/libZend.al(mcrypt.o)::160: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mdecrypt_generic':
:169: multiple definition of `mdecrypt_generic'
Zend/.libs/libZend.al(mcrypt.o)::169: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_generic_end':
:177: multiple definition of `mcrypt_generic_end'
Zend/.libs/libZend.al(mcrypt.o)::177: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_generic_deinit':
:188: multiple definition of `mcrypt_generic_deinit'
Zend/.libs/libZend.al(mcrypt.o)::188: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_perror':
:197: multiple definition of `mcrypt_perror'
Zend/.libs/libZend.al(mcrypt.o)::197: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_strerror':
:226: multiple definition of `mcrypt_strerror'
Zend/.libs/libZend.al(mcrypt.o)::226: first defined here
/usr/local/lib/libmcrypt.a(mcrypt.o): In function `mcrypt_free':
:254: multiple definition of `mcrypt_free'
Zend/.libs/libZend.al(mcrypt.o)::254: first defined here
/usr/local/lib/libmcrypt.a(bzero.o): In function `Bzero':
:27: multiple definition of `Bzero'
Zend/.libs/libZend.al(bzero.o)::27: first defined here
/usr/local/lib/libmcrypt.a(xmemory.o): In function `LOCKMEM':
:35: multiple definition of `LOCKMEM'
Zend/.libs/libZend.al(xmemory.o)::35: first defined here
/usr/local/lib/libmcrypt.a(xmemory.o): In function `mxmalloc':
:50: multiple definition of `mxmalloc'
Zend/.libs/libZend.al(xmemory.o)::50: first defined here
/usr/local/lib/libmcrypt.a(xmemory.o): In function `mxcalloc':
:63: multiple definition of `mxcalloc'
Zend/.libs/libZend.al(xmemory.o)::63: first defined here
/usr/local/lib/libmcrypt.a(xmemory.o): In function `mxrealloc':
:75: multiple definition of `mxrealloc'
Zend/.libs/libZend.al(xmemory.o)::75: first defined here
/usr/local/lib/libmcrypt.a(xmemory.o): In function `mxfree':
:88: multiple definition of `mxfree'
Zend/.libs/libZend.al(xmemory.o)::88: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_close':
:106: multiple definition of `mcrypt_module_close'
Zend/.libs/libZend.al(mcrypt_modules.o)::106: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `end_mcrypt':
:379: multiple definition of `end_mcrypt'
Zend/.libs/libZend.al(mcrypt_modules.o)::379: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_mode_get_size':
:233: multiple definition of `mcrypt_mode_get_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::233: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_set_key':
:250: multiple definition of `mcrypt_set_key'
Zend/.libs/libZend.al(mcrypt_modules.o)::250: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_block_size':
:295: multiple definition of `mcrypt_enc_get_block_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::295: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_iv_size':
:313: multiple definition of `mcrypt_enc_get_iv_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::313: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_key_size':
:323: multiple definition of `mcrypt_enc_get_key_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::323: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_supported_key_sizes':
:332: multiple definition of `mcrypt_enc_get_supported_key_sizes'
Zend/.libs/libZend.al(mcrypt_modules.o)::332: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_is_block_algorithm':
:351: multiple definition of `mcrypt_enc_is_block_algorithm'
Zend/.libs/libZend.al(mcrypt_modules.o)::351: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_algorithms_name':
:360: multiple definition of `mcrypt_enc_get_algorithms_name'
Zend/.libs/libZend.al(mcrypt_modules.o)::360: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `init_mcrypt':
:370: multiple definition of `init_mcrypt'
Zend/.libs/libZend.al(mcrypt_modules.o)::370: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt':
:388: multiple definition of `mcrypt'
Zend/.libs/libZend.al(mcrypt_modules.o)::388: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mdecrypt':
:398: multiple definition of `mdecrypt'
Zend/.libs/libZend.al(mcrypt_modules.o)::398: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_get_modes_name':
:408: multiple definition of `mcrypt_enc_get_modes_name'
Zend/.libs/libZend.al(mcrypt_modules.o)::408: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_is_block_mode':
:417: multiple definition of `mcrypt_enc_is_block_mode'
Zend/.libs/libZend.al(mcrypt_modules.o)::417: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_mode_has_iv':
:426: multiple definition of `mcrypt_enc_mode_has_iv'
Zend/.libs/libZend.al(mcrypt_modules.o)::426: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_is_block_algorithm_mode':
:435: multiple definition of `mcrypt_enc_is_block_algorithm_mode'
Zend/.libs/libZend.al(mcrypt_modules.o)::435: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_algorithm_version':
:489: multiple definition of `mcrypt_module_algorithm_version'
Zend/.libs/libZend.al(mcrypt_modules.o)::489: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_mode_version':
:522: multiple definition of `mcrypt_module_mode_version'
Zend/.libs/libZend.al(mcrypt_modules.o)::522: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_get_size':
:216: multiple definition of `mcrypt_get_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::216: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_dlsym':
:93: multiple definition of `mcrypt_dlsym'
Zend/.libs/libZend.al(mcrypt_modules.o)::93: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_dlclose':
:85: multiple definition of `mcrypt_dlclose'
Zend/.libs/libZend.al(mcrypt_modules.o)::85: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `_mcrypt_search_symlist_lib':
:51: multiple definition of `_mcrypt_search_symlist_lib'
Zend/.libs/libZend.al(mcrypt_modules.o)::51: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `_mcrypt_search_symlist_sym':
:65: multiple definition of `_mcrypt_search_symlist_sym'
Zend/.libs/libZend.al(mcrypt_modules.o)::65: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_dlopen':
:128: multiple definition of `mcrypt_dlopen'
Zend/.libs/libZend.al(mcrypt_modules.o)::128: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_open':
:162: multiple definition of `mcrypt_module_open'
Zend/.libs/libZend.al(mcrypt_modules.o)::162: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_set_state':
:279: multiple definition of `mcrypt_enc_set_state'
Zend/.libs/libZend.al(mcrypt_modules.o)::279: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_get_algo_iv_size':
:304: multiple definition of `mcrypt_get_algo_iv_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::304: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_enc_self_test':
:444: multiple definition of `mcrypt_enc_self_test'
Zend/.libs/libZend.al(mcrypt_modules.o)::444: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_self_test':
:454: multiple definition of `mcrypt_module_self_test'
Zend/.libs/libZend.al(mcrypt_modules.o)::454: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_is_block_algorithm':
:555: multiple definition of `mcrypt_module_is_block_algorithm'
Zend/.libs/libZend.al(mcrypt_modules.o)::555: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_is_block_algorithm_mode':
:588: multiple definition of `mcrypt_module_is_block_algorithm_mode'
Zend/.libs/libZend.al(mcrypt_modules.o)::588: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_is_block_mode':
:621: multiple definition of `mcrypt_module_is_block_mode'
Zend/.libs/libZend.al(mcrypt_modules.o)::621: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_get_algo_block_size':
:654: multiple definition of `mcrypt_module_get_algo_block_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::654: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_get_algo_key_size':
:687: multiple definition of `mcrypt_module_get_algo_key_size'
Zend/.libs/libZend.al(mcrypt_modules.o)::687: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_modules.o): In function `mcrypt_module_get_algo_supported_key_sizes':
:720: multiple definition of `mcrypt_module_get_algo_supported_key_sizes'
Zend/.libs/libZend.al(mcrypt_modules.o)::720: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_threads.o): In function `mcrypt_mutex_register':
:44: multiple definition of `mcrypt_mutex_register'
Zend/.libs/libZend.al(mcrypt_threads.o)::44: first defined here
/usr/local/lib/libmcrypt.a(mcrypt_symb.o)(.rodata+0x0): multiple definition of `mps'
Zend/.libs/libZend.al(mcrypt_symb.o)(.rodata+0x0): first defined here
collect2: ld returned 1 exit status
make[1]: *** [libphp4.la] Error 1
make[1]: Leaving directory `/usr/src/php4'
make: *** [all-recursive] Error 1
yakov:/usr/src/php4$
 [2001-09-23 17:32 UTC] achapkis at dls dot net
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. 
 [2001-10-25 23:35 UTC] achapkis at dls dot net
 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.
 [2001-10-26 04:02 UTC] derick@php.net
Found the prob, fix is under way.

Derick
 [2001-12-13 15:43 UTC] derick@php.net
Should be fixed in CVS, can you try (in about a day) the 
latest snapshot from snaps.php.net ?

Derick
 [2001-12-14 11:17 UTC] achapkis at dls dot net
  I downloaded CVS and tried that yesterday an I just downloaded a snapshot and both still have the same problem.
I'm not sure, but I think the gdb backtrace shows the same information as it was before:

(gdb) bt
#0  0x0 in ?? ()
#1  0x1201bcba4 in mcrypt_enc_is_block_algorithm_mode (td=0x120283820) at mcrypt_modules.c:440
Cannot access memory at address 0x20

 [2001-12-14 11:21 UTC] derick@php.net
What version of libcmrypt are you using now?

Derick
 [2001-12-14 14:39 UTC] achapkis at dls dot net
  You're right, it was libmcrypt problem. I was using libmcrypt 2.4.16b, when upgraded to 2.4.18 it started to work.

  Thank you very much!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC