geotrellis / gdal-warp-bindings

Thread-safe bindings for GDAL's Warp functionality
Apache License 2.0
17 stars 6 forks source link

Can not load gdalwarp_bindings-amd64.dll #127

Open syjjj0826 opened 9 months ago

syjjj0826 commented 9 months ago

Describe the bug

I want to use the geotrellis-gdal module in my project, and already import the relevant libraries.

import org.gdal.ogr.ogr
import org.gdal.gdal.gdal
import geotrellis.raster.gdal._

when I run this code, throw an Exception:

val url = "D:\\Code\\IDEA\\sg_demo\\data\\LC80140322014139LGN00.tif"
val ds: GDALDataset = GDALDataset(url)
val meta = ds.getMetadataDomainList(1)

When I debug step by step, I found the issue arises at these codes in file D:\Java\jdk1.8.0_202\src.zip!\java\lang\ClassLoader.java

NativeLibrary lib = new NativeLibrary(fromClass, name, isBuiltin);
nativeLibraryContext.push(lib);
try {
    lib.load(name, isBuiltin);
} finally {
    nativeLibraryContext.pop();
}

When it reaches A during execution, the program exits abnormally.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffc01f6268b, pid=1100, tid=0x000000000000519c
#
# JRE version: Java(TM) SE Runtime Environment (8.0_202-b08) (build 1.8.0_202-b08)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.202-b08 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [ntdll.dll+0x3268b]
#
# Core dump written. Default location: D:\Code\IDEA\sg_demo\hs_err_pid1100.mdmp
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  T H R E A D  ---------------

Current thread (0x00000000033dc000):  JavaThread "main" [_thread_in_native, id=20892, stack(0x00000000032d0000,0x00000000033d0000)]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000634f1750

Registers:
RAX=0x0000000001242910, RBX=0x00000000634f1750, RCX=0x00007ffbab98bbdc, RDX=0x00007ffbab984d00
RSP=0x00000000033ccb20, RBP=0x0000000000000000, RSI=0x0000000000000000, RDI=0xffffffffffbadd11
R8 =0x0000000000001bad, R9 =0x00007ffbab984d28, R10=0x00000000217d6d80, R11=0x00007ffbab9e337c
R12=0x00000000c000007a, R13=0x0000000000000000, R14=0x00000000634f1752, R15=0x00007ffbaa730000
RIP=0x00007ffc01f6268b, EFLAGS=0x0000000000010246

Top of Stack: (sp=0x00000000033ccb20)
0x00000000033ccb20:   0000000000000001 0000000000000000
0x00000000033ccb30:   0000000000000000 00000000033ccc28
0x00000000033ccb40:   0000000200000001 00007ffc01f65c46
0x00000000033ccb50:   0000000000000000 00000000033ccb80
0x00000000033ccb60:   0000000001242910 00007ffbab984d00
0x00000000033ccb70:   00000000012016d0 00007ffbab98bbdc
0x00000000033ccb80:   0000000000001bad 0000000061588598
0x00000000033ccb90:   0000000061588ab8 00007ffbab984d28
0x00000000033ccba0:   00007ffbab9e337c 0000000061540000
0x00000000033ccbb0:   00007ffbab992a90 00007ffc01f507e0
0x00000000033ccbc0:   00000000217d6d80 00007ffc01f4430e
0x00000000033ccbd0:   00005e57b54ed777 00000000217d6d80
0x00000000033ccbe0:   0000000000000004 0000000001242910
0x00000000033ccbf0:   0000000000000001 0000000000000000
0x00000000033ccc00:   0000000000000000 000000006158805c
0x00000000033ccc10:   00000000217d6d80 00007ffc01f47bc4 

Instructions: (pc=0x00007ffc01f6268b)
0x00007ffc01f6266b:   01 00 00 8b d8 48 8b 44 24 40 48 03 58 30 4c 8d
0x00007ffc01f6267b:   73 02 41 f7 42 20 00 00 00 02 0f 85 48 15 08 00
0x00007ffc01f6268b:   44 0f b7 0b 44 8b d6 45 8d 58 ff 45 3b c8 0f 83
0x00007ffc01f6269b:   69 02 00 00 45 85 db 0f 88 a8 15 08 00 0f 1f 84 

Register to memory mapping:

RAX=0x0000000001242910 is an unknown value
RBX=0x00000000634f1750 is an unknown value
RCX=0x00007ffbab98bbdc is an unknown value
RDX=0x00007ffbab984d00 is an unknown value
RSP=0x00000000033ccb20 is pointing into the stack for thread: 0x00000000033dc000
RBP=0x0000000000000000 is an unknown value
RSI=0x0000000000000000 is an unknown value
RDI=0xffffffffffbadd11 is an unknown value
R8 =0x0000000000001bad is an unknown value
R9 =0x00007ffbab984d28 is an unknown value
R10=0x00000000217d6d80 is an unknown value
R11=0x00007ffbab9e337c is an unknown value
R12=0x00000000c000007a is an unknown value
R13=0x0000000000000000 is an unknown value
R14=0x00000000634f1752 is an unknown value
R15=0x00007ffbaa730000 is an unknown value

