Bug 2004825 - libdb update in rawhide breaks other packages
Summary: libdb update in rawhide breaks other packages
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libdb
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Filip Januš
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: OpenSSL3.0
TreeView+ depends on / blocked
 
Reported: 2021-09-16 07:08 UTC by Mattias Ellert
Modified: 2021-11-03 09:30 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-11-03 09:30:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
The possibly intended patch (663 bytes, application/octet-stream)
2021-09-16 07:08 UTC, Mattias Ellert
no flags Details

Description Mattias Ellert 2021-09-16 07:08:38 UTC
Created attachment 1823531 [details]
The possibly intended patch

Description of problem:

As reported in the corresponding Bodhi updates:

F36: https://bodhi.fedoraproject.org/updates/FEDORA-2021-d6e603fa20
F35: https://bodhi.fedoraproject.org/updates/FEDORA-2021-f0e003a376
F34: https://bodhi.fedoraproject.org/updates/FEDORA-2021-29ab43c382

these updates break at least two other packages (freeipa, nordugrid-arc).

Due to the negative karma, the F35 and F34 updates will (hopefully) not be pushed to stable. But the F36/rawhide update is causing problems.

The libdb update in rawhide breaks the build of nordugrid-arc, because it causes one of its tests to fail on the ppc64le koji builders. This failure has been confirmed on the ppc64le-test.fedorainfracloud.org test machine.

Here is a link to a scratch build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=75744622

The nordugrid-arc package needs to be rebuilt in rawhide due to the OpenSSL 3.0 migration. So this problem is blocking that.

Version-Release number of selected component (if applicable):

libdb-5.3.28-49.fc36
libdb-5.3.28-49.fc35
libdb-5.3.28-48.fc34

How reproducible:

Always

Steps to Reproduce:
1. Build nordugrid-arc on rowhide for ppc64le

Actual results:
Build failure due to libdb related test failure.

Expected results:
Successful build

Additional info:

This is copied from the comment on the F35 bodhi update:

The descrition for this update is "improve previous patch to cover more cases".

The previouss patch was:

