-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python seg fault with GDAL>=3.6.0 after opening many rasters in threads #8497
Comments
I don't manage to reproduce with a GDAL master and 3.7.x builds on a Linux machine with 12 vCPUs. |
Here I put the minimal example on github actions, it appears to be specific to macOS: gdal 3.7.2 py311hc436b80_4 and numpy 1.26.0 py311hc44ba51_0 from conda-forge |
I don't have a Mac, so I'm unable to tackle this directly. @emlys if you have a Mac, do you reproduce that with a manual build of GDAL master ? If so, and if the issue doesn't reproduce with GDAL 3.5, you could attempt a "git bisect" session to try to spot the offending commit? (although I've absolutely no clue why importing numpy would matter at all for your test scenario) |
@rouault I was able to build locally on my Mac (Ventura 13.2.1) but getting this error on import:
I noticed this line: gdal/.github/workflows/cmake_builds.yml Line 605 in 1d1044c
Is it possibly the same issue and if so, do you know of any workaround to build GDAL on mac 12+ so that I can try the git bisect? |
not sure. I'm a bit confused by "/Users/emily/mambaforge/envs/testgdal/lib/python3.12/site-packages/osgeo/init.py" which I'd assume to be the python bindings from conda-forge, not your own build. You should probably uninstall gdal from conda-forge to avoid any unintended mix. |
thanks, I was missing the environment variables. I ran # gdal_bisect_script.sh
rm -r build/*
cd build
# changed these options to get around some build errors
cmake -DSPATIALITE_VERSION_STRING=5.1.0 -DGDAL_ENABLE_DRIVER_HDF5=OFF -DOGR_ENABLE_DRIVER_FLATGEOBUF=OFF -DOGR_ENABLE_DRIVER_SQLITE=OFF ..
cmake --build .
. ../scripts/setdevenv.sh
python -c "from osgeo import gdal; print(gdal.__version__)"
trap "exit 1" ERR # convert exit code from 139 to 1, for git bisect run
python -X dev ~/test.py git clone https://github.com/OSGeo/gdal.git
cd gdal
mkdir build
conda create -n gdal_env --yes numpy requests
conda activate gdal_env
git bisect start
git bisect good v3.5.0
git bisect bad v3.6.0
git bisect run ../gdal_bisect_script.sh the issue happens with a build of |
ogr_proj_p.cpp: disable pthread_atfork() optimization on MacOS (fixes #8497)
[Backport release/3.7] ogr_proj_p.cpp: disable pthread_atfork() optimization on MacOS (fixes #8497)
fixes OSGeo#8497)" This reverts commit 84717b5. This is no longer needed since commit OSGeo@5238ac8 cf comment OSGeo#8909 (comment)
fixes #8497)" This reverts commit 84717b5. This is no longer needed since commit 5238ac8 cf comment #8909 (comment)
fixes OSGeo#8497)" This reverts commit 84717b5. This is no longer needed since commit OSGeo@5238ac8 cf comment OSGeo#8909 (comment)
Expected behavior and actual behavior.
I expected the following python script to run successfully, but it exits with a seg fault.
Steps to reproduce the problem.
This error was happening in our test suite when I tried to upgrade from GDAL 3.5 (Github Actions run here). I narrowed it down to this weird, minimal example. Even the unused numpy import is necessary to reproduce:
Operating system
macOS Ventura 13.2.1
GDAL version and provenance
GDAL>=3.6.0 from conda-forge
The text was updated successfully, but these errors were encountered: