Bug 768846

Summary: httpd+mod_perl and BerkeleyDB incompatibility
Product: [Fedora] Fedora Reporter: Alexander Lukyanov <lav>
Component: perl-BerkeleyDBAssignee: Steven Pritchard <steve>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: asaha, jkaluza, jorton, jpazdziora, pahan, paul, perl-devel, pknirsch, ppisar, steve
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-04 07:33:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alexander Lukyanov 2011-12-19 06:10:31 UTC
Description of problem:
httpd is linked with libdb-4.8.so, and perl module BerkeleyDB requires libdb-5.1. This makes impossible usage of BerkeleyDB in mod_perl. The following message is produced in error log:

BerkeleyDB needs compatible versions of libdb & db.h
you have db.h version 5.1.25 and libdb version 4.8.30

Version-Release number of selected component (if applicable):
httpd-2.2.21-1.fc15.x86_64
mod_perl-2.0.4-14.fc15.x86_64
perl-BerkeleyDB-0.43-5.fc15.x86_64

How reproducible:
always

Steps to Reproduce:
1. run a perl script with "use BerkeleyDB" in mod_perl
2. see the error message in error_log
3.
  
Actual results:
error while loading BerkeleyDB module in mod_perl script.

Expected results:
no error.

Additional info:

Comment 1 Joe Orton 2012-03-02 15:14:11 UTC
perl-BerkeleyDB should be linked against libdb-4.8.so, since almost every other consumer of libdb in the distro is using that rather than libdb-5.1.so.  That or we need to switch wholesale to db5.

Doing parallel-installable versions of libdb WITHOUT at least doing symbol versioning is pretty insane, though.

Comment 2 Joe Orton 2012-03-02 15:27:17 UTC
Sorry, wrong package.  In fact perl itself pulls in a different version of libdb to perl-BerkeleyDB.

# ldd /usr/lib64/perl5/auto/DB_File/DB_File.so
	linux-vdso.so.1 =>  (0x00007fff69fff000)
	libdb-4.8.so => /lib64/libdb-4.8.so (0x00007f64e0df9000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f64e0a41000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f64e0824000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003f67c00000	
# ldd /usr/lib64/perl5/vendor_perl/auto/BerkeleyDB/BerkeleyDB.so
	linux-vdso.so.1 =>  (0x00007fffecd33000)
	libdb-5.2.so => /lib64/libdb-5.2.so (0x00007f3110792000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f31103da000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f31101bd000)
	/lib64/ld-linux-x86-64.so.2 (0x0000003f67c00000)
# rpm -q perl perl-BerkeleyDB
perl-5.14.2-195.fc16.x86_64
perl-BerkeleyDB-0.49-2.fc16.x86_64

f18 looks to have the same problem, though.

Comment 3 Paul Howarth 2012-03-07 14:52:16 UTC
(In reply to comment #1)
> perl-BerkeleyDB should be linked against libdb-4.8.so, since almost every other
> consumer of libdb in the distro is using that rather than libdb-5.1.so.  That
> or we need to switch wholesale to db5.

Given that rpm itself is linked against libdb (5) in Fedora ≥ 17, I think a wholesale switch seems appropriate there. Older releases probably need more thought, as there are some important users of libdb such as sendmail on libdb(5) there (see Bug #712943), though well outnumbered by users of libdb(4).

Comment 4 Petr Pisar 2012-04-19 06:58:12 UTC
There is a thread on fedora-devel <http://thread.gmane.org/gmane.linux.redhat.fedora.devel/162863> by Berkley DB maintainer. He wants to make version 5 (libdb) the default one.

I'm going to move perl from db4 to db5 in F18 to see what will happen. I'm not sure it's safe to change the library in stable Fedoras (database format).

Comment 5 Petr Pisar 2012-04-19 08:02:05 UTC
Perl has moved to db5 in perl-5.14.2-215.fc18.

Comment 6 Joe Orton 2012-04-19 09:29:53 UTC
What shall we do about f17?

Is it sufficient to switch only perl-BerkeleyDB back to libdb-4.8?

lots of packages -> libdb-4.8.so
lots of packages -> librpm -> libdb-5.2.so

scares me rather a lot, I am sure there is intersection between those two sets of packages or at least possible combination within a process via perl or python.

Comment 7 Petr Pisar 2012-04-19 10:56:08 UTC
I don't know. If there were no compatibility problems, I would relink as much of possible to db5. Otherwise reverting perl-BerkeleyDB to db4 is the least intrusive change.

Comment 8 Joe Orton 2012-04-19 19:17:32 UTC
In f17 I currently see 56 separate srpms which build binary rpms which depend on db4.8, vs 13 for db5.  It would be simpler to switch *everything* back to db4 and get rid of db5.  Does RPM really require db5?  It is a mess to ship this way.

Comment 9 Paul Howarth 2012-04-19 19:50:56 UTC
(In reply to comment #8)
> In f17 I currently see 56 separate srpms which build binary rpms which depend
> on db4.8, vs 13 for db5.  It would be simpler to switch *everything* back to
> db4 and get rid of db5.  Does RPM really require db5?  It is a mess to ship
> this way.

Can db4.8 use files created by db5? There will be such things on people's systems since f15 (e.g. sendmail maps, cyrus SASL databases), which might present a problem for people upgrading to f17 if these apps are reverted to use db4.

Comment 10 Fedora End Of Life 2012-08-07 18:39:16 UTC
This message is a notice that Fedora 15 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 15. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. At this time, all open bugs with a Fedora 'version'
of '15' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that
we were unable to fix it before Fedora 15 reached end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged to click on
"Clone This Bug" (top right of this page) and open it against that
version of Fedora.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

The process we are following is described here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 11 Jan Pazdziora 2012-08-08 08:07:04 UTC
Reopening. The problem is still present on Fedora 17.

# rpm -q httpd mod_perl perl-BerkeleyDB
httpd-2.2.22-4.fc17.x86_64
mod_perl-2.0.5-8.fc17.x86_64
perl-BerkeleyDB-0.49-3.fc17.x86_64

# service httpd start
Redirecting to /bin/systemctl start  httpd.service

Appended

<Perl>
use BerkeleyDB;
</Perl>

to /etc/httpd/conf.d/perl.conf

# service httpd restart
Redirecting to /bin/systemctl restart  httpd.service
Job failed. See system journal and 'systemctl status' for details.

# systemctl status httpd.service
httpd.service - The Apache HTTP Server (prefork MPM)
	  Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
	  Active: failed (Result: exit-code) since Wed, 08 Aug 2012 10:03:49 +0200; 34s ago
	 Process: 27769 ExecStop=/usr/sbin/httpd $OPTIONS -k stop (code=exited, status=0/SUCCESS)
	 Process: 27772 ExecStart=/usr/sbin/httpd $OPTIONS -k start (code=exited, status=1/FAILURE)
	Main PID: 27747 (code=exited, status=0/SUCCESS)
	  CGroup: name=systemd:/system/httpd.service

Aug 08 10:03:49 ditustat.brq.redhat.com httpd[27772]: Syntax error on line 53 of /etc/httpd/conf.d/perl.conf:
Aug 08 10:03:49 ditustat.brq.redhat.com httpd[27772]: \nBerkeleyDB needs compatible versions of libdb & db.h\n\tyou have db.h version 5.2.36...aborte

Comment 12 Joe Orton 2012-08-09 14:37:25 UTC
Paul's comment 9 is a good point, downgrading perl-BerkeleyDB to db 4.8 as an f17 update will undoubtedly break existing users of the module.  So I think  we're screwed here, we can't fix it until f18.   We could ship an alternative, conflicting version of perl-BerkeleyDB linked against lidb-4.8 if somebody was screaming for that.  But it's probably best to CLOSED->SORRY->NEXTRELEASE this.

Comment 13 Amit Saha 2012-10-04 22:06:38 UTC
Related: Walked straight into this with rpm-libs + httpd  on Fedora 17. rpm-libs is linked against: libdb-5.2.so(), and httpd is linked against libdb-4.8.so(). However, this is not a problem on Fedora 18, since httpd and rpm-libs are linked against libdb-5.3.so().

Comment 14 Fedora End Of Life 2013-07-04 06:32:07 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 15 Jan Pazdziora 2013-07-04 07:33:31 UTC
(In reply to Joe Orton from comment #12)
> Paul's comment 9 is a good point, downgrading perl-BerkeleyDB to db 4.8 as
> an f17 update will undoubtedly break existing users of the module.  So I
> think  we're screwed here, we can't fix it until f18.   We could ship an
> alternative, conflicting version of perl-BerkeleyDB linked against lidb-4.8
> if somebody was screaming for that.  But it's probably best to
> CLOSED->SORRY->NEXTRELEASE this.

Yes, I confirm that with Fedora 19 and the packages listed below, the problem is gone.

# rpm -q httpd mod_perl perl-BerkeleyDB
httpd-2.4.4-6.fc19.x86_64
mod_perl-2.0.7-12.20130221svn1448242.fc19.x86_64
perl-BerkeleyDB-0.51-4.fc19.x86_64