GNOME Bugzilla – Bug 659775
commit "Bind module symbols locally and immediately" breaks python loader
Last modified: 2011-09-23 08:52:57 UTC
After pygobject 3.0 was released, I updated my libpeas-installation, too. But neither git master nor the released tarball allowed me to load python plugins, because python loader was not able to import the gobject stuff due to missing symbols (which are part of libpython2.x). Because libpeas 1.1.3 was working fine, I looked over the changes since then, to find out what causes the breakage. I found commit 79c456ebf232f5de66c15580fff20885dee0bae6 responsible for it - obviously python needs 'G_MODULE_BIND_LAZY' to get the symbols resolved properly.
Except that is only used for C plugin... Others have said that they cannot import pygobject but that seems to have something to do with your pygobject install.
I did not really check how the mentioned code works, but the mentioned commit must be somehow related to the python loader, because changing G_MODULE_BIND_LOCAL back to G_MODULE_BIND_LAZY in peas-object-module.c causes my python plugins in gedit, rhythmbox etc. (and in peas-demo, too) to work while not doing so causes a failure (believe me, I compiled the recent pygobject and libpeas versions many times with different options (system-wide and in jhbuild-environment), and only reverting the mentioned commit makes pygobject and libpeas work here.)
Same problem here.
IMHO I think this is because there is some problem in pygobject but I'm not totally sure. Although changing it back to lazy and try to find out the problem for 1.4 wouldn't be much of a problem.
The only problem in pygobject that I can find is, that libpyglib-gi-2.0-python2.*.so.* uses symbols from libpython2.x not beeing linked against it directly but dlopening it. G_MODULE_BIND_LOCAL in peas-object-module.c works only when preloading libpython2.x.
I agree, we should just use 0 as flags so the dlopen uses global as flag. This means that it is load locally but also subsequentialy.
Created attachment 197265 [details] [review] dlopen This is the patch.
works for me
For me too.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.