g_dbus_method_invocation_return_value() twice for the same GDBusMethodInvocation explodes randomly
@hughsie
Submitted by Richard Hughes Assigned to David Zeuthen
Link to original bug (#741397)
Description
Due to a bug in my code, I was calling g_dbus_method_invocation_return_value() twice for the same GDBusMethodInvocation on one rarely-used conditional. Rather than asserting (or something else sane) I got semi-random backtraces that looked like:
g_source_callback_unref (cb_data) at gmain.c:1532 g_source_destroy_internal (source, context, have_lock=1) at gmain.c:1178 g_main_context_dispatch (context) at gmain.c:3134
(gdb) p g_source_get_name(source) $1 = '[gio] call_in_idle_cb'
This took me HOURS to track down. Something like g_assert (invocation->has_not_returned_yet) would have been awesome for debugging, rather than poking around with gdb and banging my head against the wall.