After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 662919 - dbusservice plugin - Totem crashes when enabled
dbusservice plugin - Totem crashes when enabled
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: general
3.3.x
Other Linux
: High critical
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-10-28 09:22 UTC by Mantas Mikulėnas (grawity)
Modified: 2012-02-06 17:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test plugin that crashes (533 bytes, application/x-compressed-tar)
2012-02-04 15:40 UTC, Mantas Mikulėnas (grawity)
  Details
Add NULL to generated lists (1.20 KB, patch)
2012-02-05 12:38 UTC, Sebastian Pölsterl
needs-work Details | Review
Don't use G_N_ELEMENTS anymore (3.47 KB, patch)
2012-02-05 16:09 UTC, Sebastian Pölsterl
committed Details | Review

Description Mantas Mikulėnas (grawity) 2011-10-28 09:22:05 UTC
When I enable the "DBus Service" plugin, Totem crashes immediately and I have to disable the plugin using dconf-editor.

All Totem prints is "Segmentation fault"; I don't know what to attach other than:

"""
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff60493df in ?? () from /lib/libc.so.6
(gdb) bt
  • #0 ??
    from /lib/libc.so.6
  • #1 PyString_FromString
    from /usr/lib/libpython2.7.so.1.0
  • #2 ??
    from /usr/lib/python2.7/site-packages/gi/_gi.so
  • #3 ??
    from /usr/lib/python2.7/site-packages/gi/_gi.so
  • #4 PyEval_EvalFrameEx
    from /usr/lib/libpython2.7.so.1.0
  • #5 PyEval_EvalCodeEx
    from /usr/lib/libpython2.7.so.1.0
  • #6 PyEval_EvalFrameEx
    from /usr/lib/libpython2.7.so.1.0
  • #7 PyEval_EvalFrameEx
    from /usr/lib/libpython2.7.so.1.0
  • #8 PyEval_EvalCodeEx
    from /usr/lib/libpython2.7.so.1.0
  • #9 function_call
    from /usr/lib/libpython2.7.so.1.0
  • #10 PyObject_Call
    from /usr/lib/libpython2.7.so.1.0
  • #11 PyEval_EvalFrameEx
    from /usr/lib/libpython2.7.so.1.0
  • #12 PyEval_EvalCodeEx
    from /usr/lib/libpython2.7.so.1.0
  • #13 function_call
    from /usr/lib/libpython2.7.so.1.0
  • #14 PyObject_Call
    from /usr/lib/libpython2.7.so.1.0
  • #15 instancemethod_call
    from /usr/lib/libpython2.7.so.1.0
  • #16 PyObject_Call
    from /usr/lib/libpython2.7.so.1.0
  • #17 PyObject_CallFunctionObjArgs
    from /usr/lib/libpython2.7.so.1.0
  • #18 ??
    from /usr/lib/python2.7/site-packages/_dbus_bindings.so
  • #19 ??
    from /usr/lib/python2.7/site-packages/_dbus_bindings.so
  • #20 ??
    from /usr/lib/libdbus-1.so.3
  • #21 dbus_connection_dispatch
    from /usr/lib/libdbus-1.so.3
  • #22 ??
    from /usr/lib/libdbus-glib-1.so.2
  • #23 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #24 ??
    from /usr/lib/libglib-2.0.so.0
  • #25 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #26 gtk_main
    from /usr/lib/libgtk-3.so.0
  • #27 g_application_run
    from /usr/lib/libgio-2.0.so.0
  • #28 main
"""

totem 3.2.1-1 (Arch Linux)
Comment 1 Philip Withnall 2011-10-29 14:07:34 UTC
What versions of pygobject and pygtk do you have installed?

Can you please install debug symbols for Totem, Python, pygobject and pygtk, and reproduce the crash with a more complete stack trace? Thank you.

