Issue 3188 - slapd (back-bdb) crashing during high modify load
Summary: slapd (back-bdb) crashing during high modify load
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-15 16:42 UTC by Ralf
Modified: 2014-08-01 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Ralf 2004-06-15 16:42:14 UTC
Full_Name: Ralf Haferkamp
Version: 2.2.X, HEAD
OS: Linux (Kernel 2.6)
URL: ftp://ftp.openldap.org/incoming/ralf-haferkamp-040615-bdbcache.dif
Submission from: (NULL) (212.95.103.53)


I ran a test with about 20 concurrent clients all modifying (replacing) the same
Attribute of the same entry. During this test slapd segfaulted in
bdb_modify_internal(). Different debugging sessions showed that it always
segfaulted when accessing save_attrs struct.

Also in the log I could always see  "bdb_cache_entry_db_relock entry 225, rw 1,
rc -30995" shorlty before the crash ( -30995 is DB_LOCK_DEADLOCK ).

bdb_cache_entry_db_relock is called be bdb_cache_modify() which is ignoring this
error code and seems to free the struct that save_attrs is pointing to. 

I uploaded a small patch that fixes the problem for me. I am not quite sure it
is completely correct though.

Comment 1 Kurt Zeilenga 2004-06-15 17:00:07 UTC
changed state Open to Feedback
moved from Incoming to Software Bugs
Comment 2 Kurt Zeilenga 2004-06-15 17:05:51 UTC
This suggested fix appears correct to me.  I am testing it now
and will, if all goes well, commit it to HEAD later today.

Thanks, Kurt

At 09:42 AM 6/15/2004, rhafer@suse.de wrote:
>Full_Name: Ralf Haferkamp
>Version: 2.2.X, HEAD
>OS: Linux (Kernel 2.6)
>URL: ftp://ftp.openldap.org/incoming/ralf-haferkamp-040615-bdbcache.dif
>Submission from: (NULL) (212.95.103.53)
>
>
>I ran a test with about 20 concurrent clients all modifying (replacing) the same
>Attribute of the same entry. During this test slapd segfaulted in
>bdb_modify_internal(). Different debugging sessions showed that it always
>segfaulted when accessing save_attrs struct.
>
>Also in the log I could always see  "bdb_cache_entry_db_relock entry 225, rw 1,
>rc -30995" shorlty before the crash ( -30995 is DB_LOCK_DEADLOCK ).
>
>bdb_cache_entry_db_relock is called be bdb_cache_modify() which is ignoring this
>error code and seems to free the struct that save_attrs is pointing to. 
>
>I uploaded a small patch that fixes the problem for me. I am not quite sure it
>is completely correct though.

Comment 3 Howard Chu 2004-06-15 17:25:35 UTC
rhafer@suse.de wrote:

> I ran a test with about 20 concurrent clients all modifying (replacing) the same
> Attribute of the same entry. During this test slapd segfaulted in
> bdb_modify_internal(). Different debugging sessions showed that it always
> segfaulted when accessing save_attrs struct.
> 
> Also in the log I could always see  "bdb_cache_entry_db_relock entry 225, rw 1,
> rc -30995" shorlty before the crash ( -30995 is DB_LOCK_DEADLOCK ).
> 
> bdb_cache_entry_db_relock is called be bdb_cache_modify() which is ignoring this
> error code and seems to free the struct that save_attrs is pointing to. 
> 
> I uploaded a small patch that fixes the problem for me. I am not quite sure it
> is completely correct though.

Looks like a good catch. Probably the same fix is needed for modrdn and 
delete. I'll take another look.
-- 
   -- Howard Chu
   Chief Architect, Symas Corp.       Director, Highland Sun
   http://www.symas.com               http://highlandsun.com/hyc
   Symas: Premier OpenSource Development and Support

Comment 4 Kurt Zeilenga 2004-06-16 16:57:32 UTC
changed state Feedback to Test
Comment 5 Kurt Zeilenga 2004-06-16 22:04:08 UTC
Fixes (yours+howard's) have been committed to HEAD and
OPENLDAP_REL_ENG_2_2.  Please test.  Thanks, Kurt

At 09:42 AM 6/15/2004, rhafer@suse.de wrote:
>Full_Name: Ralf Haferkamp
>Version: 2.2.X, HEAD
>OS: Linux (Kernel 2.6)
>URL: ftp://ftp.openldap.org/incoming/ralf-haferkamp-040615-bdbcache.dif
>Submission from: (NULL) (212.95.103.53)
>
>
>I ran a test with about 20 concurrent clients all modifying (replacing) the same
>Attribute of the same entry. During this test slapd segfaulted in
>bdb_modify_internal(). Different debugging sessions showed that it always
>segfaulted when accessing save_attrs struct.
>
>Also in the log I could always see  "bdb_cache_entry_db_relock entry 225, rw 1,
>rc -30995" shorlty before the crash ( -30995 is DB_LOCK_DEADLOCK ).
>
>bdb_cache_entry_db_relock is called be bdb_cache_modify() which is ignoring this
>error code and seems to free the struct that save_attrs is pointing to. 
>
>I uploaded a small patch that fixes the problem for me. I am not quite sure it
>is completely correct though.

Comment 6 Kurt Zeilenga 2004-06-16 22:46:33 UTC
changed notes
changed state Test to Release
Comment 7 Ralf 2004-06-17 07:58:47 UTC
On Thursday 17 June 2004 00:03, Kurt@OpenLDAP.org wrote:
> Fixes (yours+howard's) have been committed to HEAD and
> OPENLDAP_REL_ENG_2_2.  Please test.  Thanks, Kurt
I reran my testcase again and it works for me now.

-- 
Thanks,
    Ralf

Comment 8 Kurt Zeilenga 2004-06-17 23:42:36 UTC
changed state Release to Closed
Comment 9 Howard Chu 2009-02-17 05:05:55 UTC
moved from Software Bugs to Archive.Software Bugs
Comment 10 OpenLDAP project 2014-08-01 21:06:32 UTC
fixed in HEAD/re22?