All python plugins are broken by a bad import

Bug #857348 reported by Curtis Hovey
144
This bug affects 33 people
Affects Status Importance Assigned to Milestone
pygobject
Invalid
Undecided
Unassigned
libpeas (Ubuntu)
Fix Released
High
Martin Pitt
Oneiric
Fix Released
High
Martin Pitt

Bug Description

All python plugins in gedit are disabled because of a python import error. This affects all apps that use libpeas to to host python plugins.

(gedit:3574): libpeas-WARNING **: Error initializing Python Plugin Loader:PyGObject initialization failed
ImportError: could not import gobject (error was: '/usr/lib/libpyglib-gi-2.0-python2.7.so.0: undefined symbol: _Py_ZeroStruct')
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 59, in apport_excepthook
    from apport.fileutils import likely_packaged
  File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
    from apport.report import Report
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 16, in <module>
    from xml.parsers.expat import ExpatError
  File "/usr/lib/python2.7/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: /usr/lib/python2.7/lib-dynload/pyexpat.so: undefined symbol: _Py_ZeroStruct

Original exception was:
ImportError: could not import gobject (error was: '/usr/lib/libpyglib-gi-2.0-python2.7.so.0: undefined symbol: _Py_ZeroStruct')

(gedit:3574): libpeas-WARNING **: Please check the installation of all the Python related packages required by libpeas and try again

(gedit:3574): libpeas-WARNING **: Loader 'python' is not a valid PeasPluginLoader instance

(gedit:3574): libpeas-WARNING **: Could not find loader 'python' for plugin 'gdpbzr'

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gir1.2-peas-1.0 1.1.4-0ubuntu1
ProcVersionSignature: Ubuntu 3.0.0-11.18-generic-pae 3.0.4
Uname: Linux 3.0.0-11-generic-pae i686
NonfreeKernelModules: nvidia wl
ApportVersion: 1.23-0ubuntu1
Architecture: i386
Date: Fri Sep 23 08:38:30 2011
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: libpeas
UpgradeStatus: Upgraded to oneiric on 2011-09-23 (0 days ago)

Revision history for this message
Curtis Hovey (sinzui) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libpeas (Ubuntu):
status: New → Confirmed
Revision history for this message
Leonardo Robol (leo.robol) wrote :

It don't seems to me that this is a duplicate of bug #839712, since that has been fixed and it has a different traceback; I still can't enable plugins in gedit and in the other libpeas enabled applications that I tried (such as totem, for example).

Revision history for this message
Michael Terry (mterry) wrote :

Maybe I was hasty, you can un-dupe if you like. I guess my feeling was that any remaining plugin problems were plugin-related now, not libpeas related. They need to be ported to new libpeas. So if you undupe, maybe retarget at the plugins that have the problem?

Revision history for this message
Leonardo Robol (leo.robol) wrote :

I was doing some experiments now, and the problem seems that /usr/lib/libpyglib-gi-2.0-python2.7.so.0 is not linked against libpython2.7.
Starting gedit (or other libpeas enabled applications) with LD_PRELOAD=/usr/lib/libpython2.7 solves the issue. So maybe it's some problem in python-gobject? I'm not so sure here on where is the problem...

Revision history for this message
jpfle (jpfle) wrote :

I have to start gedit with LD_PRELOAD=/usr/lib/libpython2.7.so.1 to solve this issue.

Revision history for this message
Curtis Hovey (sinzui) wrote :

My plugins and I am sure gedit's plugins are using the libpeas via the Gedit extension classes. I do not think any plugin should be messing with LD_PRELOAD since they assume the user is using the system python (2.6 or above).

I can confirm my plugins and most of gedit's default plugins work with this hack, but I see snippets has errors. I suppose snippet has separate bug.

Revision history for this message
Leonardo Robol (leo.robol) wrote :

That is surely a temporary hack, but it seems to me that the real problem is not in libpeas but in python-gobject, where libpyglib-2.0-pythonx.y doesn't get linked to libpython-x.y. I am looking at the sources right now and the package build gives warning about this issue (libpyglib-2.0-pythonx.y uses routines that are not found in none of its libraries).
I am not an automake expert, neither I know the architecture of python-gobject, but it seems like a missing -lpythonx.y somewhere.

Revision history for this message
Doug McMahon (mc3man) wrote :

