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

using GDAL in java cause JVM crash #11544

Open
johnwick67943532 opened this issue Dec 25, 2024 · 8 comments
Open

using GDAL in java cause JVM crash #11544

johnwick67943532 opened this issue Dec 25, 2024 · 8 comments

Comments

@johnwick67943532
Copy link

johnwick67943532 commented Dec 25, 2024

What is the bug?

simple run Dataset dataset = gdal.Open(filePath, gdalconst.GA_ReadOnly);
Cause:

# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffcb4b63080, pid=16096, tid=16992
#
# JRE version: OpenJDK Runtime Environment Corretto-21.0.5.11.1 (21.0.5+11) (build 21.0.5+11-LTS)
# Java VM: OpenJDK 64-Bit Server VM Corretto-21.0.5.11.1 (21.0.5+11-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C  [msvcp140.dll+0x13080]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\CODE\spd_proj_main\web-back\hs_err_pid16096.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/corretto/corretto-21/issues/
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

[error occurred during error reporting (), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffcb4b63080]
Disconnected from the target VM, address: '127.0.0.1:10152', transport: 'socket'

Steps to reproduce the issue

as above

Versions and provenance

win10, gdal 3.6.1, jvm21

Additional context

hs_err_pid16096.log

@rouault
Copy link
Member

rouault commented Dec 26, 2024

Are you sure your runtime environment is sane ? I see in the hs_err_pid a mix of Visual Studio runtimes:

0x00007ffcef6d0000 - 0x00007ffcef6ee000 	C:\Users\huashi01\.jdks\corretto-21.0.5\bin\VCRUNTIME140.dll
0x00007ffceeda0000 - 0x00007ffceedac000 	C:\Users\huashi01\.jdks\corretto-21.0.5\bin\vcruntime140_1.dll
0x00007ffcb4b50000 - 0x00007ffcb4bdd000 	C:\Users\huashi01\.jdks\corretto-21.0.5\bin\msvcp140.dll
0x00007ffcb5150000 - 0x00007ffcb516e000 	C:\Users\huashi01\.conda\envs\gis_old\Library\bin\vcruntime140.dll
0x00007ffc803e0000 - 0x00007ffc8046d000 	C:\Users\huashi01\.conda\envs\gis_old\Library\bin\msvcp140.dll

And does your gdalalljni.dll matches the gdal.dll version ?

0x00007ffc80330000 - 0x00007ffc803d8000 	C:\Users\huashi01\.conda\envs\gis_old\Library\bin\gdalalljni.dll
0x00007ffc684f0000 - 0x00007ffc6993a000 	C:\Program Files\GDAL\gdal.dll

@rouault
Copy link
Member

rouault commented Jan 6, 2025

@johnwick67943532 Ping w.r.t my question in #11544 (comment)

@johnwick67943532
Copy link
Author

johnwick67943532 commented Jan 9, 2025

Thanks alot to caring about this!
I will try another way to fix this by using ubuntu and docker contianer with gdal .

@dansiviter
Copy link

dansiviter commented Jan 10, 2025

I'm getting a similar issue with:

  • GDAL 3.10.0 installed using winget install GISInternals.GDAL using Java Bindings via Maven,
  • Java Temurin 21.0.4+7-LTS
  • OS: Windows 11 24H2
  • Code: https://github.com/OSGeo/gdal/blob/master/swig/java/apps/ogr2ogr_new.java
  • Args: -nln foo1 -lco FID=gid PG:dbname='postgres' host='localhost' user='postgres' port='5432' password='mysecretpassword' C:\Users\DANIEL~1\Downloads\test.kml

Error

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff86cb82f58, pid=25244, tid=9280
#
# JRE version: OpenJDK Runtime Environment Temurin-21.0.4+7 (21.0.4+7) (build 21.0.4+7-LTS)
# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (21.0.4+7-LTS, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C  [msvcp140.dll+0x12f58]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\DanielSiviter\Develop\amld-api\hs_err_pid25244.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

hs_err_pid25244.log

@jratike80
Copy link
Collaborator

Have you tested with older Java versions?

@dansiviter
Copy link

@jratike80 Alas, no. I just don't have time.

@jratike80
Copy link
Collaborator

We can wait 😀

@XiaoYang943
Copy link

I'm getting a similar issue with:

  • gdal 3.10.0
  • JRE version: Java(TM) SE Runtime Environment (21.0.5+9) (build 21.0.5+9-LTS-239)
  • Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0.5+9-LTS-239, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
  • code: Dataset dataset = gdal.Open(filePath, gdalconst.GA_ReadOnly);

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

No branches or pull requests

5 participants