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 469852 - [upnp Coherence] crash upon activating plugin
[upnp Coherence] crash upon activating plugin
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: Plugins (other)
HEAD
Other Linux
: Normal critical
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
: 439544 453583 477340 479005 (view as bug list)
Depends on:
Blocks: 482548
 
 
Reported: 2007-08-24 10:05 UTC by Alex Lancaster
Modified: 2007-11-28 23:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rhythmbox-upnp-assert.patch (379 bytes, patch)
2007-09-20 18:19 UTC, Bastien Nocera
committed Details | Review

Description Alex Lancaster 2007-08-24 10:05:31 UTC
Just installed python-Coherence-0.4.0-1.fc7 from Fedora repository and attempted to activate the plugin while a "ushare" instance was running and got a crash immediately:

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1208670496 (LWP 17434)]
[New Thread -1232077936 (LWP 17445)]
0x00110402 in __kernel_vsyscall ()

Thread 1 (Thread -1208670496 (LWP 17434))

  • #0 __kernel_vsyscall
  • #1 waitpid
    from /lib/libpthread.so.0
  • #2 ??
    from /usr/lib/libgnomeui-2.so.0
  • #3 <signal handler called>
  • #4 __kernel_vsyscall
  • #5 raise
    from /lib/libc.so.6
  • #6 abort
    from /lib/libc.so.6
  • #7 __assert_fail
    from /lib/libc.so.6
  • #8 PyGILState_Release
    from /usr/lib/libpython2.5.so.1.0
  • #9 impl_activate
    at rb-python-plugin.c line 128
  • #10 rb_plugin_activate
    at rb-plugin.c line 153
  • #11 rb_plugins_engine_activate_plugin
    at rb-plugins-engine.c line 487
  • #12 plugin_manager_set_active
    at rb-plugin-manager.c line 284
  • #13 plugin_manager_toggle_active
    at rb-plugin-manager.c line 323
  • #14 active_toggled_cb
    at rb-plugin-manager.c line 149
  • #15 g_cclosure_marshal_VOID__STRING
    from /lib/libgobject-2.0.so.0
  • #16 g_closure_invoke
    from /lib/libgobject-2.0.so.0
  • #17 ??
    from /lib/libgobject-2.0.so.0
  • #18 g_signal_emit_valist
    from /lib/libgobject-2.0.so.0
  • #19 g_signal_emit
    from /lib/libgobject-2.0.so.0
  • #20 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #21 gtk_cell_renderer_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #22 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #23 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #24 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #25 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #26 ??
    from /lib/libgobject-2.0.so.0
  • #27 g_closure_invoke
    from /lib/libgobject-2.0.so.0
  • #28 ??
    from /lib/libgobject-2.0.so.0
  • #29 g_signal_emit_valist
    from /lib/libgobject-2.0.so.0
  • #30 g_signal_emit
    from /lib/libgobject-2.0.so.0
  • #31 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #32 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #33 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #34 ??
    from /usr/lib/libgdk-x11-2.0.so.0
  • #35 g_main_context_dispatch
    from /lib/libglib-2.0.so.0
  • #36 ??
    from /lib/libglib-2.0.so.0
  • #37 g_main_loop_run
    from /lib/libglib-2.0.so.0
  • #38 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #39 main
    at main.c line 306
  • #0 __kernel_vsyscall

Comment 1 Alex Lancaster 2007-08-24 10:07:33 UTC
Get the same crash even if no ushare instances are running, here is the console message it prints during the crash:

