[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



Package: libdbus-ocaml-dev
Version: 0.29-1build1
Severity: important

Hi !

I think there is a conflict using the DBus binding (libdbus-ocaml-dev) and at the same time the SSL one for OCaml (libssl-ocaml-dev).
Because of the line "Ssl.create_context Ssl.TLSv1 Ssl.Client_context", I can do a first DBus call notification but the second one blocks the whole program. I've only been interested in notification calls.

I attach to this email 3 files so you can test. The "dbus_call.ml" is the code the developper provided as an example.
Before using the DBus binding, I used to make a system call to "notify-send" in my project and it worked.

This has been tested with D-Bus binding 0.29 and SSL binding 0.4.3.
I also sent an email to the developper.

Hope this can help in some ways.

Grégory BELLIER.


-- System Information:
Debian Release: squeeze/sid
  APT prefers karmic-updates
  APT policy: (500, 'karmic-updates'), (500, 'karmic-security'), (500, 'karmic')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-22-generic (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libdbus-ocaml-dev depends on:
ii  libdbus-ocaml               0.29-1build1 OCaml bindings for the D-Bus API
ii  ocaml-nox [ocaml-nox-3.11.1 3.11.1-2     ML implementation with a class-bas

libdbus-ocaml-dev recommends no packages.

libdbus-ocaml-dev suggests no packages.

-- no debconf information
open Unix
open Dbus_call


let _ =
 
  Printf.printf "Two '5' should be printed\n";
  Pervasives.flush Pervasives.stdout;
  
  Ssl_threads.init ();
  Ssl.init ();
  
  ignore (Ssl.create_context Ssl.TLSv1 Ssl.Client_context);
  
  dbusplop "A";       
  dbusplop "B"; 
  
  Printf.printf "Exiting...\n";
  Pervasives.flush Pervasives.stdout;
  exit 0

Attachment: Makefile
Description: Binary data

let print_dbus_ty_list l =
	List.iter (fun o -> Printf.printf "%s\n" (DBus.string_of_ty o)) l
;;

let dbusplop txt =   
  let notif_interface = "org.freedesktop.Notifications" in
  let notif_name = notif_interface in
  let notif_path = "/org/freedesktop/Notifications" in

  let send_msg ~bus ~destination ~path ~intf ~serv ~params =
    let msg = DBus.Message.new_method_call destination path intf serv in
      DBus.Message.append msg params;
      let r = DBus.Connection.send_with_reply_and_block bus msg (-1) in
      let l = DBus.Message.get r in
	l
  in
    Printf.printf "1\n";
    Pervasives.flush Pervasives.stdout;
    let send_notif_msg = send_msg ~destination:notif_name ~path:notif_path ~intf:notif_interface in
      Printf.printf "2\n";
      Pervasives.flush Pervasives.stdout;

      let bus = DBus.Bus.get DBus.Bus.Session in
	Printf.printf "3\n";
	Pervasives.flush Pervasives.stdout;
	let params = [
	  DBus.String "n";
	  DBus.UInt32 1l;
	  DBus.String "x";
	  DBus.String "z";
	  DBus.String txt;
	  DBus.Array (DBus.Strings []);
	  DBus.Array (DBus.Dicts ((DBus.SigString, DBus.SigVariant), []));
	  DBus.Int32 4000l;
	] in	
	  Printf.printf "4\n";
	  Pervasives.flush Pervasives.stdout;
	  let r = send_notif_msg ~bus ~serv:"Notify" ~params in
	  Printf.printf "5\n";
	  Pervasives.flush Pervasives.stdout;
	  print_dbus_ty_list r;
	  ()
;;


Reply to: