[gdal-dev] python malloc error (gdal_array)

Ryan Grout rgrout at continuum.io
Tue May 12 14:25:53 PDT 2015


Hi,

I am building GDAL for OS X (along with the Python bindings).
To test that everything is working fine, run the following imports

import osgeo.ogr
import osgeo.osr
import osgeo.gdal
import osgeo.gdalconst
import osgeo.gdal_array

Each module was imported in a separate session of Python.  After each 
import, Python was closed by calling sys.exit() from within the 
interpreter.  When I import osgeo.gdal_array, and then I quit Python I 
get the following error:
python(2690,0x7fff7db5d300) malloc: *** error for object 
0x56415741e5894855: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

And Python crashes.

GDAL compiled with (and the resulting library is stripped with 
--strip-unneeded)
bash configure \
     --without-python \
     --with-hdf5=$PREFIX \
     --with-netcdf=$PREFIX \
     --prefix=$PREFIX
make
make install

I then compile the python bindings with NumPy support from the GDAL 
package on PyPI.
The problem only happens on OS X (I tested it on Linux, OS X, and Windows).

This leads me to believe that there may be a bug in gdal_array on OS X.  
I'm not sure how to provide more info.  Any thoughts?  I'm surprised 
that it is only happening on OS X.




More information about the gdal-dev mailing list