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 573179 - Gedit crashes if Python plugin raises exception in __init__
Gedit crashes if Python plugin raises exception in __init__
Status: RESOLVED FIXED
Product: gedit-plugins
Classification: Other
Component: General
2.22.x
Other All
: Normal critical
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2009-02-25 20:07 UTC by Oliver Gerlich
Modified: 2019-03-23 20:46 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20



Description Oliver Gerlich 2009-02-25 20:07:33 UTC
Steps to reproduce:
1. Create a Python plugin which raises an exception in its __init__() method
2. Activate it in the Plugin dialog in Gedit
3. Gedit crashes


Stack trace:
  • #0 PyObject_GetAttrString
    from /usr/lib/libpython2.5.so.1.0
  • #1 PyObject_HasAttrString
    from /usr/lib/libpython2.5.so.1.0
  • #2 ??
  • #3 ??

(Sorry, have no debug packages installed)

Other information:
Here's an example plugin which triggers this:

import gedit
class CrasherTestPlugin(gedit.Plugin):
    def __init__(self):
        raise Exception("test exception")
    def activate(self, window):
        pass
    def deactivate(self, window):
        pass
    def update_ui(self, window):
        pass


For completeness, here's the crasher.gedit-plugin file:

[Gedit Plugin]
Loader=python
Module=crasher
IAge=2
Name=Crasher example
Description=An Example
Authors=Oliver Gerlich
Copyright=None


Last output after activating plugin:

Traceback (most recent call last):
  File "/home/oliver/.gnome2/gedit/plugins/crasher.py", line 6, in __init__
    raise Exception("test exception")
Exception: test exception

The bug occurs at least on Debian Lenny and Ubuntu 8.10.
Comment 1 André Klapper 2009-03-31 17:26:26 UTC
Please install debug packages and provide a good stacktrace.
Comment 2 Oliver Gerlich 2009-04-27 22:13:23 UTC
A backtrace is now available at https://bugs.launchpad.net/gedit/+bug/368262 :

Thread 1 (process 21465)

  • #0 __kernel_vsyscall
  • #1 *__GI_raise
    at ../nptl/sysdeps/unix/sysv/linux/raise.c line 64
  • #2 *__GI_abort
    at abort.c line 88
  • #3 Py_FatalError
    at ../Python/pythonrun.c line 1657
  • #4 collect
    at ../Modules/gcmodule.c line 908
  • #5 PyGC_Collect
    at ../Modules/gcmodule.c line 1292
  • #6 gedit_plugin_loader_iface_garbage_collect
    at gedit-plugin-loader-python.c line 322
  • #7 gedit_plugin_loader_garbage_collect
    at gedit-plugin-loader.c line 130
  • #8 gedit_plugins_engine_deactivate_plugin_real
    at gedit-plugins-engine.c line 659
  • #9 IA__g_cclosure_marshal_VOID__BOXED
    at /build/buildd/glib2.0-2.20.1/gobject/gmarshal.c line 566
  • #10 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.20.1/gobject/gclosure.c line 878
  • #11 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.20.1/gobject/gclosure.c line 767
  • #12 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.20.1/gobject/gsignal.c line 3285
  • #13 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.20.1/gobject/gsignal.c line 2980
  • #14 IA__g_signal_emit
    at /build/buildd/glib2.0-2.20.1/gobject/gsignal.c line 3037
  • #15 gedit_plugins_engine_deactivate_plugin
    at gedit-plugins-engine.c line 676
  • #16 plugin_manager_set_active
    at gedit-plugin-manager.c line 348
  • #17 plugin_manager_toggle_active
    at gedit-plugin-manager.c line 372
  • #18 active_toggled_cb
    at gedit-plugin-manager.c line 228
  • #19 IA__g_cclosure_marshal_VOID__STRING
    at /build/buildd/glib2.0-2.20.1/gobject/gmarshal.c line 496
  • #20 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.20.1/gobject/gclosure.c line 767
  • #21 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.20.1/gobject/gsignal.c line 3247
  • #22 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.20.1/gobject/gsignal.c line 2980
  • #23 IA__g_signal_emit
    at /build/buildd/glib2.0-2.20.1/gobject/gsignal.c line 3037
  • #24 gtk_cell_renderer_toggle_activate
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtkcellrenderertoggle.c line 407
  • #25 IA__gtk_cell_renderer_activate
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtkcellrenderer.c line 621
  • #26 gtk_tree_view_column_cell_process_action
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtktreeviewcolumn.c line 2879
  • #27 _gtk_tree_view_column_cell_event
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtktreeviewcolumn.c line 3156
  • #28 gtk_tree_view_button_press
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtktreeview.c line 2684
  • #29 _gtk_marshal_BOOLEAN__BOXED
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtkmarshalers.c line 84
  • #30 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.20.1/gobject/gclosure.c line 878
  • #31 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.20.1/gobject/gclosure.c line 767
  • #32 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.20.1/gobject/gsignal.c line 3285
  • #33 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.20.1/gobject/gsignal.c line 2990
  • #34 IA__g_signal_emit
    at /build/buildd/glib2.0-2.20.1/gobject/gsignal.c line 3037
  • #35 gtk_widget_event_internal
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtkwidget.c line 4761
  • #36 IA__gtk_propagate_event
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtkmain.c line 2396
  • #37 IA__gtk_main_do_event
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtkmain.c line 1586
  • #38 gdk_event_dispatch
    at /build/buildd/gtk+2.0-2.16.1/gdk/x11/gdkevents-x11.c line 2364
  • #39 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.20.1/glib/gmain.c line 1814
  • #40 g_main_context_iterate
    at /build/buildd/glib2.0-2.20.1/glib/gmain.c line 2448
  • #41 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.20.1/glib/gmain.c line 2656
  • #42 IA__gtk_main
    at /build/buildd/gtk+2.0-2.16.1/gtk/gtkmain.c line 1205
  • #43 main
    at gedit.c line 679

Comment 3 jessevdk@gmail.com 2009-04-28 08:04:09 UTC
This issue was fixed when the new plugin system was introduced.