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 644702 - libglom_init(): PyDateTime_IMPORT fails when run from JNI (in JVM)
libglom_init(): PyDateTime_IMPORT fails when run from JNI (in JVM)
Status: RESOLVED OBSOLETE
Product: glom
Classification: Other
Component: OnlineGlom
git master
Other Linux
: Normal normal
: ---
Assigned To: Murray Cumming
Murray Cumming
Depends on:
Blocks:
 
 
Reported: 2011-03-14 09:19 UTC by Murray Cumming
Modified: 2013-10-31 11:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Murray Cumming 2011-03-14 09:19:54 UTC
OnlineGlom calls libglom_init(), which fails because it asks Python to import a standard module. Apparently the linker behaves differently under the JVM. Recent versions of Glom (1.16, 1.18, and 1.19) will now show this error from Python 2.6:

  void Glom::libglom_init(): PyDateTime_IMPORT (a python module import) failed.
  ImportError: /usr/lib/python2.6/lib-dynload/datetime.so: undefined symbol: _Py_ZeroStruct

Here is a branch of OnlineGlom that is a simple JNI example of this problem, with no use of swig or libglom, which shows the same warning:
http://gitorious.org/online-glom/java-libglom/trees/python_assert_investigation

When using python2.7 instead (adjust the Makefile.am in that branch's Makefile.am) on Ubuntu Natty on my laptop, I see a python backtrace too, though I don't see that on my PC here. I'll paste that later.
Comment 1 Murray Cumming 2011-03-14 09:25:38 UTC
I don't have the error with python3.1 (on Ubuntu Maverick), though that could just be a side-effect.
Comment 2 Murray Cumming 2011-03-14 09:59:18 UTC
_Py_ZeroStruct should be found in the main libpython*.so shared library, and normally is found:

  nm -D /usr/lib/libpython2.6.so  | grep "_Py_ZeroStruct"
  001f9cc4 D _Py_ZeroStruct

This might just be the first symbol that the linker looks for.
Comment 3 Murray Cumming 2011-03-14 14:24:40 UTC
Here is the backtrace that I see on Ubuntu Natty:

Error in sys.excepthook:
Traceback (most recent call last):
  • File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 57 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: PyCapsule_Import could not import module "datetime"
Comment 4 Ben Konrath 2011-03-17 09:07:27 UTC
Just so all relevant information is on this bug, there were different results with respect to this python failure on Fedora and Ubuntu systems. Here's a note about the difference from the TODO file in java-libglom:

On Fedora 13, you get this warning when running the bindings but things seems to work:

'import site' failed; use -v for traceback"

On Ubuntu 10.04 you get a total failure:

ERROR:glom/libglom/init.cc:51:void Glom::libglom_init(): assertion failed: (PyDateTimeAPI)
Comment 5 Murray Cumming 2013-10-31 11:18:52 UTC
java-libglom is not maintained or used now.