Skip to content
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

gdaldrivermanager.cpp: Do not look for plugins in GetRealDriver when GDAL_NO_AUTOLOAD set. #11383

Merged

Conversation

schwehr
Copy link
Member

@schwehr schwehr commented Nov 28, 2024

Fixes #11332

What does this PR do?

In GDALPluginDriverProxy::GetRealDriver(), return a nullptr if GDAL_NO_AUTOLOAD is set and plugins are not available. This avoids the call the CPLGetSymbol.

In custom builds like my bazel build, this lets me completely remove CPLGetSymbol from the build. When GDAL runs in a sandbox, it is helpful to not even have a chance for this function to run. Any call to CPLGetSymbol would cause the sandbox to trigger a violation and kill the work.

What are related issues/pull requests?

#11332

Environment

Provide environment details, if relevant:

  • OS: Custom linux with bazel build
  • Compiler: llvm

Note: Failure that I can't tell if it's related to the change I made. The most recent commits on head fail too, but it's luck on which one.

Executing transaction: ...working... done
+ test -f /home/runner/miniconda3/envs/test/conda-bld/libgdal-core_1732816510057/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/lib/gdalplugins/gdal_PDF.so
+ gdalinfo --format PDF
ERROR 1: libpoppler.so.140: cannot open shared object file: No such file or directory
ERROR 1: libpoppler.so.140: cannot open shared object file: No such file or directory
+ ./test_pdf.sh
++ dirname ./test_pdf.sh
+ pushd ./test_data/
+ gdalinfo test_iso32000.pdf
ERROR 1: libpoppler.so.140: cannot open shared object file: No such file or directory
ERROR 1: libpoppler.so.140: cannot open shared object file: No such file or directory
gdalinfo failed - unable to open 'test_iso32000.pdf'. Did you intend to call ogrinfo?
WARNING: Tests failed for libgdal-pdf-3.10.0-hb578332_2112.tar.bz2 - moving package to /home/runner/miniconda3/envs/test/conda-bld/broken
Traceback (most recent call last):
export PREFIX=/home/runner/miniconda3/envs/test/conda-bld/libgdal-core_1732816510057/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl

@schwehr schwehr requested a review from rouault November 28, 2024 19:08
@rouault rouault merged commit 4aee058 into OSGeo:master Nov 28, 2024
35 checks passed
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 74.174% (+0.002%) from 74.172%
when pulling ccfa017 on schwehr:11332-exclude-cplgetsymbol-without-plugins
into 02c5966 on OSGeo:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Abilty to not include CPLGetSymbol when not building plugins
3 participants