#50063 ns-slapd - Crash when using bak2db.pl to restore a single database.
Closed: wontfix 5 years ago Opened 5 years ago by mreynolds.

Ticket was cloned from Red Hat Bugzilla (product Red Hat Enterprise Linux 7): Bug 1601241

Description of problem:

RHDS is crashing when trying to use bak2db.pl to restore a single database.


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

# rpm -qa | grep 389-ds-base
389-ds-base-libs-1.3.7.5-24.el7_5.x86_64
389-ds-base-debuginfo-1.3.7.5-24.el7_5.x86_64
389-ds-base-1.3.7.5-24.el7_5.x86_64
#

How reproducible:

Always.

Steps to Reproduce:

1. Start the RHDS instance
# ulimit -c unlimited ; systemctl start dirsrv@<INSTANCE_NAME>

2. Try to restore a single database using bak2db.pl:
# bak2db.pl -Z <INSTANCE_NAME> -D "cn=Directory Manager" -w <PASSWORD> -P LDAP
-a
/var/lib/dirsrv/slapd-<INSTANCE_NAME>/bak/<INSTANCE_NAME>-2018_7_13_15_48_40/
-n userRoot
Successfully added task entry "cn=restore_2018_7_13_18_13_18, cn=restore,
cn=tasks, cn=config"
#


RHDS errors log:
++++++++++++++++++++++++++++++++++++++++++++++++
[13/Jul/2018:18:13:18.414783645 +0200] - INFO - task_restore_thread - Beginning
restore to 'ldbm database'
[13/Jul/2018:18:13:18.418211871 +0200] - INFO - ldbm_back_archive2ldbm -
Bringing userRoot offline...
...
[13/Jul/2018:18:13:18.427815303 +0200] - INFO - dblayer_pre_close - Waiting for
4 database threads to stop
[13/Jul/2018:18:13:18.980252957 +0200] - INFO - dblayer_pre_close - All
database threads now stopped
[13/Jul/2018:18:13:18.994927840 +0200] - NOTICE - dblayer_delete_database_ex -
Skipping instance TekoData
...
++++++++++++++++++++++++++++++++++++++++++++++++


3. A search will fail indicating that the server is down:
# ldapsearch -o ldif-wrap=no -xLLL  -p <PORT> -h <HOST> -b "dc=TekoSoft,dc=com"
-D"cn=Directory Manager" -w <PASSWORD> -sbase 1.1
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
#


Actual results:

ns-slapd crashed.

Stack trace is:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/sbin/ns-slapd -D /etc/dirsrv/slapd-<INSTANCE> -i
/var/run/dirsrv/slapd-inst'.
Program terminated with signal 11, Segmentation fault.
#0  __opendirat (dfd=dfd@entry=-100, name=name@entry=0x0) at
../sysdeps/posix/opendir.c:90
90      if (__builtin_expect (name[0], '\1') == '\0')
(gdb)
(gdb) where
#0  0x00007fcedff6ca10 in __opendirat (dfd=dfd@entry=-100, name=name@entry=0x0)
at ../sysdeps/posix/opendir.c:90
#1  0x00007fcedff6ca6d in __opendir (name=name@entry=0x0) at
../sysdeps/posix/opendir.c:159
#2  0x00007fcee0f5c81c in PR_OpenDir (name=0x0) at
../../../nspr/pr/src/pthreads/ptio.c:3840
#3  0x00007fced6c54754 in dblayer_delete_database_ex
(li=li@entry=0x55970f1d5900, instance=instance@entry=0x55970f595ee0 "userRoot",
cldir=0x0) at ldap/servers/slapd/back-ldbm/dblayer.c:5228
#4  0x00007fced6c54e57 in dblayer_restore (li=0x55970f1d5900,
src_dir=0x55970faff270
"/var/lib/dirsrv/slapd-<INSTANCE>/bak/<INSTANCE>-2018_7_13_15_48_40",
task=0x55970fb31ea0, bename=0x55970f595ee0 "userRoot")
    at ldap/servers/slapd/back-ldbm/dblayer.c:6525
#5  0x00007fced6c468dd in ldbm_back_archive2ldbm (pb=0x55970f59ec60) at
ldap/servers/slapd/back-ldbm/archive.c:165
#6  0x00007fcee31cea86 in task_restore_thread (arg=0x55970f59ec60) at
ldap/servers/slapd/task.c:1622
#7  0x00007fcee0f5dbab in _pt_root (arg=0x55970fb27680) at
../../../nspr/pr/src/pthreads/ptthread.c:201
#8  0x00007fcee08fddd5 in start_thread (arg=0x7fceb439d700) at
pthread_create.c:308
#9  0x00007fcedffaab3d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:113
(gdb)


Expected results:

ns-slapd should not crash.

Additional info:

The script bak2db.pl should not be used to restore a single database, but it also should not crash the server

Metadata Update from @mreynolds:
- Custom field rhbz adjusted to https://bugzilla.redhat.com/show_bug.cgi?id=1601241

5 years ago

Metadata Update from @mreynolds:
- Issue assigned to mreynolds

5 years ago

Metadata Update from @mreynolds:
- Custom field component adjusted to None
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None
- Custom field type adjusted to None
- Custom field version adjusted to None

5 years ago

Metadata Update from @mreynolds:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

5 years ago

Metadata Update from @vashirov:
- Issue set to the milestone: None (was: 0.0 NEEDS_TRIAGE)

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/3122

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: fixed)

3 years ago

Login to comment on this ticket.

Metadata