Stack: [0x00000000032d0000,0x00000000033d0000],  sp=0x00000000033ccb20,  free space=1010k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  java.lang.ClassLoader$NativeLibrary.load(Ljava/lang/String;Z)V+0
j  java.lang.ClassLoader.loadLibrary0(Ljava/lang/Class;Ljava/io/File;)Z+328
j  java.lang.ClassLoader.loadLibrary(Ljava/lang/Class;Ljava/lang/String;Z)V+48
j  java.lang.Runtime.load0(Ljava/lang/Class;Ljava/lang/String;)V+57
j  java.lang.System.load(Ljava/lang/String;)V+7
j  cz.adamh.utils.NativeUtils.loadLibraryFromJar(Ljava/lang/String;)V+276
j  com.azavea.gdal.GDALWarp.init(I)V+89
j  com.azavea.gdal.GDALWarp.<clinit>()V+23
v  ~StubRoutines::call_stub
j  geotrellis.raster.gdal.GDALDataset$.apply(Ljava/lang/String;[Ljava/lang/String;)J+2
j  geotrellis.raster.gdal.GDALDataset$.apply(Ljava/lang/String;)J+22
j  gdal_test_main$.delayedEndpoint$gdal_test_main$1()V+15
j  gdal_test_main$delayedInit$body.apply()Ljava/lang/Object;+4
j  scala.Function0.apply$mcV$sp()V+1
j  scala.Function0.apply$mcV$sp$(Lscala/Function0;)V+1
j  scala.runtime.AbstractFunction0.apply$mcV$sp()V+1
j  scala.App.$anonfun$main$1(Lscala/Function0;)V+1
j  scala.App.$anonfun$main$1$adapted(Lscala/Function0;)Ljava/lang/Object;+1
j  scala.App$$Lambda$1.apply(Ljava/lang/Object;)Ljava/lang/Object;+4
j  scala.collection.IterableOnceOps.foreach(Lscala/Function1;)V+26
j  scala.collection.IterableOnceOps.foreach$(Lscala/collection/IterableOnceOps;Lscala/Function1;)V+2
j  scala.collection.AbstractIterable.foreach(Lscala/Function1;)V+2
j  scala.App.main([Ljava/lang/String;)V+18
j  scala.App.main$(Lscala/App;[Ljava/lang/String;)V+2
j  gdal_test_main$.main([Ljava/lang/String;)V+2
j  gdal_test_main.main([Ljava/lang/String;)V+4
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x000000001eed7800 JavaThread "Service Thread" daemon [_thread_blocked, id=596, stack(0x000000001fcb0000,0x000000001fdb0000)]
  0x000000001ee3a800 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=1548, stack(0x000000001fbb0000,0x000000001fcb0000)]
  0x000000001ee3a000 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=20256, stack(0x000000001fab0000,0x000000001fbb0000)]
  0x000000001ee39000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=14672, stack(0x000000001f9b0000,0x000000001fab0000)]
  0x000000001ee35800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=9576, stack(0x000000001f8b0000,0x000000001f9b0000)]
  0x000000001ee0d000 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=20720, stack(0x000000001f7b0000,0x000000001f8b0000)]
  0x000000001ee0a000 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=6984, stack(0x000000001f6b0000,0x000000001f7b0000)]
  0x000000001edfd000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=16964, stack(0x000000001f5b0000,0x000000001f6b0000)]
  0x000000001edef800 JavaThread "Attach Listener" daemon [_thread_blocked, id=19520, stack(0x000000001f4b0000,0x000000001f5b0000)]
  0x000000001ed99000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=20276, stack(0x000000001f3b0000,0x000000001f4b0000)]
  0x000000001cf9b000 JavaThread "Finalizer" daemon [_thread_blocked, id=5112, stack(0x000000001f250000,0x000000001f350000)]
  0x000000001ed70800 JavaThread "Reference Handler" daemon [_thread_blocked, id=6264, stack(0x000000001f150000,0x000000001f250000)]
=>0x00000000033dc000 JavaThread "main" [_thread_in_native, id=20892, stack(0x00000000032d0000,0x00000000033d0000)]

Other Threads:
  0x000000001cf8d000 VMThread [stack: 0x000000001ec50000,0x000000001ed50000] [id=15344]
  0x000000001ef17000 WatcherThread [stack: 0x000000001fdb0000,0x000000001feb0000] [id=1480]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

heap address: 0x00000006c3800000, size: 4040 MB, Compressed Oops mode: Zero based, Oop shift amount: 3
Narrow klass base: 0x0000000000000000, Narrow klass shift: 3
Compressed class space size: 1073741824 Address: 0x00000007c0000000

Heap:
 PSYoungGen      total 75776K, used 26003K [0x000000076bd80000, 0x0000000771200000, 0x00000007c0000000)
  eden space 65024K, 27% used [0x000000076bd80000,0x000000076cf0c6e0,0x000000076fd00000)
  from space 10752K, 74% used [0x000000076fd00000,0x00000007704d85b0,0x0000000770780000)
  to   space 10752K, 0% used [0x0000000770780000,0x0000000770780000,0x0000000771200000)
 ParOldGen       total 173568K, used 8K [0x00000006c3800000, 0x00000006ce180000, 0x000000076bd80000)
  object space 173568K, 0% used [0x00000006c3800000,0x00000006c3802000,0x00000006ce180000)
 Metaspace       used 13880K, capacity 14462K, committed 14592K, reserved 1062912K
  class space    used 1636K, capacity 1705K, committed 1792K, reserved 1048576K

Card table byte_map: [0x00000000129e0000,0x00000000131d0000] byte_map_base: 0x000000000f3c4000

Marking Bits: (ParMarkBitMap*) 0x000000006fbf5ce0
 Begin Bits: [0x0000000013f20000, 0x0000000017e40000)
 End Bits:   [0x0000000017e40000, 0x000000001bd60000)

Polling page: 0x0000000001150000

CodeCache: size=245760Kb used=2601Kb max_used=2601Kb free=243158Kb
 bounds [0x0000000003620000, 0x00000000038b0000, 0x0000000012620000]
 total_blobs=1076 nmethods=534 adapters=463
 compilation: enabled

Compilation events (10 events):
Event: 380.699 Thread 0x000000001ee39000  530       4       java.util.LinkedHashMap$LinkedEntryIterator::next (5 bytes)
Event: 380.700 Thread 0x000000001ee39000 nmethod 530 0x00000000038a7b10 code [0x00000000038a7c60, 0x00000000038a7d78]
Event: 597.009 Thread 0x000000001ee3a800  531  s    3       java.util.Vector::isEmpty (13 bytes)
Event: 597.009 Thread 0x000000001ee3a800 nmethod 531 0x00000000038a75d0 code [0x00000000038a7740, 0x00000000038a7a50]
Event: 676.556 Thread 0x000000001ee3a800  532       3       java.io.DataOutputStream::writeUTF (435 bytes)
Event: 676.558 Thread 0x000000001ee3a800 nmethod 532 0x00000000038ab110 code [0x00000000038ab440, 0x00000000038ad0c8]
Event: 678.243 Thread 0x000000001ee3a800  533       3       java.io.ByteArrayOutputStream::ensureCapacity (16 bytes)
Event: 678.243 Thread 0x000000001ee3a800 nmethod 533 0x00000000038a7190 code [0x00000000038a7300, 0x00000000038a74e8]
Event: 678.243 Thread 0x000000001ee3a800  534       3       java.io.DataOutputStream::incCount (20 bytes)
Event: 678.244 Thread 0x000000001ee3a800 nmethod 534 0x00000000038a6e50 code [0x00000000038a6fa0, 0x00000000038a7130]

GC Heap History (2 events):
Event: 12.197 GC heap before
{Heap before GC invocations=1 (full 0):
 PSYoungGen      total 75776K, used 65024K [0x000000076bd80000, 0x0000000771200000, 0x00000007c0000000)
  eden space 65024K, 100% used [0x000000076bd80000,0x000000076fd00000,0x000000076fd00000)
  from space 10752K, 0% used [0x0000000770780000,0x0000000770780000,0x0000000771200000)
  to   space 10752K, 0% used [0x000000076fd00000,0x000000076fd00000,0x0000000770780000)
 ParOldGen       total 173568K, used 0K [0x00000006c3800000, 0x00000006ce180000, 0x000000076bd80000)
  object space 173568K, 0% used [0x00000006c3800000,0x00000006c3800000,0x00000006ce180000)
 Metaspace       used 10961K, capacity 11282K, committed 11392K, reserved 1058816K
  class space    used 1283K, capacity 1376K, committed 1408K, reserved 1048576K
Event: 12.306 GC heap after
Heap after GC invocations=1 (full 0):
 PSYoungGen      total 75776K, used 8033K [0x000000076bd80000, 0x0000000771200000, 0x00000007c0000000)
  eden space 65024K, 0% used [0x000000076bd80000,0x000000076bd80000,0x000000076fd00000)
  from space 10752K, 74% used [0x000000076fd00000,0x00000007704d85b0,0x0000000770780000)
  to   space 10752K, 0% used [0x0000000770780000,0x0000000770780000,0x0000000771200000)
 ParOldGen       total 173568K, used 8K [0x00000006c3800000, 0x00000006ce180000, 0x000000076bd80000)
  object space 173568K, 0% used [0x00000006c3800000,0x00000006c3802000,0x00000006ce180000)
 Metaspace       used 10961K, capacity 11282K, committed 11392K, reserved 1058816K
  class space    used 1283K, capacity 1376K, committed 1408K, reserved 1048576K
}

Deoptimization events (7 events):
Event: 1.073 Thread 0x00000000033dc000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000000372e904 method=java.lang.String.hashCode()I @ 14
Event: 1.826 Thread 0x00000000033dc000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000000037d8a94 method=java.util.HashMap.getNode(ILjava/lang/Object;)Ljava/util/HashMap$Node; @ 126
Event: 1.847 Thread 0x00000000033dc000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000000037d8a94 method=java.util.HashMap.getNode(ILjava/lang/Object;)Ljava/util/HashMap$Node; @ 126
Event: 1.849 Thread 0x00000000033dc000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000000037d8a94 method=java.util.HashMap.getNode(ILjava/lang/Object;)Ljava/util/HashMap$Node; @ 126
Event: 1.897 Thread 0x00000000033dc000 Uncommon trap: reason=unstable_if action=reinterpret pc=0x000000000373bd6c method=java.lang.String.indexOf(II)I @ 49
Event: 2.027 Thread 0x00000000033dc000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000000037cb71c method=java.util.HashMap.getNode(ILjava/lang/Object;)Ljava/util/HashMap$Node; @ 126
Event: 2.028 Thread 0x00000000033dc000 Uncommon trap: reason=class_check action=maybe_recompile pc=0x00000000037d8a94 method=java.util.HashMap.getNode(ILjava/lang/Object;)Ljava/util/HashMap$Node; @ 126

