php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14089 use of mcrypt functions result in segfault of apache child
Submitted: 2001-11-16 20:00 UTC Modified: 2001-11-17 09:32 UTC
From: mued at dev-edge dot org Assigned: derick (profile)
Status: Closed Package: mcrypt related
PHP Version: 4.0CVS-2001-11-16 OS: GNU/Debian Sid
Private report: No CVE-ID: None
 [2001-11-16 20:00 UTC] mued at dev-edge dot org
Hi,

I just encountered strange segfault with current cvs version. When using ming or mcrypt connectors, the apache child doing task is going into defunct activity.

mcrypt is 2.5.7
sablotron is 0.71
apache is 1.3.22, deb binary & source recompiled for test
linux kernel is 2.4.6

On debug bactracing on php, when launching httpd -X a message from sablotron comes up

Cannot load /usr/lib/apache/1.3/libphp4.so into server: /usr/lib/apache/1.3/libp
hp4.so: undefined symbol: sablot_module_entry


current php's configuration parameters:

'./configure' '--enable-inline-optimization' '--enable-mbstr-enc-trans' '--enable-mbstring' '--prefix=/usr' '--with-apxs=/usr/bin/apxs' '--with-regex=system' '--with-config-file-path=/etc/php4/apache' '--disable-rpath' '--enable-memory-limit' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--disable-debug' '--disable-static' '--with-bz2' '--with-curl=shared,/usr' '--with-db2' '--with-ndbm' '--with-dom=shared,/usr' '--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext' '--with-gd=shared' '--enable-gd-native-ttf' '--with-png-dir=/usr' '--with-jpeg-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-mhash=shared' '--with-mysql=shared,/usr' '--with-pcre-regex=/usr' '--with-pgsql=shared,/usr' '--with-sablot=shared,/usr' '--enable-sablot-errors-descriptive' '--enable-shmop' '--enable-sockets' '--with-ttf=/usr' '--with-t1lib=/usr' '--with-tiff-dir=/usr' '--enable-yp' '--with-zlib' '--with-mcrypt' '--with-pspell=/usr' '--with-dom=/usr' '--with-ming' '--enable-sockets' '--enable-freetype-4bit-antialias-hack' '--with-pdflib=/usr' '--enable-shared-pdflib' '--enable-ucd-snmp-hack' '--with-recode=/usr'

hope this will help 
Regards, 
            mued

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-16 20:09 UTC] derick@php.net
Please post your script, and which version of libmcrypt (not mcrypt) you use.

Derick
 [2001-11-16 21:11 UTC] mued at dev-edge dot org
sablotron seem to be another bug when I remove some params from config.nice & relaunch compilation

here's the debug trace given when apache hit the code producing problems

Program received signal SIGSEGV, Segmentation fault.
0x40b6fb2d in tripledes_LTX__mcrypt_decrypt () from /usr/lib/libmcrypt/tripledes.so


Here's the code,

function amp_prepare_pass() {

        global $PASSWD_KEY;     // set it into your amp_secure.php

        $yor["td"] = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, "");
        $yor["iv"] = mcrypt_create_iv (mcrypt_enc_get_iv_size ( $yor["td"] ), MCRYPT_RAND);

        mcrypt_generic_init ($yor["td"], $PASSWD_KEY, $yor["iv"]);

        return $yor;

}



function amp_encode_pass( $str ) {

        $all_needed = amp_prepare_pass();
        $encrypted_data = mcrypt_generic ($all_needed["td"], $str);
        @mcrypt_generic_end ( $all_needed["td"] );

        return $encrypted_data;

}


function amp_decode_pass( $str ) {

        $all_needed = amp_prepare_pass();
        $decrypted_data = mdecrypt_generic ($all_needed["td"], $str);
        @mcrypt_generic_end ( $all_needed["td"] );

        return $decrypted_data;

}

 [2001-11-16 21:28 UTC] mued at dev-edge dot org
libmcrypt is 4.2.6
 [2001-11-17 06:26 UTC] derick@php.net
I think you meant 2.4.6, if that is the case, upgrade to 2.4.17, which has a lot of bugs fixed.
I'm closing this bug, because it's a merely a problem in the libmcrypt library itself.
Please reopen if upgrading does not fix the problem.

Derick
 [2001-11-17 09:32 UTC] mued at dev-edge dot org
Hi Derick,

It works well after upgrading libmcrypt & recompiling, thx
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 27 18:01:35 2024 UTC