(Please see http://live.gnome.org/GettingTraces for more information on how to do so.)
Comment 2 Mantas Mikulėnas (grawity) 2011-10-29 15:32:24 UTC
Program received signal SIGSEGV, Segmentation fault.
0x00007fffda242402 in PyString_FromString (str=0x1 <Address 0x1 out of bounds>)
    at Objects/stringobject.c:121
121	    size = strlen(str);
(gdb) bt
  • #0 PyString_FromString
    at Objects/stringobject.c line 121
  • #1 _pygi_marshal_to_py_utf8
    at pygi-marshal-to-py.c line 223
  • #2 _pygi_marshal_to_py_array
    at pygi-marshal-to-py.c line 353
  • #3 _invoke_marshal_out_args
    at pygi-invoke.c line 521
  • #4 _wrap_g_callable_info_invoke
    at pygi-invoke.c line 638
  • #5 PyCFunction_Call
    at Objects/methodobject.c line 85
  • #6 ext_do_call
    at Python/ceval.c line 4323
  • #7 PyEval_EvalFrameEx
    at Python/ceval.c line 2705
  • #8 PyEval_EvalCodeEx
    at Python/ceval.c line 3253
  • #9 fast_function
    at Python/ceval.c line 4109
  • #10 call_function
    at Python/ceval.c line 4034
  • #11 PyEval_EvalFrameEx
    at Python/ceval.c line 2666
  • #12 fast_function
    at Python/ceval.c line 4099
  • #13 call_function
    at Python/ceval.c line 4034
  • #14 PyEval_EvalFrameEx
    at Python/ceval.c line 2666
  • #15 PyEval_EvalCodeEx
    at Python/ceval.c line 3253
  • #16 function_call
    at Objects/funcobject.c line 526
  • #17 PyObject_Call
    at Objects/abstract.c line 2529
  • #18 ext_do_call
    at Python/ceval.c line 4326
  • #19 PyEval_EvalFrameEx
    at Python/ceval.c line 2705
  • #20 PyEval_EvalCodeEx
    at Python/ceval.c line 3253
  • #21 function_call
    at Objects/funcobject.c line 526
  • #22 PyObject_Call
    at Objects/abstract.c line 2529
  • #23 instancemethod_call
    at Objects/classobject.c line 2578
  • #24 PyObject_Call
    at Objects/abstract.c line 2529
  • #25 PyObject_CallFunctionObjArgs
    at Objects/abstract.c line 2760
  • #26 ??
    from /usr/lib/python2.7/site-packages/_dbus_bindings.so
  • #27 ??
    from /usr/lib/python2.7/site-packages/_dbus_bindings.so
  • #28 ??
    from /usr/lib/libdbus-1.so.3
  • #29 dbus_connection_dispatch
    from /usr/lib/libdbus-1.so.3
  • #30 ??
    from /usr/lib/libdbus-glib-1.so.2
  • #31 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #32 ??
    from /usr/lib/libglib-2.0.so.0
  • #33 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #34 gtk_main
    from /usr/lib/libgtk-3.so.0
  • #35 g_application_run
    from /usr/lib/libgio-2.0.so.0
  • #36 main
    at totem.c line 280

python2-gobject 3.0.2-1
python2-gobject2 2.28.6-4
pygtk 2.24.0-2


...Quite strangely, after I rebuilt packages with debug symbols, totem crashed just *once* (in gdb above) and I cannot reproduce this anymore, even with original packages; the plugin now loads fine. Will test more later today.
Comment 3 Mantas Mikulėnas (grawity) 2011-10-29 16:55:30 UTC
Disregard the last comment - I apparently meant "original packages except totem", which I forgot to reinstall. The bug can still be reliably reproduced with original Arch Linux 'totem' package. It turns out that the bug does not appear if I remove all optimization flags from CFLAGS...

Anyway, this should be good:

Program received signal SIGSEGV, Segmentation fault.
0x00007fffda1f141d in PyString_FromString (str=0x1 <Address 0x1 out of bounds>) at Objects/stringobject.c:121
121	    size = strlen(str);
  • #0 PyString_FromString
    at Objects/stringobject.c line 121
  • #1 _pygi_marshal_to_py_utf8
    at pygi-marshal-to-py.c line 223
  • #2 _pygi_marshal_to_py_array
    at pygi-marshal-to-py.c line 353
  • #3 _invoke_marshal_out_args
    at pygi-invoke.c line 521
  • #4 _wrap_g_callable_info_invoke
    at pygi-invoke.c line 638
  • #5 PyCFunction_Call
    at Objects/methodobject.c line 85
  • #6 ext_do_call
    at Python/ceval.c line 4323
  • #7 PyEval_EvalFrameEx
    at Python/ceval.c line 2705
  • #8 PyEval_EvalCodeEx
    at Python/ceval.c line 3253
  • #9 fast_function
    at Python/ceval.c line 4109
  • #10 call_function
    at Python/ceval.c line 4034
  • #11 PyEval_EvalFrameEx
    at Python/ceval.c line 2666
  • #12 fast_function
    at Python/ceval.c line 4099
  • #13 call_function
    at Python/ceval.c line 4034
  • #14 PyEval_EvalFrameEx
    at Python/ceval.c line 2666
  • #15 PyEval_EvalCodeEx
    at Python/ceval.c line 3253
  • #16 function_call
    at Objects/funcobject.c line 526
  • #17 PyObject_Call
    at Objects/abstract.c line 2529
  • #18 ext_do_call
    at Python/ceval.c line 4326
  • #19 PyEval_EvalFrameEx
    at Python/ceval.c line 2705
  • #20 PyEval_EvalCodeEx
    at Python/ceval.c line 3253
  • #21 function_call
    at Objects/funcobject.c line 526
  • #22 PyObject_Call
    at Objects/abstract.c line 2529
  • #23 instancemethod_call
    at Objects/classobject.c line 2578
  • #24 PyObject_Call
    at Objects/abstract.c line 2529
  • #25 PyObject_CallFunctionObjArgs
    at Objects/abstract.c line 2760
  • #26 DBusPyConnection_HandleMessage
    at conn.c line 79
  • #27 _object_path_message
    at conn-methods.c line 117
  • #28 ??
    from /usr/lib/libdbus-1.so.3
  • #29 dbus_connection_dispatch
    from /usr/lib/libdbus-1.so.3
  • #30 ??
    from /usr/lib/libdbus-glib-1.so.2
  • #31 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #32 ??
    from /usr/lib/libglib-2.0.so.0
  • #33 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #34 gtk_main
    from /usr/lib/libgtk-3.so.0
  • #35 g_application_run
    from /usr/lib/libgio-2.0.so.0
  • #36 main
    at totem.c line 280

Comment 4 Philip Withnall 2011-10-31 23:51:16 UTC
At a guess, this is a pygobject bug.
Comment 5 Sebastian Pölsterl 2012-02-04 15:05:05 UTC
Sorry, but I can't reproduce it with Totem 3.2.1 on Fedora 16, could you please try to create a small test which triggers this bug?
Comment 6 Mantas Mikulėnas (grawity) 2012-02-04 15:40:39 UTC
Created attachment 206767 [details]
test plugin that crashes

A mimimal Totem plugin that causes a segfault.
Comment 7 Mantas Mikulėnas (grawity) 2012-02-04 15:41:31 UTC
I don't know what the proper way of "creating tests" is... I did, however, find out that the plugin crashes at totem.get_supported_uri_schemes() on dbusservice.py:177, and, well, see the attached plugin.
Comment 8 Sebastian Pölsterl 2012-02-05 12:38:28 UTC
Created attachment 206820 [details] [review]
Add NULL to generated lists

The issue is that the list by Totem is not NULL-terminated, the attached patch fixes this.
Comment 9 Philip Withnall 2012-02-05 13:39:37 UTC
Review of attachment 206820 [details] [review]:

Good catch, but the locations in Totem's C code which use *mime_types need updating to ignore the NULL element (since they use G_N_ELEMENTS blindly at the moment). *mime_types is used in totem-uri.c, totem-properties-main.c, totem-object.c and totem-audio-preview.c.
Comment 10 Sebastian Pölsterl 2012-02-05 16:09:49 UTC
Created attachment 206850 [details] [review]
Don't use G_N_ELEMENTS anymore
Comment 11 Philip Withnall 2012-02-06 14:03:09 UTC
Review of attachment 206850 [details] [review]:

Looks good to me. Please commit to master. Thanks!
Comment 12 Sebastian Pölsterl 2012-02-06 17:51:04 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.