This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2229999 - ns-slapd crashs when lmdb import fails or is aborted
Summary: ns-slapd crashs when lmdb import fails or is aborted
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: 389-ds-base
Version: 9.3
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: 9.4
Assignee: Pierre Rogier
QA Contact: LDAP QA Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-08 12:59 UTC by Pierre Rogier
Modified: 2023-09-19 14:19 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-19 14:19:45 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 5846 0 None open Crash when lmdb import is aborted 2023-08-08 13:04:53 UTC
Red Hat Bugzilla 2116948 0 high CLOSED LMDB import is very slow 2023-11-07 09:10:17 UTC
Red Hat Issue Tracker IDMDS-3587 0 None None None 2023-08-28 14:52:46 UTC
Red Hat Issue Tracker   RHEL-5114 0 None Migrated None 2023-09-19 14:19:42 UTC
Red Hat Issue Tracker RHELPLAN-164827 0 None None None 2023-08-08 13:01:53 UTC
Red Hat Issue Tracker RHELPLAN-164828 0 None None None 2023-08-08 13:01:56 UTC

Description Pierre Rogier 2023-08-08 12:59:10 UTC
Description of problem:
The following issue was found while trying to test BZ 2116948 LMDB import is too slow
but configuring a database size too small to hosts the users

After adding a new test case:
diff --git a/dirsrvtests/tests/suites/import/import_test.py b/dirsrvtests/tests/suites/import/import_test.py
index 84c8cf290..ee71e0bea 100644
--- a/dirsrvtests/tests/suites/import/import_test.py
+++ b/dirsrvtests/tests/suites/import/import_test.py
@@ -22,6 +22,7 @@ from lib389.tasks import ImportTask
 from lib389.index import Indexes
 from lib389.monitor import Monitor
 from lib389.backend import Backends
+from lib389.config import LMDB_LDBMConfig
 from lib389.config import LDBMConfig
 from lib389.utils import ds_is_newer, get_default_db_lib
 from lib389.idm.user import UserAccount
@@ -550,6 +551,15 @@ def test_import_wrong_file_path(topo):
         dbtasks_ldif2db(topo.standalone, log, args)
     assert "The LDIF file does not exist" in str(e.value)

+def test_crash_on_ldif2db_with_lmdb(topo, _import_clean):
+    BIG_MAP_SIZE = 20 * 1024 * 1024 * 1024
+    if get_default_db_lib() == "mdb":
+        handler = LMDB_LDBMConfig(topo.standalone)
+        mapsize = BIG_MAP_SIZE
+        log.info(f'Set lmdb map size to {mapsize}.')
+        handler.replace('nsslapd-mdb-max-size', str(mapsize))
+        topo.standalone.restart()
+    _import_offline(topo, 10_000_000)

 if __name__ == '__main__':
     # Run isolated


While running it with mdb, it crashes
NSSLAPD_DB_LIB=mdb py.test -v import_test.py::test_crash_on_ldif2db_with_lmdb

core was not generated, but I attached gdb during the test and then generated the core.

Thread 7 "ns-slapd" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f9269bfa640 (LWP 3924)]
__strncmp_avx2_rtm () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:284
284             VMOVU   (%rdi), %ymm0
(gdb) bt
#0  __strncmp_avx2_rtm () at ../sysdeps/x86_64/multiarch/strcmp-avx2.S:284
#1  0x00007f976d18fb7d in dbmdb_import_prepare_worker_entry (wqelmnt=0x55cd73989a40)
    at ldap/servers/slapd/back-ldbm/db-mdb/mdb_import_threads.c:1347
#2  0x00007f976d1958ce in dbmdb_import_worker (param=<optimized out>)
    at ldap/servers/slapd/back-ldbm/db-mdb/mdb_import_threads.c:3191
#3  0x00007f9770ab4c34 in _pt_root (arg=0x55cd73973dc0) at pthreads/../../../../nspr/pr/src/pthreads/ptthread.c:201
#4  0x00007f977089f822 in start_thread (arg=<optimized out>) at pthread_create.c:443
#5  0x00007f977083f450 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Full backtrace is attached, core is available at https://drive.google.com/file/d/1bGYpP0JuifLKVGdXRVMYj-SkuWCvlnXZ/view?usp=sharing


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

How reproducible:
  Always

Steps to Reproduce:
1. See test case in the description

Actual results:
ns-slapd crashes


Expected results:
ns-slapd should fail without crashing.

Additional info:
Database size should be at least 50 Gb for 10 000 000 users

Crash is caused by a double free when freeing the import pipe line resources.

Comment 1 RHEL Program Management 2023-09-19 14:19:25 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 2 RHEL Program Management 2023-09-19 14:19:45 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.


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