G_object_unref and ctypes

You are lying to Ctypes about the signature of function g_signal_connect_data and thus passing garbage to it. You should have something like:

let signal_connect app s cb p =
  gobject "g_signal_connect_data" (application @-> string @-> funptr callback_t @-> gpointer @-> gpointer @-> int @-> returning void) app s cb p null 0