diff -ur db-5.3.28/src/os/os_map.c db-patched/src/os/os_map.c
--- db-5.3.28/src/os/os_map.c   2013-09-09 17:35:09.000000000 +0200
+++ db-patched/src/os/os_map.c  2021-09-06 14:32:28.792139908 +0200
@@ -213,6 +213,10 @@
    if (rp->max < rp->size)
        rp->max = rp->size;
    if (ret == 0 && F_ISSET(infop, REGION_CREATE)) {
+#ifdef HAVE_MLOCK
+       if (F_ISSET(env, ENV_LOCKDOWN))
+           rp->size = rp->max;
+#endif
        if (F_ISSET(dbenv, DB_ENV_REGION_INIT))
            ret = __db_file_write(env, infop->fhp,
                rp->size / MEGABYTE, rp->size % MEGABYTE, 0x00);

The new patch is (after cleaning up unintentional indentation mistakes that makes it longer than necessary):

diff -ur db-5.3.28/src/os/os_map.c db_patch/src/os/os_map.c
--- db-5.3.28/src/os/os_map.c   2013-09-09 17:35:09.000000000 +0200
+++ db_patch/src/os/os_map.c    2021-09-09 07:33:12.027328265 +0200
@@ -213,6 +213,9 @@
    if (rp->max < rp->size)
        rp->max = rp->size;
    if (ret == 0 && F_ISSET(infop, REGION_CREATE)) {
+
+       rp->max = rp->size;
+
        if (F_ISSET(dbenv, DB_ENV_REGION_INIT))
            ret = __db_file_write(env, infop->fhp,
                rp->size / MEGABYTE, rp->size % MEGABYTE, 0x00);

This removes the condition, which is consistent with "to cover more cases". However, it also swaps the assignment from rp->size = rp->max; to rp->max = rp->size;, which was probably unintentional.

Was the patch intended to be:

diff -ur db-5.3.28/src/os/os_map.c db_patch/src/os/os_map.c
--- db-5.3.28/src/os/os_map.c   2013-09-09 17:35:09.000000000 +0200
+++ db_patch/src/os/os_map.c    2021-09-09 07:33:12.027328265 +0200
@@ -213,6 +213,9 @@
    if (rp->max < rp->size)
        rp->max = rp->size;
    if (ret == 0 && F_ISSET(infop, REGION_CREATE)) {
+
+       rp->size = rp->max;
+
        if (F_ISSET(dbenv, DB_ENV_REGION_INIT))
            ret = __db_file_write(env, infop->fhp,
                rp->size / MEGABYTE, rp->size % MEGABYTE, 0x00);


This version of the patch is attached to this bugzilla ticket.

Comment 1 Florence Blanc-Renaud 2021-09-16 07:23:33 UTC
The upgrade breaks ipa server installation and 389ds. The journal shows:

Sep 15 10:05:02 master.ipa.test ns-slapd[28445]: [15/Sep/2021:10:05:02.120286049 +0000] - ERR - libdb - BDB3017 unable to allocate space from the buffer cache
Sep 15 10:05:02 master.ipa.test ns-slapd[28445]: [15/Sep/2021:10:05:02.122250995 +0000] - ERR - bdb_map_error - bdb_public_db_op failed with db error 12 : Cannot allocate memory
Sep 15 10:05:02 master.ipa.test ns-slapd[28445]: [15/Sep/2021:10:05:02.123224659 +0000] - ERR - idl_new_insert_key - idl_new.c BAD 60, err=-12793 Database operation error:  Unhandled Database operation error. See details in previous error messages.
Sep 15 10:05:02 master.ipa.test ns-slapd[28445]: [15/Sep/2021:10:05:02.123951458 +0000] - ERR - addordel_values_sv - database index operation failed BAD 1130, err=-12793 Database operation error:  Unhandled Database operation error. See details in previous error messages.
Sep 15 10:05:02 master.ipa.test ns-slapd[28445]: [15/Sep/2021:10:05:02.126216583 +0000] - ERR - addordel_values_sv - database index operation failed BAD 1140, err=-12793 Database operation error:  Unhandled Database operation error. See details in previous error messages.
Sep 15 10:05:02 master.ipa.test ns-slapd[28445]: [15/Sep/2021:10:05:02.126981929 +0000] - ERR - index_addordel_values_ext_sv - database index operation failed BAD 1250, err=-12793 Database operation error:  Unhandled Database operation error. See details in previous error messages.
Sep 15 10:05:02 master.ipa.test ns-slapd[28445]: [15/Sep/2021:10:05:02.127564042 +0000] - ERR - index_addordel_entry - database index operation failed BAD 1030, err=-12793 Database operation error:  Unhandled Database operation error. See details in previous error messages.

Comment 2 Filip Januš 2021-09-16 08:47:55 UTC
Thanks for your report. I stopped pushing into F34 and F35 and I will take a look at this issue ASAP.

Comment 3 Filip Januš 2021-09-16 12:50:43 UTC
This issue should be fixed now in Rawhide.

Build: https://koji.fedoraproject.org/koji/taskinfo?taskID=75783591

Mattias, I would recommend removing libdb support from your package, because libdb was marked as deprecated and we plan to remove it completely.

Comment 4 Mattias Ellert 2021-09-16 17:11:48 UTC
nordugrid-arc was successfully rebuilt with openssl 3.0 with the updated version of libdb.
https://koji.fedoraproject.org/koji/buildinfo?buildID=1833238

We do support both Berkeley DB and SQLite, and we recommend using SQLite for new installations. However, BDB was the first implementation and SQLite was added later. Changing implementation requires changing the configuration file, and running a database migration tool.

Most servers in production run on RHEL or CentOS using packages from EPEL.

When libdb is dropped from Fedora we can drop the BDB support in Rawhide and only support only SQlite.


Note You need to log in before you can comment on or make changes to this bug.