null-ok parameter annotation not correctly handled for virtual methods

Bug #588694 reported by Stuart Langridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pygobject
Fix Released
Critical
pygobject (Ubuntu)
Fix Released
Low
Unassigned
Lucid
Won't Fix
Low
Unassigned

Bug Description

Steps to reproduce:
1. Create a Python class which implement an interface which contains a method
with null-ok string parameter (gtk.Buildable.add_child)
2. Call this method from C with a null parameter (or use gtk.Builder in our
case)
3. application crashes with a segfault in the corresponding proxy method.

Test case:
1. Use upstream head Rhythmbox, or lucid Rhythmbox with patch from https://bugzilla.gnome.org/show_bug.cgi?id=619677, so that impl_add_uri and impl_want_uri RB functions are exposed to RB Python plugins
2. Add a trivial Python plugin that implements do_impl_{want,add}_uri
3. Run "rhythmbox testurl:///whatever" from the command line
4. Rhythmbox segfaults.

Code for example trivial Python plugin:

import rb, gobject
class ExampleURI(rb.Plugin):
    def activate(self, shell):
        self.source = gobject.new(MySource, shell=shell,plugin=self)
    def deactivate(self, shell):
        self.source.delete_thyself()
class MySource(rb.Source):
    __gproperties__ = {
      'plugin': (rb.Plugin, 'plugin', 'plugin',
                    gobject.PARAM_WRITABLE|gobject.PARAM_CONSTRUCT_ONLY),
    }
    def do_impl_want_uri(self, uri):
        if uri.startswith("testuri://"): return 100
        rb.Source.do_impl_want_uri(self, uri)
        return 0
    def do_impl_add_uri(self, uri, title, genre):
        if not uri.startswith("testuri://"): return False
        print "Hi! The testcase plugin got a uri: %s" % uri
        return True

Related branches

Changed in pygobject (Ubuntu):
importance: Undecided → Low
status: New → Fix Committed
Changed in pygobject (Ubuntu Lucid):
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pygobject - 2.21.1-1ubuntu1

---------------
pygobject (2.21.1-1ubuntu1) maverick; urgency=low

  * Resync on Debian
  * debian/control.in, debian/rules:
    - don't use a specific python version
  * debian/patches/80_no_pygi_error.patch:
    - don't raise pygi error since the package is built without that option
      which is something the code handles correctly (lp: #607674)
  * debian/patches/90_virtual_methods_handling.patch:
    - bugzilla change to fix a crashed on virtual method use (lp: #588694)

pygobject (2.21.1-1) unstable; urgency=low

  [ Josselin Mouette ]
  * Suggest gir1.0-glib-2.0 instead of gobject-introspection-*.

  [ Loïc Minier ]
  * Split out make check runs in their own targets.
  * Also make check the dbg builds.
  * Don't make check when nocheck is in DEB_BUILD_OPTIONS; thanks
    Daniel Schepler.

  [ Emilio Pozuelo Monfort ]
  * debian/patches/64_gil_locking.patch:
    - Add header.

  [ Josselin Mouette ]
  * New upstream release.
  * Introspection stuff has been moved to pygi.
  * 61_wakeupfd-fctnl-and-read.patch: dropped, merged upstream.
  * 90_autofoo.patch: regenerated.

pygobject (2.20.0-1) unstable; urgency=low

  [ Emilio Pozuelo Monfort ]
  * python-gobject-dbg is section debug.

  [ Josselin Mouette ]
  * New upstream release.
  * Switch installation path to /usr/lib/pymodules instead of
    /var/lib/python-support.
  * Enable girepository support; build-depend on libgirepository1.0-dev.
  * Suggest some introspection packages.
  * 90_autofoo.patch: regenerated for the new version.

pygobject (2.18.0-1) unstable; urgency=low

  * Fix English mistake in long descriptions. Closes: #524545.
  * New upstream release.
    + Fixes argument passing for glib.IOChannel. Closes: #528459.
  * 01_pkgconfig-private.patch,
    62_install-pyglib-in-libdir-with-python-version.patch:
    dropped, merged upstream.
  * 90_autofoo.patch: regenerated.
 -- Sebastien Bacher <email address hidden> Wed, 02 Jun 2010 18:35:17 +0200

Changed in pygobject (Ubuntu):
status: Fix Committed → Fix Released
Changed in pygobject:
status: Unknown → New
Changed in pygobject:
status: New → Fix Released
Changed in pygobject:
importance: Unknown → Critical
Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in pygobject (Ubuntu Lucid):
status: Triaged → Won't Fix
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.