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

Valgrind reporting an invalid file descriptor

Hello all,

I'm writing an program with LDAP but probably something goes wrong when I try to shutdown the connection.

First I call ldap_initialize, after that I call a bind operation. (Using function ldap_bind_ext) That goes all very well.

Then I try to close the connection with ldap_unbind_ext. This goes according to the return value ok, but when running in valgrind I see a Warning: invalid file descriptor -1 in syscall close()

==4733== Warning: invalid file descriptor -1 in syscall close()
==4733==    at 0x40007F2: (within /lib/ld-2.9.so)
==4733== by 0x4300BB0: ber_int_sb_close (in /usr/lib/liblber-2.4.so. 2.4.1) ==4733== by 0x43011AB: ber_sockbuf_free (in /usr/lib/liblber-2.4.so. 2.4.1) ==4733== by 0x404AEAE: ldap_ld_free (in /usr/lib/libldap_r-2.4.so. 2.4.1) ==4733== by 0x404AF55: ldap_unbind_ext (in /usr/lib/ libldap_r-2.4.so.2.4.1)
==4733==    by 0x804A167: main (ldap.cpp:283)

Is this a bug in the LDAP library, or did I forgot a call to something ? According to the documentation (man 3 ldap_unbind_ext) is this the only call I need to do.

Can somebody enlighten me here ?


Matthijs Mohlmann