Bug 56917 - mod_php with USE="imap" doesn't load under apache
Bug#: 56917 Product:  Gentoo Linux Version: unspecified Platform: PPC
OS/Version: Linux Status: RESOLVED Severity: critical Priority: P2
Resolution: FIXED Assigned To: ppc@gentoo.org Reported By: tobias@ppckernel.org
Component: Server
URL: 
Summary: mod_php with USE="imap" doesn't load under apache
Keywords:  
Status Whiteboard: 
Opened: 2004-07-13 09:24 0000
Description:   Opened: 2004-07-13 09:24 0000
See below.  I tried remerging and got the same results.  4.3.4-r4 has been
unmerged.  When I remove -D PHP4 from conf.d/apache2, apache runs fine.

Reproducible: Always
Steps to Reproduce:
1. emerge mod_php
2. /etc/init.d/apache2 restart
Actual Results:  
 * Stopping apache2...            [ ok ]
 * Starting apache2...            [ !! ]

Expected Results:  
 * Stopping apache2...            [ ok ]
 * Starting apache2...            [ ok ]

tail /var/log/apache2/error_log:

[Tue Jul 13 09:21:01 2004] [notice] caught SIGTERM, shutting down
Syntax error on line 5 of /usr/lib/apache2/conf/modules.d/70_mod_php.conf:
Cannot load /usr/lib/apache2/extramodules/libphp4.so into server:
/usr/lib/apache2/extramodules/libphp4.so: R_PPC_REL24 relocation at 0x0dba7f40
for symbol `RAND_seed' out of range


emerge info:

Portage 2.0.50-r9 (default-ppc-2004.1, gcc-3.2.3, glibc-2.3.2-r9,
2.4.26-ppc-r2)
=================================================================
System uname: 2.4.26-ppc-r2 ppc 7400, altivec supported
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="ppc"
AUTOCLEAN="yes"
CFLAGS="-O2 -mcpu=7400 -maltivec -mabi=altivec -pipe"
CHOST="powerpc-unknown-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -mcpu=7400 -maltivec -mabi=altivec -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache"
GENTOO_MIRRORS="gentoo.oregonstate.edu"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="altivec apache2 berkdb cups dvd esd foomaticdb gd gdbm gif gpm imap imlib
jpeg libwww mbox mitshm motif mozilla mysql ncurses nls oggvorbis opengl oss
pam
png ppc python readline sasl sdl slang ssl tcpd truetype xml xml2 xv"

------- Comment #1 From Tobias McNulty 2004-07-13 09:59:12 0000 -------
I masked 4.3.7-r1 and remerged 4.3.4-r4, same problem.

------- Comment #2 From Robin Johnson 2004-07-13 10:17:45 0000 -------
go and trace down the RAND_seed symbol on your system and compile it with
-fPIC.

------- Comment #3 From Tobias McNulty 2004-07-15 08:28:37 0000 -------
I tried the previously-working version of apache (2.0.49-r3) with both versions
of PHP, same problem.  I also tried remerging openssl, which I think defines
RAND_seed, same problem.  I just updated to mod_php 4.3.8, same problem.

My system is current except I'm using:
sys-libs/glibc-2.3.2-r9
sys-devel/gcc-3.2.3-r4

Since the current snapshots are known broken.  Please advise - I'm stuck on a
production machine with no PHP.

------- Comment #4 From SpanKY 2004-07-15 08:57:45 0000 -------
RAND_seed comes from openssl i believe ...

------- Comment #5 From Tobias McNulty 2004-07-15 09:01:22 0000 -------
Yes I think so too - any idea why it might be failing on that symbol?
Toby

------- Comment #6 From Tobias McNulty 2004-07-15 13:03:25 0000 -------
mod_php works fine when I set USE="-imap"

Toby

------- Comment #7 From Tobias McNulty 2004-07-15 13:13:42 0000 -------
The problem is that net-libs/c-client is not installed, and it is blocked by
virtual/imap-c-client (provided by net-mail/uw-imap).  How can I get the
symbols supplied by c-client without removing uw-imap?  Is it simply a matter
of telling php with imap to link to the uw-imap-provided c-client?

Toby

------- Comment #8 From Tobias McNulty 2004-07-15 13:35:39 0000 -------
I rebuild uw-imap (the c-client provider) with USE="pic" (position independent
code), in hope of fixing:

R_PPC_REL24 relocation at 0x0dba7f40 for symbol `RAND_seed' out of range

