[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#591891: libdbus-ocaml-dev: Possible conflict between 2 OCaml bindings: dBus and ssl



Hello,

This is clearly a bug of ocaml-ssl.
Here is a minimal reproducer:

let () =
  Ssl_threads.init ();
  Ssl.init ();
  ignore (Ssl.create_context Ssl.TLSv1 Ssl.Client_context);
  Gc.compact ();
  ()

Compile with:

  ocamlfind ocamlopt -linkpkg -thread -package ssl q.ml -o q

After looking at backtrace the cause is obvious:

#0  0xb774f424 in __kernel_vsyscall ()
#1  0xb7585f7f in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i686/cmov/libpthread.so.0
#2  0x0805da39 in caml_thread_leave_blocking_section ()
#3  0x0806405b in caml_leave_blocking_section ()
#4  0x0805c7af in locking_function ()
#5  0xb76279f5 in CRYPTO_lock () from /usr/lib/i686/cmov/libcrypto.so.0.9.8
#6  0xb7627a96 in CRYPTO_add_lock () from /usr/lib/i686/cmov/libcrypto.so.0.9.8
#7  0xb75c9397 in SSL_CTX_free () from /usr/lib/i686/cmov/libssl.so.0.9.8
#8  0x0805c490 in finalize_ctx ()
#9  0x08065524 in sweep_slice ()
#10 0x080655cc in caml_finish_major_cycle ()
#11 0x0806dd3d in caml_gc_compaction ()
#12 0x0804d421 in camlQ__entry ()
#13 0x00000001 in ?? ()
#14 0x0804cc8d in caml_program ()
#15 0x08071802 in caml_start_program ()
#16 0x00000000 in ?? ()

The ocaml runtime lock is not recursive and reacquiring it from the finalizer is not the good idea :)

-- 
 ygrek
 http://ygrek.org.ua/



Reply to: