gdal icon indicating copy to clipboard operation
gdal copied to clipboard

Crash with Java bindings on Windows with vcpkg

Open sendreams opened this issue 1 month ago • 5 comments

What is the bug?

Previously, compilation for versions 3.6.3 and 3.8.5 on Windows was normal (working).

Yesterday, I attempted to compile 3.11.5 and 3.12.0, and the compilation process was also normal, but the application crashes when using the Java interface (it crashes at gdal.AllRegister()).

jvm crash log(jdk11) hs_err_pid268.log

jdk17 hs_err_pid7616.log

Steps to reproduce the issue

My compilation procedure is as follows:

  1. install vcpkg
  2. vcpkg install sqlite3[rtree] --recurse vcpkg install proj
  3. install swig and ant
  4. build cmake .. -DSWIG_EXECUTABLE=C:/Apps/dev/swigwin-4.4.0/swig.exe -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_JAVA_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=C:/Apps/dev/vcpkg/scripts/buildsystems/vcpkg.cmake

cmake --build . --config Release

Versions and provenance

3.11.5 or 3.12.0

Additional context

No response

sendreams avatar Nov 09 '25 00:11 sendreams

if use version 3.11.3 which download by GISInternal will be ok.

sendreams avatar Nov 09 '25 00:11 sendreams

CC @dg0yt

rouault avatar Nov 09 '25 00:11 rouault

I can't say much about the Java end, and I'm not familiar with debugging that toolchain. The "steps to reproduce" aren't complete if they end with the gdal build step.

Port gdal in vcpkg has parameters, patches and polyfill to collect the correct link libraries in all configurations, and to avoid vendored patches. The DLLs which are already loaded, as shown in the logs, are good. But if gdal.AllRegister() pulls in more runtime libraries, the actual trigger might not be visible.

dg0yt avatar Nov 09 '25 08:11 dg0yt

if use version 3.11.3 which download by GISInternal will be ok.

How does it go with the development version from GISInternals, it seems to be 3.12?

jratike80 avatar Nov 09 '25 19:11 jratike80

if use version 3.11.3 which download by GISInternal will be ok.

How does it go with the development version from GISInternals, it seems to be 3.12?

i have really downloaded the development version, but the zip file can't not be unzip properly.

Image

the directly download link here: https://download.gisinternals.com/sdk/downloads/release-1928-x64-gdal-3-11-mapserver-8-4.zip

sendreams avatar Nov 10 '25 11:11 sendreams