but no luck.  So perhaps PHP/ppc needs to be fixed to link against the PIC code
in uw-imap?

------- Comment #9 From Robin Johnson 2004-07-15 13:49:44 0000 -------
net-libs/c-client  is a stripped down uw-imap, to provide the imap library and
headers ONLY.
if you don't use uw-imap at all, unmerge it and merge c-client instead.
i've definetly made sure the PIC stuff is in c-client.

try to build openssl, c-client, php, mod_php all in sequence with USE="ssl imap
pic"

------- Comment #10 From Tobias McNulty 2004-07-15 14:07:44 0000 -------
I would, but I use uw-imap as my local imapd.  uw-imap is built with pic,
shouldn't that work?  mod_php/imap did work fine before, when I was using the
plain c-client (before I swapped it with uw-imap).

------- Comment #11 From Robin Johnson 2004-07-15 14:53:39 0000 -------
i've added an r3 of uw-imap, with some of the c-client pic stuff ported over.
please try:
USE="ssl pic imap" emerge openssl uw-imap php mod_php

------- Comment #12 From Tobias McNulty 2004-07-15 15:19:57 0000 -------
After emerge sync I don't see net-mail/uw-imap-2002e-r3, even in ~ppc.  Where
can I find it?  I'm rebuilding anyway with the latest stable ebuild (r1).  Let
me know if I need something else, or if this'll use your latest changes.

------- Comment #13 From Robin Johnson 2004-07-15 15:28:02 0000 -------
you'll have to wait for r3 to reach the mirrors. should take 30-90 minutes
depending how busy the various mirror systems are.

------- Comment #14 From Tobias McNulty 2004-07-16 06:45:25 0000 -------
I merged uw-imap-2002e-r3 and then rebuilt mod_php - it worked. Thanks!

It doesn't look like any of those packages USE 'pic' anymore, but it didn't seem to matter.

------- Comment #15 From Robin Johnson 2004-07-16 20:49:07 0000 -------
yeah, PIC support is forced in at the right place for c-client/uw-imap.

------- Comment #16 From Tobias McNulty 2005-01-04 13:38:48 0000 -------
When will this fix be integrated into the main branch?  I just tried merging
uw-imap-2004 with mod_php-4.3.10 and got the same thing.

Thanks,
Toby

------- Comment #17 From Tobias McNulty 2005-01-04 13:50:32 0000 -------
FYI I've been using net-mail/uw-imap-2002e-r3 for 6 months now with absolute
stability.  Whatever change was made I trust can be added to the main branch;
it's rock solid.

------- Comment #18 From Lars Weiler (RETIRED) 2005-01-09 01:11:16 0000 -------
net-mail/uw-imap-2004a is stable on ppc.  Could we close this bug or is there
still a problem?

------- Comment #19 From Tobias McNulty 2005-01-09 07:20:14 0000 -------
Maybe it's marked as stable, but it has the same bug as its "stable"
predecessor, net-mail/uw-imap-2002e-r1 (that's why I reopened this bug).  The
fix I need is:

  15 Jul 2004; Robin H. Johnson <robbat2@gentoo.org> :
  bug #56917, pic stuff.

(from the ChangeLog)

------- Comment #20 From Robin Johnson 2005-02-14 00:12:36 0000 -------
ppc: the amd64 guys did some fixes for c-client and uw-imap.
take a look at them and see if they solve this for you.

------- Comment #21 From Joe Jezak 2005-07-02 11:46:34 0000 -------
This seems fixed for me.  Please reopen the bug if you're still having
problems.

------- Comment #22 From Tobias McNulty 2005-07-03 19:34:40 0000 -------
Yes now that uw-imap-2002e-r3 is marked stable this but is no longer relevant
(r3 is the working version 
I moved to in January).