NetBSD Problem Report #16198
Received: (qmail 2650 invoked from network); 4 Apr 2002 16:51:50 -0000
Message-Id: <200204041650.g34Goue07065@precedence.co.uk>
Date: Thu, 4 Apr 2002 17:50:56 +0100 (BST)
From: netbsd@precedence.co.uk
Reply-To: netbsd@precedence.co.uk
To: gnats-bugs@gnats.netbsd.org
Subject: php4-imap and php4-mcrypt (libmcrypt 2.4.x) clash
X-Send-Pr-Version: 3.95
>Number: 16198
>Category: pkg
>Synopsis: If php4-imap and php4-mcrypt (based on libmcrypt 2.4.x), httpd SEGVs
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: jlam
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Apr 04 16:52:00 +0000 2002
>Closed-Date: Mon Jan 05 11:07:55 +0000 2004
>Last-Modified: Wed May 13 13:22:03 +0000 2015
>Originator: Stephen Borrill
>Release: NetBSD 1.5.2
>Organization:
Precedence Technologies Ltd
>Environment:
System: NetBSD netmanager 1.5.2 NetBSD 1.5.2 (phil) #1: Thu Jan 31 11:08:49 GMT 2002 root@netmanager:/usr/src/sys/arch/i386/compile/phil i386
>Description:
On i386, with a plain 1.5.2 installation and a -current pkgsrc, attempting to use
php4-imap and php4-mcrypt together in conjunction with ap-php4 will cause
the Apache httpd child process to SEGV with errors like:
Invalid shared object handle 0x480c2400
[Thu Apr 4 15:53:41 2002] [notice] child pid 29440 exit signal
Segmentation fault (11)
Removing the mcrypt.so line from php.ini allows imap to work again.
Statically linking the mcrypt and imap php modules into libphp4.so gives
pretty much the same error:
[Thu Apr 4 16:09:16 2002] [notice] child pid 20482 exit signal
Segmentation fault (11)
[Thu Apr 4 16:09:26 2002] [notice] child pid 20483 exit signal
Bus error (10)
Building a non-pkgsrc version of libmcrypt-2.2.7 and then hacking
php4-mcrypt/Makefile to use that instead of the libmcrypt package gives a
working system, therefore the problem appears to be libmcrypt-2.4.x specific.
>How-To-Repeat:
On i386:
Compile up ap-php4 and dependencies. Compile php4-mcrypt and php4-imap and
dependencies. Edit /usr/pkg/etc/php.ini and add:
extension=mcrypt.so
extension=imap.so
Run a piece of HTML with something like:
$mbox=imap_open("{localhost:143/notls}INBOX","username","password",OP_HALFOPEN);
httpd will give a segmentation fault.
>Fix:
It's a nasty workaround and not a fix, but:
Download:
ftp://mcrypt.hellug.gr/pub/mcrypt/libmcrypt/old/libmcrypt-2.2.7.tar.gz
Extract, configure and make install.
Alter security/php4-mcrypt/Makefile:
--- Makefile.orig Fri Mar 1 15:58:38 2002
+++ Makefile Thu Apr 4 17:41:48 2002
@@ -7,7 +7,8 @@
.include "../../www/php4/Makefile.module"
-CONFIGURE_ARGS+= --with-${MODNAME}=shared,${BUILDLINK_DIR}
+#CONFIGURE_ARGS+= --with-${MODNAME}=shared,${BUILDLINK_DIR}
+CONFIGURE_ARGS+= --with-${MODNAME}=shared,/usr/local
-.include "../../security/libmcrypt/buildlink.mk"
+#.include "../../security/libmcrypt/buildlink.mk"
.include "../../mk/bsd.pkg.mk"
Make php4-mcrypt and install. imap functions in PHP will now work.
A slightly neater temporary solution would be to add a libmcrypt22 package
which installs 2.2.7 instead of 2.4.x and then make php4-mcrypt depend on
that (and register a clash with libmcrypt).
None of these workarounds solve the core problem: PHP mcrypt module based on
libmcrypt 2.4 doesn't work with imap PHP module.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: pkg-manager->jlam
Responsible-Changed-By: jlam
Responsible-Changed-When: Mon Apr 8 16:01:17 PDT 2002
Responsible-Changed-Why:
I'm the PHP guy.
From: "Johnny C. Lam" <jlam@netbsd.org>
To: netbsd@precedence.co.uk
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/16198: php4-imap and php4-mcrypt (libmcrypt 2.4.x) clash
Date: Mon, 8 Apr 2002 16:13:01 -0700
On Thu, Apr 04, 2002 at 05:50:56PM +0100, netbsd@precedence.co.uk wrote:
>
> A slightly neater temporary solution would be to add a libmcrypt22 package
> which installs 2.2.7 instead of 2.4.x and then make php4-mcrypt depend on
> that (and register a clash with libmcrypt).
The best solution is to see if updating the libmcrypt package will fix
this problem (both 2.4.22 and 2.5.0 have been released since our package
was last updated). If that fails, then I think I'll modify the php4-imap
pkgsrc to download and to build a libmcrypt_pic.a that contains the main
library routines and all of the crypto extensions then link the whole
archive with the PHP4 mcrypt.so.
> None of these workarounds solve the core problem: PHP mcrypt module based on
> libmcrypt 2.4 doesn't work with imap PHP module.
This looks to be a problem with the libmcrypt library, so I don't think this
is a pkgsrc issue unless someones comes up with a patch to the library to
properly fix this.
Cheers,
-- Johnny Lam <jlam@jgrind.org>
From: Stephen Borrill <netbsd@precedence.co.uk>
To: "Johnny C. Lam" <jlam@netbsd.org>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/16198: php4-imap and php4-mcrypt (libmcrypt 2.4.x) clash
Date: Tue, 9 Apr 2002 12:49:36 +0100 (BST)
On Mon, 8 Apr 2002, Johnny C. Lam wrote:
> On Thu, Apr 04, 2002 at 05:50:56PM +0100, netbsd@precedence.co.uk wrote:
> >
> > A slightly neater temporary solution would be to add a libmcrypt22 package
> > which installs 2.2.7 instead of 2.4.x and then make php4-mcrypt depend on
> > that (and register a clash with libmcrypt).
>
> The best solution is to see if updating the libmcrypt package will fix
> this problem (both 2.4.22 and 2.5.0 have been released since our package
> was last updated). If that fails, then I think I'll modify the php4-imap
> pkgsrc to download and to build a libmcrypt_pic.a that contains the main
> library routines and all of the crypto extensions then link the whole
> archive with the PHP4 mcrypt.so.
I've not updated the libmcrypt package, but I have manually installed
2.4.22 and 2.5.0 and built up php4-mcrypt from that (in the same way as I
did with 2.2.7). This gives different symptoms. The httpd processes just
hang when doing any imap. The child httpd does not die (i.e. the TCP
connection is still up and the browser just thinks it's waiting for data).
> > None of these workarounds solve the core problem: PHP mcrypt module based on
> > libmcrypt 2.4 doesn't work with imap PHP module.
>
> This looks to be a problem with the libmcrypt library, so I don't think this
> is a pkgsrc issue unless someones comes up with a patch to the library to
> properly fix this.
No, I don't think it is a pkgsrc-specific problem, but it is a problem
with packages we currently have in there.
--
Stephen
From: Johnny Lam <jlam@jgrind.org>
To: Stephen Borrill <netbsd@precedence.co.uk>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/16198: php4-imap and php4-mcrypt (libmcrypt 2.4.x) clash
Date: Tue, 9 Apr 2002 06:05:29 -0700
On Tue, Apr 09, 2002 at 12:49:36PM +0100, Stephen Borrill wrote:
> On Mon, 8 Apr 2002, Johnny C. Lam wrote:
> >
> > The best solution is to see if updating the libmcrypt package will fix
> > this problem (both 2.4.22 and 2.5.0 have been released since our package
> > was last updated). If that fails, then I think I'll modify the php4-imap
> > pkgsrc to download and to build a libmcrypt_pic.a that contains the main
> > library routines and all of the crypto extensions then link the whole
> > archive with the PHP4 mcrypt.so.
>
> I've not updated the libmcrypt package, but I have manually installed
> 2.4.22 and 2.5.0 and built up php4-mcrypt from that (in the same way as I
> did with 2.2.7). This gives different symptoms. The httpd processes just
> hang when doing any imap. The child httpd does not die (i.e. the TCP
> connection is still up and the browser just thinks it's waiting for data).
Okay, thanks for the information. In this case, I'll go straight to the
last idea (creating libmcrypt_pic.a from the 2.2.7 release).
Cheers,
-- Johnny Lam <jlam@jgrind.org>
State-Changed-From-To: open->feedback
State-Changed-By: jlam
State-Changed-When: Fri Apr 12 12:03:52 PDT 2002
State-Changed-Why:
I've added a security/libmcryp22 package and made php4-mcrypt use it.
Could you please tell me if this fixes your reported problem? Note that
the changes may take a while to propagate to the AnonCVS and SUP servers.
Thanks,
-- Johnny Lam <jlam@netbsd.org>
State-Changed-From-To: feedback->closed
State-Changed-By: jlam
State-Changed-When: Mon Apr 15 06:33:41 PDT 2002
State-Changed-Why:
PR author confirms the problem is fixed. Thanks for the PR!
State-Changed-From-To: closed->analyzed
State-Changed-By: jlam
State-Changed-When: Fri May 24 13:25:06 PDT 2002
State-Changed-Why:
The problem of PHP not working with libmcrypt-2.4.x has come up again with
no good workaround. We need to fix this for real.
State-Changed-From-To: analyzed->feedback
State-Changed-By: jdolecek
State-Changed-When: Sun Aug 31 20:22:10 UTC 2003
State-Changed-Why:
Does this still happen with PHP 4.3.3?
From: Stephen Borrill <netbsd@precedence.co.uk>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/16198
Date: Wed, 5 Nov 2003 10:42:54 +0000 (GMT)
I can confirm that PHP 4.3.3 and libmcrypt 2.5.7 fixes this problem.
State-Changed-From-To: feedback->closed
State-Changed-By: jdolecek
State-Changed-When: Mon Jan 5 11:04:57 UTC 2004
State-Changed-Why:
The problem is apparently fixed with PHP 4.3.3 and libmcrypt 2.5.7.
Thanks for report.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.