Bug 244475 - crash at startup with new ldap sdk on 64-bit platform
crash at startup with new ldap sdk on 64-bit platform
Status: CLOSED CURRENTRELEASE
Product: 389
Classification: Community
Component: Directory Server (Show other bugs)
1.1.0
other Other
high Severity high
: ---
: ---
Assigned To: Rich Megginson
Viktor Ashirov
:
Depends On:
Blocks: 240316 FDS1.1.0
  Show dependency treegraph
 
Reported: 2007-06-15 18:13 EDT by Ulf Weltman
Modified: 2015-12-07 11:51 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-07 11:51:03 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Ulf Weltman 2007-06-15 18:13:44 EDT
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 14:02:47 EDT
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 14:47:12 EDT
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 14:57:32 EDT
ulf, how can I reproduce this problem ?
Comment 6 Ulf Weltman 2007-09-06 15:56:21 EDT
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 16:03:10 EDT
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 12:07:05 EDT
Created attachment 190111 [details]
diffs
Comment 9 Rich Megginson 2007-09-07 15:50:42 EDT
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 17:06:42 EDT
Created attachment 221791 [details]
diffs - clean up usage of OPT_DESC
Comment 12 Rich Megginson 2007-10-09 21:56:30 EDT
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.