Classes redefined (0 events):
No events

Internal exceptions (10 events):
Event: 12.485 Thread 0x00000000033dc000 Exception <a 'java/lang/NoSuchMethodError': java.lang.Object.$anonfun$configMemorySizeReader$1(Lpureconfig/ConfigCursor;)Lscala/util/Either;> (0x000000076c45dd20) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u202\12323\hotspot\src\share\v
Event: 12.650 Thread 0x00000000033dc000 Exception <a 'java/lang/NoSuchMethodError': java.lang.Object.$anonfun$load$1(Lpureconfig/ConfigReader;Lpureconfig/ConfigCursor;)Lscala/util/Either;> (0x000000076c6c57e8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u202\12323\hotspot\src\
Event: 12.691 Thread 0x00000000033dc000 Exception <a 'java/lang/NoSuchMethodError': java.lang.Object.$anonfun$andThen$1(Lscala/Function1;Lscala/Function1;Ljava/lang/Object;)Ljava/lang/Object;> (0x000000076c741798) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u202\12323\hotspot\
Event: 12.831 Thread 0x00000000033dc000 Exception <a 'java/lang/NoSuchMethodError': java.lang.Object.$anonfun$toTokens$1(Ljava/lang/String;)Ljava/lang/String;> (0x000000076cab4cb0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u202\12323\hotspot\src\share\vm\interpreter\linkReso
Event: 12.888 Thread 0x00000000033dc000 Exception <a 'java/lang/NoSuchMethodError': java.lang.Object.$anonfun$fluent$1(Lpureconfig/ConfigCursor;Lcom/typesafe/config/ConfigValue;)Lpureconfig/ConfigCursor;> (0x000000076cc02ae8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u202\12
Event: 12.898 Thread 0x00000000033dc000 Exception <a 'java/lang/NoSuchMethodError': java.lang.Object.$anonfun$asListCursor$1(Lcom/typesafe/config/ConfigValue;)Lscala/util/Right;> (0x000000076cc12870) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u202\12323\hotspot\src\share\vm\i
Event: 12.901 Thread 0x00000000033dc000 Exception <a 'java/lang/NoSuchMethodError': java.lang.Object.$anonfun$asListCursor$2(Lpureconfig/ConfigCursor;Lcom/typesafe/config/ConfigList;)Lpureconfig/ConfigListCursor;> (0x000000076cc33b40) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jd
Event: 12.921 Thread 0x00000000033dc000 Exception <a 'java/lang/NoSuchMethodError': java.lang.Object.$anonfun$asString$1(Lcom/typesafe/config/ConfigValue;)Lscala/util/Right;> (0x000000076cc814e8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u202\12323\hotspot\src\share\vm\inter
Event: 12.942 Thread 0x00000000033dc000 Exception <a 'java/lang/NoSuchMethodError': java.lang.Object.$anonfun$asInt$1(Lcom/typesafe/config/ConfigValue;)Lscala/util/Either;> (0x000000076cce90b8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u202\12323\hotspot\src\share\vm\interpr
Event: 225.352 Thread 0x00000000033dc000 Exception <a 'sun/nio/fs/WindowsException'> (0x000000076cdf8160) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u202\12323\hotspot\src\share\vm\prims\jni.cpp, line 710]

Events (10 events):
Event: 679.850 Executing VM operation: GetOrSetLocal
Event: 679.850 Executing VM operation: GetOrSetLocal done
Event: 679.850 Executing VM operation: GetOrSetLocal
Event: 679.850 Executing VM operation: GetOrSetLocal done
Event: 680.377 Executing VM operation: EnterInterpOnlyMode
Event: 680.378 Executing VM operation: EnterInterpOnlyMode done
Event: 680.378 Executing VM operation: GetCurrentLocation
Event: 680.378 Executing VM operation: GetCurrentLocation done
Event: 680.378 Executing VM operation: ChangeSingleStep
Event: 680.378 Executing VM operation: ChangeSingleStep done

Dynamic libraries:
0x00007ff6058c0000 - 0x00007ff6058f7000     D:\Java\jdk1.8.0_202\bin\java.exe
0x00007ffc01f30000 - 0x00007ffc02128000     C:\Windows\SYSTEM32\ntdll.dll
0x00007ffc00ce0000 - 0x00007ffc00d9d000     C:\Windows\System32\KERNEL32.DLL
0x00007ffbff730000 - 0x00007ffbffa26000     C:\Windows\System32\KERNELBASE.dll
0x00007ffbee450000 - 0x00007ffbee4e0000     C:\Windows\SYSTEM32\apphelp.dll
0x00007ffc00da0000 - 0x00007ffc00e53000     C:\Windows\System32\ADVAPI32.dll
0x00007ffc01280000 - 0x00007ffc0131e000     C:\Windows\System32\msvcrt.dll
0x00007ffc01e50000 - 0x00007ffc01eef000     C:\Windows\System32\sechost.dll
0x00007ffc01b40000 - 0x00007ffc01c66000     C:\Windows\System32\RPCRT4.dll
0x00007ffbff600000 - 0x00007ffbff627000     C:\Windows\System32\bcrypt.dll
0x00007ffc01320000 - 0x00007ffc014be000     C:\Windows\System32\USER32.dll
0x00007ffbfff50000 - 0x00007ffbfff72000     C:\Windows\System32\win32u.dll
0x00007ffc014c0000 - 0x00007ffc014ec000     C:\Windows\System32\GDI32.dll
0x00007ffbffe30000 - 0x00007ffbfff4a000     C:\Windows\System32\gdi32full.dll
0x00007ffbffc00000 - 0x00007ffbffc9d000     C:\Windows\System32\msvcp_win.dll
0x00007ffbffca0000 - 0x00007ffbffda0000     C:\Windows\System32\ucrtbase.dll
0x00007ffbe4380000 - 0x00007ffbe461a000     C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.3636_none_60b6a03d71f818d5\COMCTL32.dll
0x00007ffc01e20000 - 0x00007ffc01e50000     C:\Windows\System32\IMM32.DLL
0x00007ffbd82e0000 - 0x00007ffbd830e000     D:\Program Files\MacType\MacType64.dll
0x00007ffbd7d90000 - 0x00007ffbd7dea000     D:\Program Files\MacType\Easyhk64.dll
0x00007ffbd1420000 - 0x00007ffbd1579000     D:\Program Files\MacType\MacType64.Core.dll
0x00007ffbfc660000 - 0x00007ffbfcc20000     C:\Windows\SYSTEM32\d2d1.dll
0x00007ffbfcc20000 - 0x00007ffbfce9f000     C:\Windows\SYSTEM32\dwrite.dll
0x00007ffbffda0000 - 0x00007ffbffe22000     C:\Windows\System32\bcryptPrimitives.dll
0x000000006fc80000 - 0x000000006fd52000     D:\Java\jdk1.8.0_202\jre\bin\msvcr100.dll
0x000000006f3d0000 - 0x000000006fc75000     D:\Java\jdk1.8.0_202\jre\bin\server\jvm.dll
0x00007ffc01c90000 - 0x00007ffc01c98000     C:\Windows\System32\PSAPI.DLL
0x00007ffbddd30000 - 0x00007ffbddd39000     C:\Windows\SYSTEM32\WSOCK32.dll
0x00007ffbf8060000 - 0x00007ffbf8087000     C:\Windows\SYSTEM32\WINMM.dll
0x00007ffbf05b0000 - 0x00007ffbf05ba000     C:\Windows\SYSTEM32\VERSION.dll
0x0000000003260000 - 0x00000000032cb000     C:\Windows\System32\WS2_32.dll
0x00007ffbf6520000 - 0x00007ffbf652f000     D:\Java\jdk1.8.0_202\jre\bin\verify.dll
0x00007ffbe5280000 - 0x00007ffbe52a9000     D:\Java\jdk1.8.0_202\jre\bin\java.dll
0x00007ffbed610000 - 0x00007ffbed645000     D:\Java\jdk1.8.0_202\jre\bin\jdwp.dll
0x00007ffbf4b10000 - 0x00007ffbf4b18000     D:\Java\jdk1.8.0_202\jre\bin\npt.dll
0x00007ffbf4ab0000 - 0x00007ffbf4ad3000     D:\Java\jdk1.8.0_202\jre\bin\instrument.dll
0x00007ffbe5110000 - 0x00007ffbe5126000     D:\Java\jdk1.8.0_202\jre\bin\zip.dll
0x00007ffc00230000 - 0x00007ffc00975000     C:\Windows\System32\SHELL32.dll
0x00007ffbfcfc0000 - 0x00007ffbfd75b000     C:\Windows\SYSTEM32\windows.storage.dll
0x00007ffc00980000 - 0x00007ffc00cd4000     C:\Windows\System32\combase.dll
0x00007ffbfef50000 - 0x00007ffbfef7d000     C:\Windows\SYSTEM32\Wldp.dll
0x00007ffc00180000 - 0x00007ffc0022d000     C:\Windows\System32\SHCORE.dll
0x00007ffc00ed0000 - 0x00007ffc00f25000     C:\Windows\System32\shlwapi.dll
0x00007ffbff530000 - 0x00007ffbff555000     C:\Windows\SYSTEM32\profapi.dll
0x00007ffbf4b00000 - 0x00007ffbf4b09000     D:\Java\jdk1.8.0_202\jre\bin\dt_socket.dll
0x00007ffbfed30000 - 0x00007ffbfed9a000     C:\Windows\system32\mswsock.dll
0x00007ffbe4ce0000 - 0x00007ffbe4d7c000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\gdal\java\gdalalljni.dll
0x00007ffbf0570000 - 0x00007ffbf058b000     C:\Windows\SYSTEM32\VCRUNTIME140.dll
0x00007ffbe1ce0000 - 0x00007ffbe1d6e000     C:\Windows\SYSTEM32\MSVCP140.dll
0x00007ffbf0560000 - 0x00007ffbf056c000     C:\Windows\SYSTEM32\VCRUNTIME140_1.dll
0x00007ffbaa730000 - 0x00007ffbabab2000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\gdal.dll
0x00007ffbffaa0000 - 0x00007ffbffbfd000     C:\Windows\System32\CRYPT32.dll
0x00007ffc00f40000 - 0x00007ffc0106b000     C:\Windows\System32\ole32.dll
0x00007ffc000b0000 - 0x00007ffc0017d000     C:\Windows\System32\OLEAUT32.dll
0x00007ffbe4c10000 - 0x00007ffbe4cd3000     C:\Windows\SYSTEM32\ODBC32.dll
0x00007ffbf4a80000 - 0x00007ffbf4a99000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\zlib.dll
0x00007ffbc15c0000 - 0x00007ffbc16fc000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\libxml2.dll
0x00007ffbc1540000 - 0x00007ffbc15b6000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\libcurl.dll
0x00007ffbb8340000 - 0x00007ffbb8603000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\libcrypto-1_1-x64.dll
0x00007ffc00e70000 - 0x00007ffc00ec6000     C:\Windows\System32\WLDAP32.dll
0x00007ffbbe1e0000 - 0x00007ffbbe28c000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\libssl-1_1-x64.dll
0x00007ffbc14b0000 - 0x00007ffbc1536000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\zstd.dll
0x00007ffbaa3d0000 - 0x00007ffbaa722000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\proj_9_3.dll
0x00007ffbb8220000 - 0x00007ffbb833c000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\tiff.dll
0x00007ffbb2f80000 - 0x00007ffbb31dc000     C:\Windows\SYSTEM32\sqlite3.dll
0x0000000180000000 - 0x000000018004e000     C:\Windows\SYSTEM32\LIBPQ.dll
0x00007ffbaa110000 - 0x00007ffbaa3ce000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\xerces-c_3_2.dll
0x00007ffbddde0000 - 0x00007ffbdde14000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\libpng16.dll
0x00007ffbca3e0000 - 0x00007ffbca431000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\openjp2.dll
0x00007ffbed5f0000 - 0x00007ffbed60f000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\pcre.dll
0x00007ffbcfb70000 - 0x00007ffbcfb98000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\freexl.dll
0x00007ffba9d10000 - 0x00007ffbaa108000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\libmysql.dll
0x00007ffbc87f0000 - 0x00007ffbc8812000     C:\Windows\SYSTEM32\ogdi.dll
0x00007ffbc8530000 - 0x00007ffbc8559000     C:\Windows\SYSTEM32\libexpat.dll
0x00007ffbc1380000 - 0x00007ffbc13dc000     C:\Windows\SYSTEM32\geos_c.dll
0x00007ffbb6410000 - 0x00007ffbb650f000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\iconv-2.dll
0x00007ffbe3c10000 - 0x00007ffbe3c1c000     C:\Windows\SYSTEM32\Secur32.dll
0x00007ffba9b30000 - 0x00007ffba9d04000     C:\Windows\SYSTEM32\geos.dll
0x00007ffbff3f0000 - 0x00007ffbff3fa000     C:\Windows\SYSTEM32\DPAPI.DLL
0x00007ffbff4b0000 - 0x00007ffbff4e2000     C:\Windows\SYSTEM32\SSPICLI.DLL
0x00007ffba8ec0000 - 0x00007ffba9b29000     C:\Windows\SYSTEM32\spatialite.dll
0x00007ffba8b80000 - 0x00007ffba8eb9000     D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\proj_9_1.dll
0x00007ffbe50f0000 - 0x00007ffbe510a000     D:\Java\jdk1.8.0_202\jre\bin\net.dll
0x00007ffbebd30000 - 0x00007ffbebf1d000     C:\Windows\SYSTEM32\urlmon.dll
0x00007ffbf0f40000 - 0x00007ffbf11fc000     C:\Windows\SYSTEM32\iertutil.dll
0x00007ffbfe2b0000 - 0x00007ffbfe2d8000     C:\Windows\SYSTEM32\srvcli.dll
0x00007ffbfeb50000 - 0x00007ffbfeb5c000     C:\Windows\SYSTEM32\netutils.dll
0x00007ffbe50d0000 - 0x00007ffbe50e2000     D:\Java\jdk1.8.0_202\jre\bin\nio.dll
0x0000000061540000 - 0x0000000061810000     C:\Users\shenyongjie\AppData\Local\Temp\nativeutils1099427648966000\gdalwarp_bindings-amd64.dll
0x00007ffbfd760000 - 0x00007ffbfd944000     C:\Windows\system32\DBGHELP.DLL
0x00007ffbf8020000 - 0x00007ffbf8054000     C:\Windows\SYSTEM32\dbgcore.DLL

VM Arguments:
jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:62191,suspend=y,server=n -XX:+CreateMinidumpOnCrash -Dsun.io.useCanonPrefixCache=false -javaagent:C:\Users\shenyongjie\AppData\Local\JetBrains\IntelliJIdea2023.1\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 
java_command: gdal_test_main
java_class_path (initial): D:\Java\jdk1.8.0_202\jre\lib\charsets.jar;D:\Java\jdk1.8.0_202\jre\lib\deploy.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\access-bridge-64.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\cldrdata.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\dnsns.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\jaccess.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\jfxrt.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\localedata.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\nashorn.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\sunec.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\sunjce_provider.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\sunmscapi.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\sunpkcs11.jar;D:\Java\jdk1.8.0_202\jre\lib\ext\zipfs.jar;D:\Java\jdk1.8.0_202\jre\lib\javaws.jar;D:\Java\jdk1.8.0_202\jre\lib\jce.jar;D:\Java\jdk1.8.0_202\jre\lib\jfr.jar;D:\Java\jdk1.8.0_202\jre\lib\jfxswt.jar;D:\Java\jdk1.8.0_202\jre\lib\jsse.jar;D:\Java\jdk1.8.0_202\jre\lib\management-agent.jar;D:\Java\jdk1.8.0_202\jre\lib\plugin.jar;D:\Java\jdk1.8.0_202\jre\lib\resources.jar;D:\Java\jdk1.8.0_202\jre\lib\rt.jar;D:\Code\IDEA\sg_demo\target\scala-2.13\classes;C:\Users\shenyongjie\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\co\fs2\fs2-core_2.13\2.5.10\fs2-core_2.13-2.5.10.jar;C:\Users\shenyongjie\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\co\fs2\fs2-io_2.13\2.5.10\fs2-io_2.13-2.5.10.jar;C:\Users\shenyongjie\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\azavea\geotrellis\gdal-warp-bindings\3.8.0\gdal-warp-bindings-3.8.0.jar;C:\Users\shenyongjie\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\chuusai\shapeless_2.13\2.3.7\shapeless_2.13-2.3.7.jar;C:\Users\shenyongjie\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\clearspring\analytics\stream\2.9.6\stream-2.9.6.jar;C:\Users\shenyongjie\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\maven2\com\esotericsoftware\kryo-shaded\4.0.2\kryo-shaded-4.0.2.jar;C:\Users\shenyongjie\AppData\Local\Coursier\cache\v1\https\repo1.maven.org\mave
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=D:\Java\jdk1.8.0_202
PATH=D:\Java\jdk1.8.0_202\bin;D:\Java\jdk1.8.0_202\jre\bin;D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin;D:\src\src_hub\gdal\gdal_mapserver\gdal_381_mapserver_801_release_msvc2017_x64\bin\gdal\java;D:\Program Files\VMware16.2.5\bin\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;D:\Program Files\Git\cmd;D:\Program Files\mingw-w64\mingw64\bin;D:\Program Files\Go\bin;C:\Program Files\CMake\bin;D:\Program Files (x86)\Visual Leak Detector\bin\Win32;D:\Program Files (x86)\Visual Leak Detector\bin\Win64;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;D:\ProgramData\anaconda3;D:\ProgramData\anaconda3\Scripts;D:\ProgramData\anaconda3\Library\mingw-w64\bin;D:\ProgramData\anaconda3\Library\usr\bin;D:\ProgramData\anaconda3\Library\bin;D:\Program Files (x86)\GnuWin32\bin;C:\Program Files\Docker\Docker\resources\bin;C:\Users\shenyongjie\AppData\Local\Microsoft\WindowsApps;%IntelliJ IDEA Community Edition%;D:\Program Files\JetBrains\IntelliJ IDEA 2023.1.3\bin;d:\Program Files\JetBrains\PyCharm Community Edition 2022.2.2\bin;C:\Users\shenyongjie\go\bin;D:\Program Files\Microsoft VS Code\bin
USERNAME=shenyongjie
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 12, GenuineIntel

---------------  S Y S T E M  ---------------

OS: Windows 10.0 , 64 bit Build 19041 (10.0.19041.3636)

CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 142 stepping 12, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx

Memory: 4k page, physical 16539892k(5230660k free), swap 23355636k(11486376k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (25.202-b08) for windows-amd64 JRE (1.8.0_202-b08), built on Dec 15 2018 19:54:30 by "java_re" with MS VC++ 10.0 (VS2010)

time: Sun Feb 18 09:20:53 2024
timezone: �й���׼ʱ��
elapsed time: 687 seconds (0d 0h 11m 27s)

Environment

pomadchin commented 9 months ago

🤔 hmm, what gdal-warp-bindings version is used? for the 3.8.0 release we used release-1916-x64-gdal-3-8-1-mapserver-8-0-1-libs.zip indeed so it looks like that's all good.

The error is related to the java.lang.ClassLoader$NativeLibrary.load(Ljava/lang/String;Z)V+0 meaning that the native library was not able to properly load. Could be various of reasons ~ bad dynamic lib paths / the lack of smth in the classapath / etc.

Have you tried to load the GDAL dll from the warp archive manually via System.load? It usually gives a more detailed error.

I also noticed a lot of java/lang/NoSuchMethodError in the dump as well that are not related (?) to this issue.

Whats the purpose of org.gdal.ogr.ogr & org.gdal.gdal.gdal imports?

Does the regular gdal bindings lib (not this repo but the official gdal bindings) work on your system?

syjjj0826 commented 9 months ago

@pomadchin Thanks for your reply :)

I do using gdal-warp-bindings version==3.8.0 libraryDependencies += "com.azavea.geotrellis" % "gdal-warp-bindings" % "3.8.0" added in my build.sbt

I have checked the dynamic libraries that the project depends on and tried to align the dependency versions as much as possible according to the Docker build environment control in the gdalwarp_bindings project. However, when my local project attempts to load gdalwarp_bindings-amd64.dll, the program exits unexpectedly with the message Process finished with exit code -1073741819 (0xC0000005)

I have also copied a duplicate of gdalwarp_bindings-amd64.dll from the temporary files separately and attempted to load it using System.load(), but the program still exited unexpectedly.

import geotrellis.raster.gdal._

object gdalwarpbindings_test extends App {
  System.load("C:\\Users\\syj\\Desktop\\gdalwarp_bindings-amd64.dll")
  val url = "D:\\Code\\IDEA\\sg_demo\\data\\LC80140322014139LGN00.tif"
  val ds: GDALDataset = GDALDataset(url)
  val meta = ds.getMetadataDomainList(1)
  System.out.println(meta)
}

Process finished with exit code -1073741819 (0xC0000005)

Importing org.gdal.ogr.ogr and org.gdal.gdal.gdal is to get the error log, I found I can keep the log when I using ogr.RegisterAll().If not, I will just receive the simple message Process finished with exit code -1073741819 (0xC0000005).It's possible that my approach is incorrect.

Does the regular gdal bindings lib (not this repo but the official gdal bindings) work on your system? Regarding this issue, are you referring to some of the executable programs located in the "/bin/gdal/apps" directory of ''release-1916-x64-gdal-3-8-1-mapserver-8-0-1.zip'' archive? Such as gdalinfo.exe gdalwarp.exe, if so, I have already verified their availability.

I also noticed a lot of in the dump as well that are not related (?) to this issue.java/lang/NoSuchMethodError Regarding this error log, I am still investigating related errors. Thank you for pointing it out.

pomadchin commented 9 months ago

@syjjj0826 are you able to read tiffs via GDAL using official GDAL bindings without the use of geotrellis gdal-warp-bindings?

i.e. doing smth like

val ds = org.gdal.gdal.gdal.Open(filePath, org.gdal.gdalconst.gdalconstConstants.GA_ReadOnly)
val transform = ds.GetGeoTransform
val width = ds.GetRasterXSize
val height = ds.GetRasterYSize
pomadchin commented 9 months ago

The reason I ask -- want to check if that's an issue of our lib or not. + ogr.RegisterAll() may conflict with our lib / double registering the same dllsthe dump by itself. So to reduce noise I want to ensure that its gdal-warp-bindings issue, not a general issue with GDAL.

syjjj0826 commented 9 months ago

@pomadchin I tried the example you provided, and it can achieve simple TIFF reading via GDAL

object test extends App{
  org.gdal.ogr.ogr.RegisterAll()
  val filePath = "D:\\Code\\IDEA\\sg_demo\\data\\LC80140322014139LGN00.tif"
  val ds = org.gdal.gdal.gdal.Open(filePath, org.gdal.gdalconst.gdalconstConstants.GA_ReadOnly)
  val transform = ds.GetGeoTransform
  val width = ds.GetRasterXSize
  val height = ds.GetRasterYSize
  System.out.println("ok")
}

And I also attempted to remove the relevant gdal bindings lib from the project, only using gdal_warp_bindings. However, the result is still the same: after copying the gdalwarp_bindings-amd64.dll from gdal_warp_bindings:3.8.0.jar to a temporary file, it fails to proceed with the next loading step.

 // cz.adamh.utils  NativeUtils.java
 ...
 NativeLibrary lib = new NativeLibrary(fromClass, name, isBuiltin);
  nativeLibraryContext.push(lib);
  try {
      lib.load(name, isBuiltin);
  }
 ...

Did I overlook adding any other dependencies?If it's convenient, could you provide a list of the basic development environment for me to check?

pomadchin commented 9 months ago

@syjjj0826 thanks for confirming that that's our bindings issue.

Ouf sadly we don't have any docs around building dlls for windows; crossbuild is used to build windows binaries.

There is indeed a solid chance it works under some specific circumstances only, Windows env is not really tested well.

However, that's the Makefile to build and test bindings. In the proper Windows env with slightly adjusted env variables its possible to test just using the Makefile commands.

An alternative can be to rebuild crossbuild docker image and try it on your local machine to see if its failing (i.e. could be a sepcific built and currently used in CI docker image failure).

Sorry for these sad news, will really appreciate if you're able to help with investigating the reasons of this failure. I'll try to find some time to spin it up on my Win machine as well.

syjjj0826 commented 9 months ago

@pomadchin Despite feeling somewhat helpless upon hearing this news, I will persist in trying to resolve the issue based on the suggestions you provided. If I make progress in addressing the problem, I will continue to comment here. Thank you for your responses over the past two days.

syjjj0826 commented 8 months ago

Hey there: I tried modifying some source code and compiled it into the usable binding files. I think this should be feasible for debugging projects solely in a Windows environment. 😃

pomadchin commented 8 months ago

Hi @syjjj0826, great news! Will be happy to see a PR against this repo to address build issues :+1: