Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#16105 closed Bug (invalid)

libgdal1-1.7.0 broke django.contrib.gis.gdal.libgdal

Reported by: ulvinge@… Owned by: nobody
Component: GIS Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

importing django.contrib.gis.gdal.libgdal results in a segfault when I use libgdal1-1.7.0
Using 1.6 it doesn't.
Quickfix I made that worked was to install both but modify gdal.libgdal to prioritize 1.6.

This may be a problem with my libgdal maybe. Using debian-testing.

Change History (4)

comment:1 by Aymeric Augustin, 14 years ago

Resolution: invalid
Status: newclosed

In my opinion, your segfault could be caused by:

  • a) a bug in ctypesdjango.contrib.gis.gdal.libgdal uses this module in a very straightforward way to load libgdal1,
  • b) a bug in libgdal1 — you're using a testing version, after all,
  • c) a bug in the Python interpreter itself — that sounds unlikely,
  • d) any combination of the above.

Since ctypes is part of the standard library, I think you should take the offending code from https://code.djangoproject.com/browser/django/trunk/django/contrib/gis/gdal/libgdal.py, extract the minimum failing test case, and post that to Python's bug tracker.

If might be as simple as:

from ctypes import CDLL
from ctypes.util import find_library
lib_path = find_library('gdal-1.7.0')
lgdal = CDLL(lib_path)

(Disclaimer: I don't have access to a box running debian-testing, so I don't know if this is sufficient to exhibit the bug.)

Anyway, Django does not contain any C code, it's written entirely in Python. So while it can raise exceptions, it can't (in theory) create segfaults. For this reason, I'm going to mark the bug as invalid.

comment:2 by anonymous, 14 years ago

This program:

from ctypes import CDLL
from ctypes.util import find_library
lib_path = find_library('gdal1.7.0')
lgdal = CDLL(lib_path)
_version_info = lgdalGDALVersionInfo

Gives the following output:
Traceback (most recent call last):

File "test.py", line 4, in <module>

lgdal = CDLL(lib_path)

File "/usr/lib/python2.6/ctypes/init.py", line 353, in init

self._handle = _dlopen(self._name, mode)

OSError: /usr/lib/libgdal1.7.0.so.1: symbol cxa_pure_virtual, version libmysqlclient_16 not defined in file libmysqlclient.so.16 with link time reference

I'm using 1.7.3-4

I should find the right place to post this...

comment:3 by anonymous, 14 years ago

Sorry:

from ctypes import CDLL
from ctypes.util import find_library
lib_path = find_library('gdal1.7.0')
lgdal = CDLL(lib_path)
_version_info = lgdal['GDALVersionInfo']

comment:4 by Aymeric Augustin, 14 years ago

Based on this traceback, I'd say it's a Debian bug. I suggest http://www.debian.org/Bugs/Reporting

The error message is similar to http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=619175.

Note: See TracTickets for help on using tickets.
Back to Top