[Date Prev][Date Next] [Chronological] [Thread] [Top]

unexpected exit when freeing handle after a LDAP_SERVER_DOWN error

Hi !
First, I want to apologize for those who have already read the post I did in the software mailing list. I try this list because I've almost no feedback and this list is in fact more appropriate to report my problem.
So, here it is :
I'm using the OpenLDAP C API (2.0.15) to connect to LDAP servers to perform authentication. I establish a permanent connection and then sends search requests each time I need to authenticate a user. Sometimes, especially when the server is stopped, I receive the LDAP_SERVER_DOWN error as result of my search request. I then have a handle on the broken connection that I need to free in order to avoid memory leaks. When I wrote my code, I first used ldap_unbind() but my program exited from time to time in this function. So I replaced this call by ldap_ld_free() which worked perfectly well so far.
Now I have to deal with TLS connections and even with ldap_ld_free, my program exits, and every time. I used a debugger and here is where the program exits :
#0  0xef33eaac in nvmatch ()
#1  0xef33ea70 in getenv ()
#2  0xef31bae8 in dcgettext_u ()
#3  0xef31ba50 in dgettext ()
#4  0xef749280 in sb_debug_write (sbiod=0x5185c8, buf=0x0, len=29) at sockbuf.c:840
#5  0xef785dd8 in sb_tls_bio_write (b=0x512f10, buf=0x531168 "\025\003\001", len=29) at tls.c:498
#6  0xef5ee4b8 in BIO_write ()
#7  0xef6ff298 in ssl3_write_pending ()
#8  0xef6fe570 in do_ssl3_write ()
#9  0xef6ff024 in ssl3_dispatch_alert ()
#10 0xef6fefdc in ssl3_send_alert ()
#11 0xef6fca3c in ssl3_shutdown ()
#12 0xef705a1c in SSL_shutdown ()
#13 0xef7859a4 in sb_tls_close (sbiod=0x518190) at tls.c:347
#14 0xef7482d4 in ber_int_sb_close (sb=0x512710) at sockbuf.c:364
#15 0xef747938 in ber_sockbuf_free (sb=0x512710) at sockbuf.c:61
#16 0xef775bb4 in ldap_ld_free (ld=0x51de30, close=0, sctrls=0x0, cctrls=0x0) at unbind.c:142

If anyone knows something about this problem, please contact me. Or just let me know if I need to report it as IT.
Thanks in advance,
Virginie Seltrecht.