Repository navigation
Conversation
ROOT CAUSE: ERROR_DLL_INIT_FAILED (Windows error 1114) when loading libgdal-*.dll in an R session. The HDF5 driver's dependency chain (libhdf5 → libsuperlu → libopenblas → libgfortran-5/libgomp-1/libquadmath-0) conflicts with Rtools45's copies of these same DLLs already loaded by R at startup. Windows' loaded-module list rule reuses the Rtools copy of libgfortran/libgomp for all subsequent DLL loads, regardless of what is in the bundle's bin/. When Rtools45 GCC and MSYS2 UCRT64 GCC versions diverge, libopenblas DllMain returns FALSE → ERROR_DLL_INIT_FAILED. FIX: Set GDAL_USE_HDF5=OFF, GDAL_USE_NETCDF=OFF, GDAL_USE_POPPLER=OFF in cmake configure. Remove corresponding MSYS2 packages from the explicit install list. Update comments and release body table to document the rationale. The build cache key (hashing build_gdal.sh) auto-busts on this change so the next workflow run produces a fresh bundle."
…r-hook fix: disable HDF5/NetCDF/Poppler in GDAL build to resolve DLL init failure in R
There was a problem hiding this comment.
Code Review
This pull request updates tools/build_gdal.sh to disable HDF5, NetCDF, and Poppler in the GDAL build configuration. These changes prevent DLL initialization failures on Windows environments caused by mismatched OpenBLAS/Fortran/OpenMP dependencies and Mozilla NSS/NSPR initialization issues. I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…etCDF; gate bundles on loadability Root cause of the e2e ERROR_DLL_INIT_FAILED (1114): MSYS2's libpodofo.dll runs OpenSSL initialization in its static initializers (DllMain, under the loader lock) and fails against the MSYS2-built libcrypto-3-x64.dll - in any process. libgdal imports libpodofo directly when the PDF driver is built, making libgdal-*.dll itself unloadable. Disabling only GDAL_USE_POPPLER is insufficient (the driver falls back to podofo), so the driver is off entirely: GDAL_ENABLE_DRIVER_PDF=OFF + POPPLER/PODOFO/PDFIUM=OFF. The earlier HDF5/OpenBLAS/Rtools-conflict theory (PR #22) was disproven by loading all 175 published-bundle DLLs individually inside R 4.6.1 - only libpodofo fails - so GDAL_USE_HDF5/NETCDF are ON again. Verification now has three layers so this class of breakage can never publish again: ntldd closure + banned-DLL guard (collect_dlls.sh), LoadLibrary smoke test over every bundled DLL (build.yml step 7b), and the e2e workflow on release publish. Validated locally end to end in Rtools45 UCRT64: full 3.13.1 build with the new flags, 162-DLL closed bundle (no podofo/poppler/NSS), 0 load failures, gdalraster source-built against it, algorithm registry returns all 8 names. Co-authored-by: Cursor <cursoragent@cursor.com>
…update troubleshooting and toolchain notes for the 1114 failure class Co-authored-by: Cursor <cursoragent@cursor.com>
…reference material under dev/archive (local-only) Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
This PR resolves a bundle-wide LoadLibrary failure (A dynamic link library (DLL) initialization routine failed, Windows error 1114) that made published GDAL runtime bundles unloadable on machines without Rtools' UCRT64 tree. The root cause was MSYS2's libpodofo.dll (a PDF-driver backend) failing its DllMain-time OpenSSL initialization against the MSYS2 libcrypto. The fix disables the PDF driver at the build level and adds new verification layers so a broken bundle cannot be published again. The remainder of the PR is an extensive documentation refresh capturing the diagnosis, the Windows DLL/ABI mechanics, and the failure history.
Changes:
- Disable the GDAL PDF driver (
GDAL_ENABLE_DRIVER_PDF=OFFplusGDAL_USE_POPPLER/PODOFO/PDFIUM=OFF) inbuild_gdal.sh, removepopplerfrom the MSYS2 install list, and re-enable/confirm HDF5+NetCDF. - Add a banned-dependency guard in
collect_dlls.shand aLoadLibrarysmoke-test gate inbuild.ymlso DllMain failures and PDF/NSS backends are caught before publishing. - Add/expand maintainer documentation and user-facing troubleshooting/architecture notes; delete two obsolete
dev/docs/reference/scratch files and adjust.gitignore/archive tracking.
Reviewed changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tools/build_gdal.sh |
Adds PDF-driver-off cmake flags with detailed rationale; reorders HDF5/NetCDF flags (no functional change). |
tools/collect_dlls.sh |
Adds a banned-dependency (podofo/poppler/NSS) guard that fails the build if libgdal links a known-broken backend. |
.github/workflows/build.yml |
Adds LoadLibrary smoke-test step; removes poppler from and reorders the MSYS2 package list; updates summary table. |
vignettes/troubleshooting.qmd |
New section explaining error 1114 vs 126 and a DLL sweep-load diagnostic snippet. |
vignettes/architecture.qmd |
Documents the PDF-driver-off build flag. |
NEWS.md |
Notes the 1114 fix, HDF5/NetCDF re-enable, and 3-layer verification. |
dev/docs/* |
New 00-the-full-picture.md, 08-windows-dll-abi-deep-dive.md; updates to README/05/06 deep-dive references. |
dev/docs/reference/* (deleted) |
Removes two non-normative Perplexity/reference scratch documents. |
.gitignore, .build/*, dev/archive/.gitignore |
Track .build/ scaffolding; scope docs ignore to /docs/; keep archive dir tracked but contents ignored. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…estored, loadability gate) Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Pull Request Summary by devActivityMetricsAchievements
|
Summary
ERROR_DLL_INIT_FAILED(1114): the MSYS2libpodofo.dll(PDF driver backend) fails DllMain-time OpenSSL initialization against the MSYS2libcrypto-3-x64.dllin any process, making every publishedlibgdal-*.dllunloadable on machines without Rtools' UCRT64 tree. The PDF driver is now disabled outright (GDAL_ENABLE_DRIVER_PDF=OFF+ poppler/podofo/pdfium backends off). Disabling only poppler (PR fix: disable HDF5/NetCDF/Poppler in GDAL build to resolve DLL init failure in R #22) was insufficient — the driver falls back to podofo.libpodofo.dllfails).build.ymlnowLoadLibrary-tests every bundled DLL in a plain process before anything is published — the failure class that shipped in June/July is undetectable by import-closure checks alone.collect_dlls.shadditionally bans PDF/NSS-chain DLLs from libgdal's import tree.dev/docs/00-the-full-picture.md(design-decision narrative) anddev/docs/08-windows-dll-abi-deep-dive.md(Windows DLL loading / C++ ABI reference); troubleshooting vignette + dev notes gain an error-1114 section with a sweep-load diagnostic; architecture vignette documents the PDF-driver exclusion.Validation (local, Rtools45 UCRT64)
collect_dlls.sh: closed 162-DLL bundle (13 fewer than broken published bundle — no podofo/poppler/NSS)libgdal-39.dllloads in a clean process with minimal PATHinstall_gdalraster()against the local bundle: compiles, installs,gdal_global_reg_names()returns all 8 entries, CRS/raster smoke checks passTest plan
smoke-gdal-v3.13.1prerelease, run in progress)gdal-v3.13.1(cache auto-busts via script hash); release publish auto-triggers e2e against the CI-built assetsmoke-gdal-v3.13.1prerelease after the CI asset verifies