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).
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?
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.
ulf, how can I reproduce this problem ?
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.
At any rate, the code is incorrect and will cause a crash sooner or later on some 64bit platform.
Created attachment 190111 [details] diffs
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
Created attachment 221791 [details] diffs - clean up usage of OPT_DESC
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