[gedit-list] Crash when sending messages to Filebrowser plugin



Hey guys,

I'm getting this funky crash when I send the "get_view" message to the Filebrowser plugin. Here is the source of a python plugin I've implemented that reproduces the behavior. The comments in the python code explain exactly how to reproduce the problem.

GEDIT-PLUGIN FILE:

[Gedit Plugin]
Loader=python
Module=fbcrashdemo
IAge=2
Name=Filebrowser Crash Demonstration
Description=Demonstrates the Filebrowser plugin crashing when sending it a "get_view" message.
Authors=Robert Lopez Toscano
Copyright=Copyright © 2011 Robert Lopez Toscano <robert l toscano gmail com>

PLUGIN CODE:

#!/usr/bin/env python

import gedit
import gobject

class FilebrowserCrashDemoPlugin(gedit.Plugin):
  """To trigger the crash make sure you start gedit with the
  Filebrowser-crash-demo plugin disabled and the Filebrowser plugin enabled.
  Then:
    1. Enable the Filebrowser-crash-demo plugin.
    2. Disable the Filebrowser plugin.
    3. Enable the Filebrowser plugin.
    4. Disable the Filebrowser-crash-demo-plugin.
    5. Enable the Filebrowser-crash-demo-plugin.

  Expected behavior: step 5 should enable the Filebrowser-crash-demo-plugin
  without crashing.

  Actual behavior: step 5 causes gedit to seg fault.
  """

  def __init__(self):
    gedit.Plugin.__init__(self)
    self._crash_demos = {}

  def activate(self, window):
    self._crash_demos[window] = FilebrowserCrashDemo(window)

  def deactivate(self, window):
    self._crash_demos[window].deactivate()
    del self._crash_demos[window]


class FilebrowserCrashDemo(object):

  def __init__(self, window):
    self._window = window
    self._mb_registered_conn = \
        self._window.get_message_bus().connect_after('registered',
                                                     self._on_mb_registered)
    self._connect_with_fb()

  def deactivate(self):
    self._window.get_message_bus().handler_disconnect(self._mb_registered_conn)

  def _on_mb_registered(self, bus, msg_type):
    if msg_type.get_object_path() == 'plugins/filebrowser' and \
       msg_type.get_method() == 'get_view':
       gobject.timeout_add(1000, self._connect_with_fb)

  def _connect_with_fb(self):
    bus = self._window.get_message_bus()
    if bus.is_registered('/plugins/filebrowser', 'get_view'):
      bus.send_sync('/plugins/filebrowser', 'get_view')

I am not able to build the latest gedit on Ubuntu 11.04 so I am not able to test this on the latest build. I'm getting this autoconf error when I run autoconf on the latest source:

$ autoconf
configure.ac:10: warning: AC_INIT: not a literal: http://bugzilla.gnome.org/enter_bug.cgi?product=gedit
configure.ac:23: error: possibly undefined macro: AM_INIT_AUTOMAKE
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:24: error: possibly undefined macro: AM_MAINTAINER_MODE
configure.ac:36: error: possibly undefined macro: AM_PATH_PYTHON
configure.ac:68: error: possibly undefined macro: AM_CONDITIONAL
configure.ac:169: error: possibly undefined macro: AM_GNU_GETTEXT_VERSION
configure.ac:170: error: possibly undefined macro: AM_GNU_GETTEXT
configure.ac:417: error: possibly undefined macro: AC_MSG_WARN

Would anyone with the ability to build latest version of gedit be able to confirm that this is still a bug on the latest build of gedit?

--rob




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]