openldap icon indicating copy to clipboard operation
openldap copied to clipboard

Close() causes SIGABRT after failing Bind()

Open fredcy opened this issue 11 years ago • 3 comments

If a call to Bind() fails a later call to Close() on the Ldap object causes SIGABRT. I see that Bind() sets self.conn = nil if the ldap_bind_s() call is not successful; why does it do that?

Assertion failed: (ld != NULL), function ldap_unbind_ext, file unbind.c, line 49.
SIGABRT: abort
PC=0x7fff963fc866
signal arrived during cgo execution

runtime.cgocall(0x40016e0, 0x427dd48)
    /usr/local/go/src/pkg/runtime/cgocall.c:149 +0x11b fp=0x427dd30
github.com/mqu/openldap._Cfunc_ldap_unbind(0x0, 0x0)
    github.com/mqu/openldap/_obj/_cgo_defun.c:294 +0x31 fp=0x427dd48
github.com/mqu/openldap.(*Ldap).Close(0xc210000020, 0xf, 0x427df00)
    /Users/fcy/go/src/github.com/mqu/openldap/openldap.go:134 +0x35 fp=0x427dde8
main.main()
    /Users/fcy/go/src/github.com/fredcy/examples/ldap/main.go:41 +0x676 fp=0x427df48
runtime.main()
    /usr/local/go/src/pkg/runtime/proc.c:220 +0x11f fp=0x427dfa0
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1394 fp=0x427dfa8

goroutine 3 [syscall]:
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1394

fredcy avatar Dec 10 '13 21:12 fredcy

Thank you very much for your interest for this projet. Please fork this projet ; I don't use golang any more.

mqu avatar Dec 25 '13 09:12 mqu

Done. Thanks.

fredcy avatar Dec 26 '13 19:12 fredcy

@fredcy I fixed the issue https://github.com/hamano/golang-openldap

hamano avatar May 22 '15 18:05 hamano