Bug 244475 - crash at startup with new ldap sdk on 64-bit platform
Summary: crash at startup with new ldap sdk on 64-bit platform
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Directory Server
Version: 1.1.0
Hardware: other
OS: Other
high
high
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 240316 FDS1.1.0
TreeView+ depends on / blocked
 
Reported: 2007-06-15 22:13 UTC by Ulf Weltman
Modified: 2015-12-07 16:51 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-07 16:51:03 UTC
Embargoed:


Attachments (Terms of Use)
diffs (2.81 KB, patch)
2007-09-07 16:07 UTC, Rich Megginson
no flags Details | Diff
cvs commit log (370 bytes, text/plain)
2007-09-07 19:50 UTC, Rich Megginson
no flags Details
diffs - clean up usage of OPT_DESC (5.66 KB, patch)
2007-10-09 21:06 UTC, Rich Megginson
no flags Details | Diff
cvs commit log (Comment #11) (364 bytes, text/plain)
2007-10-10 01:56 UTC, Rich Megginson
no flags Details

Description Ulf Weltman 2007-06-15 22:13:44 UTC
LDAP SDK's lber.h was updated for LBER_SOCKET to be defined as long instead of
int, I think that might have come as part of the Sun merge:
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=mozilla/directory/c-sdk/ldap/include&command=DIFF_FRAMESET&file=lber.h&rev1=5.3&rev2=5.4&root=/cvsroot

The LBER function io.c:ber_sockbuf_set_option() with LBER_SOCKBUF_OPT_DESC
option expects an LBER_SOCKET passed in, but DS in
conntable.c:connection_table_new() passes in an int.  It seems to be causing a
crash in test builds on HP-UX 11.23 IPF (64-bit).

Comment 3 Rich Megginson 2007-09-06 18:02:47 UTC
I think this issue is resolved.  We've been running HP-UX 11.23 IPF (64-bit)
acceptance tests for quite some time now.  Ulf, can you please confirm?

Comment 4 Ulf Weltman 2007-09-06 18:47:12 UTC
It doesn't look resolved, from conntable.c from the FDS tip:
    65                  int     invalid_socket;
..
    69                  invalid_socket = SLAPD_INVALID_SOCKET;
    70                  ber_sockbuf_set_option( ct->c[i].c_sb, LBER_SOCKBUF_OPT_
DESC, &invalid_socket );

And from LDAP SDK's io.c from tip:
1078 int
1079 LDAP_CALL
1080 ber_sockbuf_set_option( Sockbuf *sb, int option, void *value )
1081 {
..
1136         case LBER_SOCKBUF_OPT_DESC:
1137                 sb->sb_sd = *((LBER_SOCKET *) value);

and lber.h:
138 typedef long LBER_SOCKET;

The SIGBUS "BUS_ADRALN - Invalid address alignment" wasn't happening on all our
hosts, it seemed the OS or libc version affected the behavior.

Comment 5 Chandrasekar Kannan 2007-09-06 18:57:32 UTC
ulf, how can I reproduce this problem ?

Comment 6 Ulf Weltman 2007-09-06 19:56:21 UTC
Simply starting up FDS would cause a crash, but I don't have the host where it
was happening anymore.  I had a small test case that would determine if the host
would have a problem but it was lost with that host.  I'll try to get it back
and see if any of our hosts have the magic combination but I'm not sure how much
it'll help because I don't think you want to mess with OS and libc patch levels
on your QA hosts.

Comment 7 Rich Megginson 2007-09-06 20:03:10 UTC
At any rate, the code is incorrect and will cause a crash sooner or later on
some 64bit platform.

Comment 8 Rich Megginson 2007-09-07 16:07:05 UTC
Created attachment 190111 [details]
diffs

Comment 9 Rich Megginson 2007-09-07 19:50:42 UTC
Created attachment 190391 [details]
cvs commit log

Reviewed by: nkinder (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: Use LBER_SOCKET as the socket type instead of int.  There was
also a place in ldclt where we were doing the same thing.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no

Comment 11 Rich Megginson 2007-10-09 21:06:42 UTC
Created attachment 221791 [details]
diffs - clean up usage of OPT_DESC

Comment 12 Rich Megginson 2007-10-10 01:56:30 UTC
Created attachment 222111 [details]
cvs commit log (Comment #11)

Reviewed by: nkinder (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: I went ahead and cleaned up or removed the incorrect ber code.
 We do not need to use LBER_SOCKBUF_OPT_DESC or LBER_SOCKBUF_OPT_READ_FN or
LBER_SOCKBUF_OPT_WRITE_FN.  I removed an unnecessary malloc/free and just used
the stack as we do everywhere else in the code.  It looks as though the
start_tls cleanup code is almost never used - the code assumes that when you do
a start_tls, that stays in force throughout the lifetime of the connection. 
Removing this code now should insulate us from future ldap c sdk changes.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no


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