Ticket #144 (defect)

Opened 1 year ago

Last modified 1 year ago

notifaction-daemon closes when passed variant string instead of variant integer from perl Net::DBus

Status: new

Reported by: tehmoth Assigned to: chipx86
Priority: high Milestone: notification-daemon 1.0
Component: notification-daemon Version:
Severity: major Keywords: dbus,perl,notify
Cc: D-BUS Version:
Patch Included: 0 OS/Distro Version:

When running the PerlNotificationsExample at http://trac.galago-project.org/wiki/PerlNotificationsExample the line $notificationId = $notificationsObject->Notify(shift, 0, , 'Sample summary', 'Sample body', [sample => 'Sample action'], {x => 100, y => 100}, -1); sends x and y as 'variant string' instead of 'variant int32' which breaks notification-daemon on daemon.c line 873's call to g_value_get_int (expecting an integer, getting a string)

gdb output: (gdb) run Starting program: /usr/local/libexec/notification-daemon

GLib-GObject-CRITICAL **: g_value_get_int: assertion `G_VALUE_HOLDS_INT (value)' failed aborting...

Program received signal SIGABRT, Aborted.

(gdb) bt #0 0x0318ccbd in kill () from /usr/lib/libc.so.41.0 #1 0x031d0d77 in abort () at /usr/src/lib/libc/stdlib/abort.c:65 #2 0x04c3fce7 in g_logv () from /usr/local/lib/libglib-2.0.so.1200.12 #3 0x04c3fd0b in g_log () from /usr/local/lib/libglib-2.0.so.1200.12 #4 0x04c3fd56 in g_return_if_fail_warning () from /usr/local/lib/libglib-2.0.so.1200.12 #5 0x00d8d557 in g_value_get_int () from /usr/local/lib/libgobject-2.0.so.1200.12 #6 0x1c003dd1 in notify_daemon_notify_handler (daemon=0x7ef603b0, app_name=0x813eb360 "", id=0, icon=0x813eb370 "", summary=0x813eb380 "Sample summary",

body=0x813eb390 "Sample body", actions=0x7e776e80, hints=0x83c528a0, timeout=-1, context=0x813eb290) at daemon.c:873 #7 0x1c002b26 in dbus_glib_marshal_notification_daemon_VOIDSTRING_UINT_STRING_STRING_STRING_BOXED_BOXED_INT_POINTER (closure=0xcfbfcb60, return_value=0x0, n_param_values=10, param_values=0x84090800, invocation_hint=0x0, marshal_data=0x1c003c50) at notificationdaemon-dbus-glue.h:100 #8 0x03ca0681 in dbus_g_bus_get () from /usr/local/lib/libdbus-glib-1.so.3.0 #9 0x03ca0e15 in dbus_g_bus_get () from /usr/local/lib/libdbus-glib-1.so.3.0 #10 0x0e7d16d9 in dbus_get_local_machine_id () from /usr/local/lib/libdbus-1.so.6.0 #11 0x0e7c68a0 in dbus_connection_dispatch () from /usr/local/lib/libdbus-1.so.6.0 #12 0x03c9e4e4 in dbus_g_message_get_message () from /usr/local/lib/libdbus-glib-1.so.3.0 #13 0x04c383fb in g_source_is_destroyed () from /usr/local/lib/libglib-2.0.so.1200.12 #14 0x04c393e5 in g_main_context_dispatch () from /usr/local/lib/libglib-2.0.so.1200.12 #15 0x04c3970a in g_main_context_dispatch () from /usr/local/lib/libglib-2.0.so.1200.12 #16 0x04c39c16 in g_main_loop_run () from /usr/local/lib/libglib-2.0.so.1200.12 #17 0x05d5d6e3 in gtk_main () from /usr/local/lib/libgtk-x11-2.0.so.1000.13 #18 0x1c0043e0 in main (argc=1, argv=0xcfbfcecc) at daemon.c:1122

dbus-monitor output for running the example perl code: method call sender=:1.65 -> dest=org.freedesktop.Notifications path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify

string "" uint32 0 string "" string "Sample summary" string "Sample body" array [

string "sample" string "Sample action"

] array [

dict entry(

string "y" variant string "100"

) dict entry(

string "x" variant string "100"

)

] int32 -1

dbus-monitor output for running the equivalent python code (which doesn't have the same method call sender=:1.67 -> dest=:1.66 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify

string "foo.py" uint32 0 string "" string "Sample summary" string "Sample body" array [

string "sample" string "Sample action"

] array [

dict entry(

string "y" variant int32 100

) dict entry(

string "x" variant int32 100

)

] int32 -1

Change History

09/19/07 15:19:07: Modified by chipx86

This should be fixed in notification-daemon SVN. Can you check?

10/25/07 07:50:46: Modified by tehmoth

no, the SVN version doesn't seem to fix it. I didn't see a commit modifying the code in notify_daemon_notify_handler in regards to type checking the "x" and "y" parameters either. Is revision 2994 the last revision for src/daemon/daemon.c?