Issue 5489 - Assert failed in slapd_clr_write()
Summary: Assert failed in slapd_clr_write()
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: 2008-04-30 19:06 UTC by Rein
Modified: 2014-08-01 21:04 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 Rein 2008-04-30 19:06:36 UTC
Full_Name: Rein Tollevik
Version: CVS head
OS: 
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (81.93.160.250)
Submitted by: rein


We have seen a case where "assert(SLAP_SOCK_IS_ACTIVE(s))" in
slapd_clr_write() failed, see the stack trace at the end.  The
last log message (at loglevel stat) related to the socket was
"fd=657 closed (connection lost on write)".  The comment where
slapd_daemon_task() calls connection_write() makes me believe
that slapd_clr_write() should not have use assert here.  Remove
it or include it as a condition in the following if statement?

Rein Tollevik
Basefarm AS


Program terminated with signal 6, Aborted.
(gdb) where
#0  0xb7fe97a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1  0xb7b777a5 in raise () from /lib/tls/libc.so.6
#2  0xb7b79209 in abort () from /lib/tls/libc.so.6
#3  0xb7b70d91 in __assert_fail () from /lib/tls/libc.so.6
#4  0x0806da8f in slapd_clr_write (s=657, wake=0) at daemon.c:931
#5  0x080726d7 in connection_write (s=657) at connection.c:1814
#6  0x080717bc in slapd_daemon_task (ptr=0x0) at daemon.c:2414
#7  0xb7c80371 in start_thread () from /lib/tls/libpthread.so.0
#8  0xb7c17ffe in clone () from /lib/tls/libc.so.6

Comment 1 Rein 2008-04-30 19:12:37 UTC
moved from Incoming to Software Bugs
Comment 2 Howard Chu 2008-04-30 21:56:50 UTC
rein@OpenLDAP.org wrote:
> Full_Name: Rein Tollevik
> Version: CVS head
> OS:
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (81.93.160.250)
> Submitted by: rein
>
>
> We have seen a case where "assert(SLAP_SOCK_IS_ACTIVE(s))" in
> slapd_clr_write() failed, see the stack trace at the end.  The
> last log message (at loglevel stat) related to the socket was
> "fd=657 closed (connection lost on write)".  The comment where
> slapd_daemon_task() calls connection_write() makes me believe
> that slapd_clr_write() should not have use assert here.  Remove
> it or include it as a condition in the following if statement?

How frequently can you reproduce this? I'm tempted to say move the assert into 
the if (SLAP_SOCK_IS_WRITE()) block, and see if it still triggers.
>
> Rein Tollevik
> Basefarm AS
>
>
> Program terminated with signal 6, Aborted.
> (gdb) where
> #0  0xb7fe97a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
> #1  0xb7b777a5 in raise () from /lib/tls/libc.so.6
> #2  0xb7b79209 in abort () from /lib/tls/libc.so.6
> #3  0xb7b70d91 in __assert_fail () from /lib/tls/libc.so.6
> #4  0x0806da8f in slapd_clr_write (s=657, wake=0) at daemon.c:931
> #5  0x080726d7 in connection_write (s=657) at connection.c:1814
> #6  0x080717bc in slapd_daemon_task (ptr=0x0) at daemon.c:2414
> #7  0xb7c80371 in start_thread () from /lib/tls/libpthread.so.0
> #8  0xb7c17ffe in clone () from /lib/tls/libc.so.6
>
>
>


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 3 Rein 2008-05-02 09:41:44 UTC

On Wed, 30 Apr 2008, hyc@symas.com wrote:

> rein@OpenLDAP.org wrote:

>> We have seen a case where "assert(SLAP_SOCK_IS_ACTIVE(s))" in
>> slapd_clr_write() failed, see the stack trace at the end.  The
>> last log message (at loglevel stat) related to the socket was
>> "fd=657 closed (connection lost on write)".  The comment where
>> slapd_daemon_task() calls connection_write() makes me believe
>> that slapd_clr_write() should not have use assert here.  Remove
>> it or include it as a condition in the following if statement?
>
> How frequently can you reproduce this? I'm tempted to say move the
> assert into the if (SLAP_SOCK_IS_WRITE()) block, and see if it still
> triggers.

This is the only occurrence I have found of this abort, so it is not very 
reproduce able :-(  But the core shows that SLAP_SOCK_IS_WRITE would be 
false (as would SLAP_SOCK_IS_READ), so moving the assert into the if 
block should fix this case.  And asserting a writeable socket is also 
active makes sence to me.

Rein

Comment 4 Howard Chu 2008-05-23 13:29:45 UTC
changed notes
changed state Open to Test
Comment 5 Howard Chu 2008-06-10 20:04:03 UTC
changed notes
changed state Test to Closed
Comment 6 Quanah Gibson-Mount 2008-11-10 16:44:44 UTC
changed notes
Comment 7 OpenLDAP project 2014-08-01 21:04:15 UTC
fixed in HEAD/RE24/RE23