Bug 829432

Summary: Slapd crashes when running modrdn operations for 10000 users with groups.
Product: Red Hat Enterprise Linux 7 Reporter: Sankar Ramalingam <sramling>
Component: 389-ds-baseAssignee: Rich Megginson <rmeggins>
Status: CLOSED CURRENTRELEASE QA Contact: Sankar Ramalingam <sramling>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: edewata, jgalipea, nhosoi, nkinder, rmeggins
Target Milestone: rc   
Target Release: 7.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 389-ds-base-1.3.1.2-1.el7 Doc Type: Bug Fix
Doc Text:
Cause: Deleting backend code ldbm_instance_delete_instance_entry_callback had no checking for the ordinary operations accessing the backend instance. Consequence: Even if some operations are still in progress, the backend instance could be deleted and it crashes the server. Fix: Added a reference counter to the backend and if the backend is in use, delete returns 0. Result: Backend deletion fails if the backend is still being used and it does not crash the server.
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 10:39:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Complete stack trace for the crash none

Description Sankar Ramalingam 2012-06-06 17:51:40 UTC
Created attachment 589970 [details]
Complete stack trace for the crash

Description of problem: slapd crashes while running subtree renames stress tests.
I observed this crash after successful modrdn operations and ldapsearch command.


Version-Release number of selected component (if applicable): 389-ds-base-1.2.10.2


How reproducible: Consistently.


Steps to Reproduce:
1. Install 389-ds-base 1.2.10.2 or latest.
2. Enable debug repos and run "debuginfo-install 389-ds-base" to install debuginfo packages to analyze the core.PID files.
Refer - http://port389.org/wiki/FAQ#Debugging_Crashes
3. From TET RHEL63 branch, run the stress tests for subtree renames. Choose only stress_03_02 test. Remove the cleanup(ic9) test from iclist.
4. It takes about 2 to 3 hrs to complete the stress test. In the end, you will see the test PASS.
5. Check whether slapd instance is running. If slapd is not running, then the server crashed.
6. Check for the core file under /var/log/dirsrv/slapd-$inst/core.$PID.
  
Actual results: Slapd crashed and core files generated.

Expected results: Slapd shouldn't crash.


Additional info: Stress test report - 
http://hp-z600-01.rhts.eng.bos.redhat.com/qa/archive/ds/90/stress_ds90/Linux/20120605-104757.html

Comment 1 Rich Megginson 2012-06-06 21:25:12 UTC
The stack trace shows that slapd is crashing when an external client sends an operation to remove databases while there are still search and update operations are in progress.  While the server should not crash, this is an uncommon operation and customers are not likely to run into this situation.  Therefore, I'm moving this bug to 6.4.

You said you did not run the cleanup part of the test, yet usually the databases are removed as part of the cleanup?  What's going on here?

Comment 3 Rich Megginson 2012-06-20 20:51:42 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/391

Comment 6 Rich Megginson 2013-10-01 23:27:11 UTC
moving all ON_QA bugs to MODIFIED in order to add them to the errata (can't add bugs in the ON_QA state to an errata).  When the errata is created, the bugs should be automatically moved back to ON_QA.

Comment 8 Sankar Ramalingam 2013-11-11 12:54:42 UTC
To reproduce the problem mentioned, I executed stress tests for subtree renames. There are few error messages in the logs as Cannot allocate memory. However, I didn't encounter any server crash. Please advise.

[11/Nov/2013:07:02:36 -0500] - libdb: BDB2055 Lock table is out of available lock entries
[11/Nov/2013:07:02:36 -0500] id2entry - db error 12 (Cannot allocate memory)
[11/Nov/2013:07:02:36 -0500] - libdb: BDB2055 Lock table is out of available lock entries
[11/Nov/2013:07:02:36 -0500] id2entry - db error 12 (Cannot allocate memory)
[11/Nov/2013:07:02:36 -0500] - libdb: BDB2055 Lock table is out of available lock entries
[11/Nov/2013:07:02:36 -0500] id2entry - db error 12 (Cannot allocate memory)
[11/Nov/2013:07:02:36 -0500] - libdb: BDB2055 Lock table is out of available lock entries
[11/Nov/2013:07:02:36 -0500] id2entry - db error 12 (Cannot allocate memory)
[11/Nov/2013:07:02:36 -0500] - libdb: BDB2055 Lock table is out of available lock entries
[11/Nov/2013:07:02:36 -0500] - modrdn_rename_entry_update_indexes: id2entry_add failed, err=12 Cannot allocate memory
[11/Nov/2013:07:04:02 -0500] - ldbm: Bringing stress_03_02_DBusr offline...
[11/Nov/2013:07:04:02 -0500] - ldbm: removing 'stress_03_02_DBusr'.
[11/Nov/2013:07:04:02 -0500] - Destructor for instance stress_03_02_DBusr called

Comment 9 Noriko Hosoi 2013-11-11 17:54:21 UTC
The default lock table size is 10000.

Could you try re-running the test with this config param?
dn: cn=config,cn=ldbm database,cn=plugins,cn=config
nsslapd-db-locks: 20000

Comment 10 Sankar Ramalingam 2013-11-11 18:08:01 UTC
(In reply to Noriko Hosoi from comment #9)
> The default lock table size is 10000.
> 
> Could you try re-running the test with this config param?
> dn: cn=config,cn=ldbm database,cn=plugins,cn=config
> nsslapd-db-locks: 20000

I will go ahead and mark the bug as Verified since that original crash issue is fixed. If needed, I will open a new bugzilla.

Comment 11 Sankar Ramalingam 2013-11-18 06:17:59 UTC
Testcase is automated in subtree rename stress test suite.

Comment 12 Ludek Smid 2014-06-13 10:39:45 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.