WARN  coherence                   Aug 24 03:04:58  Coherence UPnP framework version 0.4.0 starting... (coherence/base.py:156)
rhythmbox: Python/pystate.c:610: PyGILState_Release: Assertion `oldstate == PyGILState_UNLOCKED' failed.
Cannot access memory at address 0x445d
Comment 2 Bastien Nocera 2007-08-24 10:51:03 UTC
I believe I've seen the same errors with Epiphany Python (or were they Totem ones?) plugins, but I wouldn't swear by it.
Comment 3 Máirín Duffy 2007-09-19 21:19:40 UTC
I get the same crash, same output. Any ideas on what's going on?
Comment 4 Jonathan Matthew 2007-09-20 11:43:56 UTC
*** Bug 477340 has been marked as a duplicate of this bug. ***
Comment 5 Bastien Nocera 2007-09-20 17:48:59 UTC
Breaking on PyGILState_Ensure and PyGILState_Release, I see:

Breakpoint 2, 0x002cb306 in PyGILState_Ensure () from /usr/lib/libpython2.5.so.1.0
(gdb) bt
  • #0 PyGILState_Ensure
    from /usr/lib/libpython2.5.so.1.0
  • #1 pygobject_new_with_interfaces
    at pygobject.c line 747
  • #2 pygobject_lookup_class
    at pygobject.c line 860
  • #3 pygobject_new_full
    at pygobject.c line 905
  • #4 pygobject_new
    at pygobject.c line 932
  • #5 pyg_value_as_pyobject
    at pygtype.c line 1056
  • #6 pyg_param_gvalue_as_pyobject
    at pygtype.c line 1664
  • #7 PyGProps_getattro
    at pygobject.c line 305
  • #8 PyObject_GetAttr
    from /usr/lib/libpython2.5.so.1.0
  • #9 PyEval_EvalFrameEx
    from /usr/lib/libpython2.5.so.1.0
  • #10 PyEval_EvalCodeEx
    from /usr/lib/libpython2.5.so.1.0
  • #11 ??
    from /usr/lib/libpython2.5.so.1.0
  • #12 PyObject_Call
    from /usr/lib/libpython2.5.so.1.0
  • #13 ??
    from /usr/lib/libpython2.5.so.1.0
  • #14 PyObject_Call
    from /usr/lib/libpython2.5.so.1.0
  • #15 ??
    from /usr/lib/libpython2.5.so.1.0
  • #16 PyObject_CallMethod
    from /usr/lib/libpython2.5.so.1.0
  • #17 call_python_method
    at rb-python-plugin.c line 48
  • #18 impl_activate
    at rb-python-plugin.c line 118
  • #19 rb_plugin_activate
    at rb-plugin.c line 153
  • #20 rb_plugins_engine_activate_plugin
    at rb-plugins-engine.c line 487
  • #21 rb_plugins_engine_load_cb
    at rb-plugins-engine.c line 288
  • #22 rb_uri_handle_recursively_cb
    at rb-file-helpers.c line 873
  • #23 ??
    from /usr/lib/libgnomevfs-2.so.0
  • #24 ??
    from /usr/lib/libgnomevfs-2.so.0
  • #25 gnome_vfs_directory_visit
    from /usr/lib/libgnomevfs-2.so.0
  • #26 rb_uri_handle_recursively
    at rb-file-helpers.c line 901
  • #27 rb_plugins_engine_init
    at rb-plugins-engine.c line 297
  • #28 rb_shell_constructor
    at rb-shell.c line 1360
  • #29 g_object_newv
    from /lib/libgobject-2.0.so.0
  • #30 g_object_new_valist
    from /lib/libgobject-2.0.so.0
  • #31 g_object_new
    from /lib/libgobject-2.0.so.0
  • #32 rb_shell_new
    at rb-shell.c line 951
  • #33 main
    at main.c line 254
  • #0 PyGILState_Release
    from /usr/lib/libpython2.5.so.1.0
  • #1 pygobject_new_with_interfaces
    at pygobject.c line 827
  • #2 pygobject_lookup_class
    at pygobject.c line 860
  • #3 pygobject_new_full
    at pygobject.c line 905
  • #4 pygobject_new
    at pygobject.c line 932
  • #5 pyg_value_as_pyobject
    at pygtype.c line 1056
  • #6 pyg_param_gvalue_as_pyobject
    at pygtype.c line 1664
  • #7 PyGProps_getattro
    at pygobject.c line 305
  • #8 PyObject_GetAttr
    from /usr/lib/libpython2.5.so.1.0
  • #9 PyEval_EvalFrameEx
    from /usr/lib/libpython2.5.so.1.0
  • #10 PyEval_EvalCodeEx
    from /usr/lib/libpython2.5.so.1.0
  • #11 ??
    from /usr/lib/libpython2.5.so.1.0
  • #12 PyObject_Call
    from /usr/lib/libpython2.5.so.1.0
  • #13 ??
    from /usr/lib/libpython2.5.so.1.0
  • #14 PyObject_Call
    from /usr/lib/libpython2.5.so.1.0
  • #15 ??
    from /usr/lib/libpython2.5.so.1.0
  • #16 PyObject_CallMethod
    from /usr/lib/libpython2.5.so.1.0
  • #17 call_python_method
    at rb-python-plugin.c line 48
  • #18 impl_activate
    at rb-python-plugin.c line 118
  • #19 rb_plugin_activate
    at rb-plugin.c line 153
  • #20 rb_plugins_engine_activate_plugin
    at rb-plugins-engine.c line 487
  • #21 rb_plugins_engine_load_cb
    at rb-plugins-engine.c line 288
  • #22 rb_uri_handle_recursively_cb
    at rb-file-helpers.c line 873
  • #23 ??
    from /usr/lib/libgnomevfs-2.so.0
  • #24 ??
    from /usr/lib/libgnomevfs-2.so.0
  • #25 gnome_vfs_directory_visit
    from /usr/lib/libgnomevfs-2.so.0
  • #26 rb_uri_handle_recursively
    at rb-file-helpers.c line 901
  • #27 rb_plugins_engine_init
    at rb-plugins-engine.c line 297
  • #28 rb_shell_constructor
    at rb-shell.c line 1360
  • #29 g_object_newv
    from /lib/libgobject-2.0.so.0
  • #30 g_object_new_valist
    from /lib/libgobject-2.0.so.0
  • #31 g_object_new
    from /lib/libgobject-2.0.so.0
  • #32 rb_shell_new
    at rb-shell.c line 951
  • #33 main
    at main.c line 254

And it will crash afterwards with the second release that doesn't have a matching ensure.

PyGILState_Ensure doesn't seem to be called by pygobject!? Johan, ideas?
Comment 6 Bastien Nocera 2007-09-20 18:01:02 UTC
Looks like threads are being init'ed in pygobject in between the first call to ensure, and the release. Which would mean the first ensure doesn't get called, but the release is.

I'm testing a patch now.
Comment 7 Bastien Nocera 2007-09-20 18:19:04 UTC
Created attachment 95914 [details] [review]
rhythmbox-upnp-assert.patch

That seems to fix it...
Comment 8 Bastien Nocera 2007-09-20 18:26:01 UTC
Packages for Fedora will be at:
http://koji.fedoraproject.org/koji/taskinfo?taskID=167799
Comment 9 Bastien Nocera 2007-09-20 19:21:19 UTC
Seems to work fine, although I probably need a much newer Coherence for it to work with the PS3.
Comment 10 Johan (not receiving bugmail) Dahlin 2007-09-21 00:01:33 UTC
(In reply to comment #7)
> Created an attachment (id=95914) [edit]
> rhythmbox-upnp-assert.patch
> 
> That seems to fix it...
> 

Looks correct, thread support should be initialized as early as possible.
Comment 11 Alex Lancaster 2007-10-05 01:19:57 UTC
Patch fixes the crash, I think ready to apply to SVN trunk.
Comment 12 Jonathan Matthew 2007-10-09 22:55:43 UTC
Apparently we might need to watch out for threading issues in the python bindings, but on the whole this improves the situation and doesn't seem to break anything else.
Comment 13 Bastien Nocera 2007-10-10 09:09:03 UTC
Committed to trunk and 0.10 branch

2007-10-10  Bastien Nocera  <hadess@hadess.net>

        * plugins/rb-python-module.c: (rb_python_module_init_python):
        Fix crash when activating a Python plugin that uses threads,
        the UPNP plugin in this case (Closes: #469852)
Comment 14 Jonathan Matthew 2007-11-28 12:54:42 UTC
*** Bug 439544 has been marked as a duplicate of this bug. ***
Comment 15 Jonathan Matthew 2007-11-28 22:57:25 UTC
*** Bug 453583 has been marked as a duplicate of this bug. ***
Comment 16 Jonathan Matthew 2007-11-28 23:26:30 UTC
*** Bug 479005 has been marked as a duplicate of this bug. ***