Would seem both sources may be involved -
If I downgrade both to previous versions then the plugins can be enabled - (python-gobject_2.90.3-1svn1; libpeas-1.0-0_1.1.3-0ubuntu1
Upgrading either or both then breaks

Revision history for this message
Jeremy Bícha (jbicha) wrote :

I'm marking this as triaged since I believe this has been reported upstream (where there are patches that hopefully fix this).

affects: libpeas (Ubuntu) → pygobject (Ubuntu)
Changed in pygobject (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
milestone: none → ubuntu-11.10
Revision history for this message
jpfle (jpfle) wrote :

About the trick described on comment 9, here are the steps:

wget http://launchpadlibrarian.net/79014999/libpeas-1.0-0_1.1.3-0ubuntu1_i386.deb
wget http://launchpadlibrarian.net/79012214/python-gobject_2.90.3-1svn1_i386.deb
sudo dpkg -i libpeas-1.0-0_1.1.3-0ubuntu1_i386.deb
sudo dpkg -i python-gobject_2.90.3-1svn1_i386.deb
rm libpeas-1.0-0_1.1.3-0ubuntu1_i386.deb
rm python-gobject_2.90.3-1svn1_i386.deb

Revision history for this message
Alex Schiff (alex.schiff) wrote :

@Jean-Philippe Fleury (jpfle)- Your fix worked for me. Unfortunately, gedit-latex-plugin isn't yet compatible with gedit 3. Hopefully it will be fixed soon.

Revision history for this message
Mark Repka (mrr6609) wrote :

@Jean-Philippe Fleury (jpfle) - Are there amd64 packages of that version somewhere? I tried your fix as given and got an error of:
"libpeas-1.0-0:i386 1.1.3-0ubuntu1 (Multi-Arch: no) is not co-installable with libpeas-1.0-0:amd64 1.1.4-0ubuntu1 (Multi-Arch: no) which is currently installed"

Revision history for this message
Alvaro Leal (Effenberg0x0) (effenberg0x0) wrote :

The workaround at post #11 only works for me if, after running those commands, I launch Gedit using:

$ DISPLAY=:0.0 PYTHON=/usr/bin/python3.2 LD_PRELOAD=/usr/lib/libpython2.7.so.1 /usr/bin/gedit

Thanks,
Effenberg

Revision history for this message
jpfle (jpfle) wrote :

@Mark Repka: try the following:

wget http://launchpadlibrarian.net/79015317/libpeas-1.0-0_1.1.3-0ubuntu1_amd64.deb
wget http://launchpadlibrarian.net/79012147/python-gobject_2.90.3-1svn1_amd64.deb
sudo dpkg -i libpeas-1.0-0_1.1.3-0ubuntu1_amd64.deb
sudo dpkg -i python-gobject_2.90.3-1svn1_amd64.deb
rm libpeas-1.0-0_1.1.3-0ubuntu1_amd64.deb
rm python-gobject_2.90.3-1svn1_amd64.deb

Revision history for this message
Brad Needham (fishrcynic) wrote :

#15 fixes rhymthbox plugins on amd64 - same issue with plugins

Revision history for this message
Martin Pitt (pitti) wrote :

GNOME bug #659879 is about something else (that bug was fixed in oneiric yesterday). Unlinking.

Changed in pygobject:
importance: Unknown → Undecided
status: Unknown → New
Changed in pygobject (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: Triaged → In Progress
Changed in pygobject (Ubuntu Oneiric):
importance: Medium → High
Revision history for this message
John M (jwmwalrus) wrote :

I just got the amd64 packages from https://launchpad.net/ubuntu/+source/libpeas/1.1.3-0ubuntu1/+build/2765954 and the gedit plugins seem to be working again (including the one for latex, from git).

@Alex Schiff: The gedit-latex-plugin from git needs gedit-dev, which in turn requires a libpeas-dev package with a matching version.

Revision history for this message
Martin Pitt (pitti) wrote :

Should be fixed with

libpeas (1.2.0-0ubuntu1) oneiric; urgency=low

  * New upstream release:
    - Fix using Python plugins.
    - Misc improvement and fixes.
    - Translation updates
  * debian/libpeas-1.0-0.symbols:
    - Updated symbols

 -- Didier Roche <email address hidden> Tue, 27 Sep 2011 09:21:20 +0200

I'll double-check once it's built.

Changed in pygobject:
status: New → Invalid
affects: pygobject (Ubuntu Oneiric) → libpeas (Ubuntu Oneiric)
Changed in libpeas (Ubuntu Oneiric):
milestone: ubuntu-11.10 → none
status: In Progress → Fix Released
milestone: none → ubuntu-11.10
Revision history for this message
Martin Pitt (pitti) wrote :

Confirmed that this version of libpeas works fine again.

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.