[dbus] simple example drawing rect crashes

Bug #615712 reported by joakim@verona.se
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
High
Unassigned

Bug Description

The following simple example used to work in the gsoc dbus branch. It no longer works in the branch, and doesnt work with a dbus enabled trunk build either.

(defun inkscape-test ()
  "Opens inkscape, draws a black rectangle. a dbus compatible
Inkscape needs to be running 1st."
  (let*
    ((desktop (dbus-call-method
               :session "org.inkscape" "/org/inkscape/application"
               "org.inkscape.application" "document_new" ))
     (rect (dbus-call-method
               :session "org.inkscape" desktop
               "org.inkscape.document" "rectangle" :int32 100 :int32 100 :int32 100 :int32 100))
           )))

backtrace:

** (inkscape:20564): CRITICAL **: SPDocument* sp_desktop_document(const SPDesktop*): assertion `desktop != NULL' failed

Program received signal SIGSEGV, Segmentation fault.
dbus_create_node (desk=0x0, type=0x870dc8f "svg:rect") at extension/dbus/document-interface.cpp:192
192 Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
Missing separate debuginfos, use: debuginfo-install GConf2-2.28.1-1.fc13.i686 ImageMagick-6.5.8.10-6.fc13.i686 ImageMagick-c++-6.5.8.10-6.fc13.i686 ORBit2-2.14.18-1.fc13.i686 PackageKit-gtk-module-0.6.6-1.fc13.i686 at-spi-1.30.1-1.fc13.i686 atk-1.30.0-1.fc13.i686 avahi-0.6.25-7.fc13.i686 avahi-glib-0.6.25-7.fc13.i686 bzip2-libs-1.0.5-6.fc12.i686 cairo-1.8.10-1.fc13.i686 cairomm-1.8.4-2.fc13.i686 dbus-glib-0.86-3.fc13.i686 dbus-libs-1.2.24-1.fc13.i686 expat-2.0.1-10.fc13.i686 fontconfig-2.8.0-1.fc13.i686 freetype-2.3.11-3.fc13.i686 gamin-0.1.10-7.fc13.i686 gc-7.2-0.1.alpha4.fc13.i686 glib2-2.24.1-1.fc13.i686 glibc-2.12-3.i686 glibmm24-2.24.1-1.fc13.i686 gnome-vfs2-2.24.3-1.fc13.i686 gsl-1.13-2.fc13.i686 gtk2-2.20.1-1.fc13.i686 gtk2-engines-2.20.1-1.fc13.i686 gtkmm24-2.20.2-1.fc13.i686 gvfs-1.6.2-1.fc13.i686 keyutils-libs-1.2-6.fc12.i686 krb5-libs-1.7.1-10.fc13.i686 lcms-libs-1.19-1.fc13.i686 libICE-1.0.6-2.fc13.i686 libSM-1.1.0-7.fc12.i686 libX11-1.3.1-3.fc13.i686 libXau-1.0.5-1.fc12.i686 libXcomposite-0.4.1-2.fc13.i686 libXcursor-1.1.10-4.fc13.i686 libXdamage-1.1.2-2.fc13.i686 libXext-1.1.2-2.fc13.i686 libXfixes-4.0.4-2.fc13.i686 libXi-1.3-2.fc13.i686 libXinerama-1.1-2.fc13.i686 libXrandr-1.3.0-5.fc13.i686 libXrender-0.9.5-1.fc13.i686 libXt-1.0.7-1.fc13.i686 libbonobo-2.24.2-2.fc13.i686 libcanberra-0.24-1.fc13.i686 libcanberra-gtk2-0.24-1.fc13.i686 libcom_err-1.41.10-7.fc13.i686 libgcc-4.4.4-10.fc13.i686 libgomp-4.4.4-10.fc13.i686 libjpeg-6b-46.fc12.i686 libogg-1.2.0-1.fc13.i686 libpng-1.2.44-1.fc13.i686 libselinux-2.0.90-5.fc13.i686 libsigc++20-2.2.4.2-1.fc12.i686 libstdc++-4.4.4-10.fc13.i686 libtdb-1.2.1-2.fc13.i686 libtiff-3.9.4-1.fc13.i686 libtool-ltdl-2.2.6-20.fc13.i686 libudev-151-10.fc13.i686 libuuid-2.17.2-6.fc13.i686 libvorbis-1.3.1-1.fc13.i686 libxcb-1.5-1.fc13.i686 libxml2-2.7.7-1.fc13.i686 libxslt-1.1.26-1.fc12.i686 openssl-1.0.0a-1.fc13.i686 pango-1.28.0-1.fc13.i686 pangomm-2.26.0-2.fc13.i686 pixman-0.18.0-1.fc13.i686 popt-1.13-7.fc13.i686 zlib-1.2.3-23.fc12.i686
(gdb) bt
#0 dbus_create_node (desk=0x0, type=0x870dc8f "svg:rect") at extension/dbus/document-interface.cpp:192
#1 0x081facc0 in document_interface_rectangle (object=0xb1d1808, x=100, y=100, width=100, height=100, error=0xbffff1d4)
    at extension/dbus/document-interface.cpp:379
#2 0x081f7c44 in dbus_glib_marshal_document_interface_STRING__INT_INT_INT_INT_POINTER (closure=0xbffff154, return_value=0xbffff1a4, n_param_values=6,
    param_values=0x8b58220, invocation_hint=0x0, marshal_data=0x81fac80) at extension/dbus/document-server-glue.h:155
#3 0x04e66149 in ?? () from /usr/lib/libdbus-glib-1.so.2
#4 0x005298b1 in ?? () from /lib/libdbus-1.so.3
#5 0x0051c15a in dbus_connection_dispatch () from /lib/libdbus-1.so.3
#6 0x04e623be in ?? () from /usr/lib/libdbus-glib-1.so.2
#7 0x00d0a525 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#8 0x00d0e268 in ?? () from /lib/libglib-2.0.so.0
#9 0x00d0e7af in g_main_loop_run () from /lib/libglib-2.0.so.0
#10 0x04b025a9 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#11 0x058becf8 in Gtk::Main::run_impl() () from /usr/lib/libgtkmm-2.4.so.1
#12 0x058beae3 in Gtk::Main::run() () from /usr/lib/libgtkmm-2.4.so.1
#13 0x08084abb in sp_main_gui (argc=1, argv=0xbffff724) at main.cpp:983
#14 0x08162c4a in Inkscape::NSApplication::Application::run (this=0xbffff64c) at application/application.cpp:114
#15 0x080824fa in main (argc=1, argv=0xbffff724) at main.cpp:719

Tags: crash dbusapi
Revision history for this message
su_v (suv-lp) wrote :

> It no longer works in the branch (…)

What has changed since? Do you remember after which revision (merge from trunk) things stopped working in the branch or a date (time frame)?
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/gsoc2009_api/changes>

Also, could you please add information about your platform?
Which versions of dbus/dbus-glib bindings/glib did and do you have installed?

tags: added: crash dbus
tags: added: gsoc2009-api
Changed in inkscape:
importance: Undecided → High
Revision history for this message
joakim@verona.se (joakim-verona) wrote :

I have upgraded my machine from fedora 12 to fedora 13, so it is possible that the bug only manifests on F13, but I'm not sure.

Revision history for this message
joakim@verona.se (joakim-verona) wrote :

After looking through the inkscape dbus code, and some d-feet debugging,
I discovered that this call actually works:

(dbus-call-method
               :session "org.inkscape" "/org/inkscape/desktop_0"
               "org.inkscape.document" "rectangle" :int32 200 :int32 100 :int32 100 :int32 100)

which is good!

One of the problems is that the inkscape dbus code is aparently filled
with stubs, which return null, crash, and so on. There is also some form
of mixup what a desktop is supposed to be and a document is supposed to be.

This means that theres seemingly no way for code to know which desktops and documents are available.
desktop_0 seems to be created by default, which I noticed in d-feet.

Revision history for this message
joakim@verona.se (joakim-verona) wrote :

This can be closed now I believe. I haven't had thi crash occur in ages of heavy dbus use.

Revision history for this message
su_v (suv-lp) wrote :

Thank you for the feedback - closing for now as 'Invalid'. Please reopen if the crash reoccurs.

Changed in inkscape:
status: New → Invalid
su_v (suv-lp)
tags: removed: gsoc2009-api
su_v (suv-lp)
tags: added: dbusapi
removed: dbus
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.