Debug Assertion Failed in File "xtree"

This error has occurred to me while running various JOCL samples and my own code. I've deleted the lines that did the assertion, but the error still persisted afterwards. I have also restarted my computer after deleting the lines, and the same error occurred after restart. After uninstalling Visual Studio 2019 and thus all of the include files of MSCV including xtree, running the program causes this error. I wonder if the problem is somehow related to Eclipse? It is important to note that the kernel seems to run okay; its just this annoying error message pops up whenever I run the host program.
(And once more: Sorry for the delay...)
This is not good... it looks like a basic, conceptual error of how a map is used at a certain point in the native code. I have to admit that I usually don't compile the DLL in debug mode, but I should definitely do this to catch more possible bugs.
I'll have to take a closer look at this, maybe together with the update to OpenCL 3.0. Thanks for the report.
Here's a look at the log file created when you press retry on the dialog above.
A fatal error has been detected by the Java Runtime Environment:
Internal Error (os_windows_x86.cpp:144), pid=11064, tid=0x000000000000333c guarantee(result == EXCEPTION_CONTINUE_EXECUTION) failed: Unexpected result from topLevelExceptionFilter
JRE version: Java(TM) SE Runtime Environment (8.0_251-b08) (build 1.8.0_251-b08) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.251-b08 mixed mode windows-amd64 compressed oops) Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
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 (0x000000000279e800): JavaThread "main" [_thread_in_native, id=13116, stack(0x00000000025d0000,0x00000000026d0000)]
Stack: [0x00000000025d0000,0x00000000026d0000] [error occurred during error reporting (printing stack bounds), id 0xc0000005]
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 org.jocl.CL.clReleaseContextNative(Lorg/jocl/cl_context;)I+0
j org.jocl.CL.clReleaseContext(Lorg/jocl/cl_context;)I+1
j AlphaGPU._MaxT_GPU()V+531
j AlphaGPU.
--------------- P R O C E S S ---------------
Java Threads: ( => current thread ) 0x000000001e3af000 JavaThread "Service Thread" daemon [_thread_blocked, id=15964, stack(0x0000000020c10000,0x0000000020d10000)] 0x000000001e32a800 JavaThread "C1 CompilerThread11" daemon [_thread_blocked, id=14496, stack(0x0000000020b10000,0x0000000020c10000)] 0x000000001e32d800 JavaThread "C1 CompilerThread10" daemon [_thread_blocked, id=15140, stack(0x0000000020a10000,0x0000000020b10000)] 0x000000001e327800 JavaThread "C1 CompilerThread9" daemon [_thread_blocked, id=15972, stack(0x0000000020810000,0x0000000020910000)] 0x000000001e32a000 JavaThread "C1 CompilerThread8" daemon [_thread_blocked, id=13896, stack(0x0000000020710000,0x0000000020810000)] 0x000000001e327000 JavaThread "C2 CompilerThread7" daemon [_thread_blocked, id=17612, stack(0x0000000020610000,0x0000000020710000)] 0x000000001e329000 JavaThread "C2 CompilerThread6" daemon [_thread_blocked, id=12372, stack(0x0000000020510000,0x0000000020610000)] 0x000000001e303800 JavaThread "C2 CompilerThread5" daemon [_thread_blocked, id=17064, stack(0x0000000020410000,0x0000000020510000)] 0x000000001e2cf000 JavaThread "C2 CompilerThread4" daemon [_thread_blocked, id=12644, stack(0x0000000020310000,0x0000000020410000)] 0x000000001e2ce000 JavaThread "C2 CompilerThread3" daemon [_thread_blocked, id=6632, stack(0x0000000020210000,0x0000000020310000)] 0x000000001e2cb800 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=15584, stack(0x0000000020110000,0x0000000020210000)] 0x000000001e2b7000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=1152, stack(0x0000000020010000,0x0000000020110000)] 0x000000001e2b4800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=12964, stack(0x000000001ff10000,0x0000000020010000)] 0x000000001e2b3000 JavaThread "Attach Listener" daemon [_thread_blocked, id=14792, stack(0x000000001fe10000,0x000000001ff10000)] 0x000000001c82a800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=10988, stack(0x000000001fd10000,0x000000001fe10000)] 0x000000001c826000 JavaThread "Finalizer" daemon [_thread_blocked, id=8816, stack(0x000000001fb10000,0x000000001fc10000)] 0x000000001c81f800 JavaThread "Reference Handler" daemon [_thread_blocked, id=15708, stack(0x000000001fa10000,0x000000001fb10000)] =>0x000000000279e800 JavaThread "main" [_thread_in_native, id=13116, stack(0x00000000025d0000,0x00000000026d0000)]
Other Threads: 0x000000001e283800 VMThread [stack: 0x000000001f910000,0x000000001fa10000] [id=7664] 0x000000001e393000 WatcherThread [stack: 0x0000000020d10000,0x0000000020e10000] [id=17604]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
heap address: 0x00000006c1000000, size: 4080 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 76288K, used 2621K [0x000000076b000000, 0x0000000770500000, 0x00000007c0000000) eden space 65536K, 4% used [0x000000076b000000,0x000000076b28f5e8,0x000000076f000000) from space 10752K, 0% used [0x000000076fa80000,0x000000076fa80000,0x0000000770500000) to space 10752K, 0% used [0x000000076f000000,0x000000076f000000,0x000000076fa80000) ParOldGen total 175104K, used 0K [0x00000006c1000000, 0x00000006cbb00000, 0x000000076b000000) object space 175104K, 0% used [0x00000006c1000000,0x00000006c1000000,0x00000006cbb00000) Metaspace used 3687K, capacity 4728K, committed 4864K, reserved 1056768K class space used 402K, capacity 424K, committed 512K, reserved 1048576K
Card table byte_map: [0x0000000011c60000,0x0000000012460000] byte_map_base: 0x000000000e658000
Marking Bits: (ParMarkBitMap*) 0x000000006024af90 Begin Bits: [0x00000000136b0000, 0x0000000017670000) End Bits: [0x0000000017670000, 0x000000001b630000)
Polling page: 0x0000000000ca0000
CodeCache: size=245760Kb used=2919Kb max_used=2919Kb free=242841Kb bounds [0x00000000028a0000, 0x0000000002b80000, 0x00000000118a0000] total_blobs=366 nmethods=80 adapters=197 compilation: enabled
Compilation events (10 events): Event: 0.109 Thread 0x000000001e327800 76 1 java.security.ProtectionDomain::getCodeSource (5 bytes) Event: 0.109 Thread 0x000000001e327800 nmethod 76 0x0000000002b77690 code [0x0000000002b777e0, 0x0000000002b778f0] Event: 0.110 Thread 0x000000001e32a000 77 3 java.lang.ClassLoader::checkName (43 bytes) Event: 0.110 Thread 0x000000001e32a800 78 3 sun.misc.VM::allowArraySyntax (4 bytes) Event: 0.110 Thread 0x000000001e32a800 nmethod 78 0x0000000002b77fd0 code [0x0000000002b78120, 0x0000000002b78270] Event: 0.110 Thread 0x000000001e32a000 nmethod 77 0x0000000002b782d0 code [0x0000000002b78480, 0x0000000002b78bf8] Event: 0.211 Thread 0x000000001e32d800 79 3 java.lang.String::replace (127 bytes) Event: 0.211 Thread 0x000000001e32a800 80 3 java.util.concurrent.ConcurrentHashMap::spread (10 bytes) Event: 0.211 Thread 0x000000001e32a800 nmethod 80 0x0000000002b78e90 code [0x0000000002b78fe0, 0x0000000002b79130] Event: 0.211 Thread 0x000000001e32d800 nmethod 79 0x0000000002b79190 code [0x0000000002b79340, 0x0000000002b799f0]
GC Heap History (0 events): No events
Deoptimization events (0 events): No events
Classes redefined (0 events): No events
Internal exceptions (2 events): Event: 0.027 Thread 0x000000000279e800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x000000076b007cc0) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u251\737\hots Event: 0.027 Thread 0x000000000279e800 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x000000076b007fa8) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u251\737\hotspot\src\share\vm\p
Events (10 events): Event: 0.208 loading class org/jocl/cl_context_properties Event: 0.208 loading class org/jocl/cl_context_properties done Event: 0.209 loading class org/jocl/cl_abstract_properties Event: 0.209 loading class org/jocl/cl_abstract_properties done Event: 0.209 loading class java/nio/HeapLongBuffer Event: 0.209 loading class java/nio/HeapLongBuffer done Event: 0.210 loading class sun/misc/FloatingDecimal$ASCIIToBinaryBuffer Event: 0.210 loading class sun/misc/FloatingDecimal$ASCIIToBinaryBuffer done Event: 0.211 loading class org/jocl/cl_queue_properties Event: 0.211 loading class org/jocl/cl_queue_properties done
Dynamic libraries: 0x00007ff62c090000 - 0x00007ff62c0c7000 C:\Program Files\Java\jdk1.8.0_251\bin\java.exe 0x00007ff9f33a0000 - 0x00007ff9f3590000 C:\WINDOWS\SYSTEM32\ntdll.dll 0x00007ff9ecbb0000 - 0x00007ff9ecbc2000 C:\Program Files\Avast Software\Avast\aswhook.dll 0x00007ff9f22a0000 - 0x00007ff9f2352000 C:\WINDOWS\System32\KERNEL32.DLL 0x00007ff9f0320000 - 0x00007ff9f05c4000 C:\WINDOWS\System32\KERNELBASE.dll 0x00007ff9f3070000 - 0x00007ff9f3113000 C:\WINDOWS\System32\ADVAPI32.dll 0x00007ff9f2170000 - 0x00007ff9f220e000 C:\WINDOWS\System32\msvcrt.dll 0x00007ff9f32c0000 - 0x00007ff9f3357000 C:\WINDOWS\System32\sechost.dll 0x00007ff9f17b0000 - 0x00007ff9f18d0000 C:\WINDOWS\System32\RPCRT4.dll 0x00007ff9f1fd0000 - 0x00007ff9f2165000 C:\WINDOWS\System32\USER32.dll 0x00007ff9f0c90000 - 0x00007ff9f0cb1000 C:\WINDOWS\System32\win32u.dll 0x00007ff9f2b30000 - 0x00007ff9f2b56000 C:\WINDOWS\System32\GDI32.dll 0x00007ff9f0aa0000 - 0x00007ff9f0c36000 C:\WINDOWS\System32\gdi32full.dll 0x00007ff9f05d0000 - 0x00007ff9f066e000 C:\WINDOWS\System32\msvcp_win.dll 0x00007ff9f08a0000 - 0x00007ff9f099a000 C:\WINDOWS\System32\ucrtbase.dll 0x00007ff9e38d0000 - 0x00007ff9e3b54000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.18362.1016_none_9e7a36bbe461dae4\COMCTL32.dll 0x00007ff9f2d30000 - 0x00007ff9f3065000 C:\WINDOWS\System32\combase.dll 0x00007ff9f07c0000 - 0x00007ff9f0840000 C:\WINDOWS\System32\bcryptPrimitives.dll 0x00007ff9f2210000 - 0x00007ff9f223e000 C:\WINDOWS\System32\IMM32.DLL 0x0000000061810000 - 0x00000000618e2000 C:\Program Files\Java\jdk1.8.0_251\jre\bin\msvcr100.dll 0x000000005fa20000 - 0x00000000602cb000 C:\Program Files\Java\jdk1.8.0_251\jre\bin\server\jvm.dll 0x00007ff9f23d0000 - 0x00007ff9f23d8000 C:\WINDOWS\System32\PSAPI.DLL 0x00007ff9e2440000 - 0x00007ff9e2449000 C:\WINDOWS\SYSTEM32\WSOCK32.dll 0x00007ff9f2b60000 - 0x00007ff9f2bcf000 C:\WINDOWS\System32\WS2_32.dll 0x00007ff9ee2b0000 - 0x00007ff9ee2d4000 C:\WINDOWS\SYSTEM32\WINMM.dll 0x00007ff9e87f0000 - 0x00007ff9e87fa000 C:\WINDOWS\SYSTEM32\VERSION.dll 0x00007ff9ee280000 - 0x00007ff9ee2ad000 C:\WINDOWS\SYSTEM32\WINMMBASE.dll 0x00007ff9f0a50000 - 0x00007ff9f0a9a000 C:\WINDOWS\System32\cfgmgr32.dll 0x00007ff9e2b20000 - 0x00007ff9e2b2f000 C:\Program Files\Java\jdk1.8.0_251\jre\bin\verify.dll 0x00007ff9db8e0000 - 0x00007ff9db909000 C:\Program Files\Java\jdk1.8.0_251\jre\bin\java.dll 0x00007ff9dde80000 - 0x00007ff9dde96000 C:\Program Files\Java\jdk1.8.0_251\jre\bin\zip.dll 0x00007ff9f18d0000 - 0x00007ff9f1fb7000 C:\WINDOWS\System32\SHELL32.dll 0x00007ff9f2c80000 - 0x00007ff9f2d29000 C:\WINDOWS\System32\shcore.dll 0x00007ff9f0cc0000 - 0x00007ff9f1442000 C:\WINDOWS\System32\windows.storage.dll 0x00007ff9f0260000 - 0x00007ff9f0283000 C:\WINDOWS\System32\profapi.dll 0x00007ff9f0290000 - 0x00007ff9f02da000 C:\WINDOWS\System32\powrprof.dll 0x00007ff9f0250000 - 0x00007ff9f0260000 C:\WINDOWS\System32\UMPDC.dll 0x00007ff9f2920000 - 0x00007ff9f2972000 C:\WINDOWS\System32\shlwapi.dll 0x00007ff9f0300000 - 0x00007ff9f0311000 C:\WINDOWS\System32\kernel.appcore.dll 0x00007ff9f0c40000 - 0x00007ff9f0c57000 C:\WINDOWS\System32\cryptsp.dll 0x00007ff9a6cb0000 - 0x00007ff9a6e03000 C:\Users\tpave\DLLs\JOCL_2_0_1-windows-x86_64.dll 0x00007ff9a82c0000 - 0x00007ff9a82df000 C:\WINDOWS\SYSTEM32\OpenCL.dll 0x00007ff9f1650000 - 0x00007ff9f17a7000 C:\WINDOWS\System32\ole32.dll 0x00007ff9eee90000 - 0x00007ff9eeeb0000 C:\WINDOWS\SYSTEM32\dxcore.dll 0x00007ff9a8a30000 - 0x00007ff9ad5db000 C:\WINDOWS\System32\DriverStore\FileRepository\u0355311.inf_amd64_183b8d63847c90cf\B355199\amdocl64.dll 0x00007ff9f24b0000 - 0x00007ff9f2920000 C:\WINDOWS\System32\SETUPAPI.dll 0x00007ff9f0c60000 - 0x00007ff9f0c86000 C:\WINDOWS\System32\bcrypt.dll 0x00007ff9aeef0000 - 0x00007ff9af046000 C:\WINDOWS\SYSTEM32\OPENGL32.dll 0x00007ff9ae510000 - 0x00007ff9ae53c000 C:\WINDOWS\SYSTEM32\GLU32.dll 0x00007ff9a71f0000 - 0x00007ff9a739e000 C:\WINDOWS\System32\DriverStore\FileRepository\u0355311.inf_amd64_183b8d63847c90cf\B355199\atiadlxx.dll 0x00007ff9ecbd0000 - 0x00007ff9eccc0000 C:\WINDOWS\SYSTEM32\PROPSYS.dll 0x00007ff9f23e0000 - 0x00007ff9f24a5000 C:\WINDOWS\System32\OLEAUT32.dll 0x00007ff9f0050000 - 0x00007ff9f007a000 C:\WINDOWS\SYSTEM32\DEVOBJ.dll 0x00007ff9f0840000 - 0x00007ff9f089c000 C:\WINDOWS\System32\WINTRUST.dll 0x00007ff9f02e0000 - 0x00007ff9f02f2000 C:\WINDOWS\System32\MSASN1.dll 0x00007ff9f0670000 - 0x00007ff9f07b9000 C:\WINDOWS\System32\CRYPT32.dll 0x00007ff9eeaa0000 - 0x00007ff9eeacd000 C:\WINDOWS\SYSTEM32\dwmapi.dll 0x00007ff9a83e0000 - 0x00007ff9a841a000 C:\WINDOWS\System32\DriverStore\FileRepository\u0355311.inf_amd64_183b8d63847c90cf\B355199\atig6txx.dll 0x00007ff99ca20000 - 0x00007ff99e420000 C:\WINDOWS\System32\DriverStore\FileRepository\u0355311.inf_amd64_183b8d63847c90cf\B355199\amdocl12cl64.dll 0x00007ff9e7ec0000 - 0x00007ff9e80b4000 C:\WINDOWS\SYSTEM32\dbghelp.dll 0x00007ff98cf00000 - 0x00007ff990b42000 C:\WINDOWS\System32\DriverStore\FileRepository\u0355311.inf_amd64_183b8d63847c90cf\B355199\amd_comgr.dll 0x00007ff9ee590000 - 0x00007ff9ee629000 C:\WINDOWS\system32\uxtheme.dll 0x00007ff9f3120000 - 0x00007ff9f3255000 C:\WINDOWS\System32\MSCTF.dll 0x00007ff9e7460000 - 0x00007ff9e74fe000 C:\WINDOWS\System32\TextInputFramework.dll 0x00007ff9ea030000 - 0x00007ff9ea35a000 C:\WINDOWS\System32\CoreUIComponents.dll 0x00007ff9edf10000 - 0x00007ff9edfe4000 C:\WINDOWS\System32\CoreMessaging.dll 0x00007ff9ef280000 - 0x00007ff9ef2b1000 C:\WINDOWS\SYSTEM32\ntmarta.dll 0x00007ff9eb9b0000 - 0x00007ff9ebb03000 C:\WINDOWS\SYSTEM32\wintypes.dll 0x00007ff9e5980000 - 0x00007ff9e5c26000 C:\WINDOWS\System32\iertutil.dll
VM Arguments: java_command: C:\Users\tpave\Desktop\AlphaGPU.exe java_class_path (initial): C:\Users\tpave\Desktop\AlphaGPU.exe Launcher Type: SUN_STANDARD
Environment Variables: JAVA_HOME=C:\Program Files\Java\jdk1.8.0_251 PATH=C:\Users\tpave\Desktop\Vulkan\1.2.148.1\Bin;C:\Users\tpave\Downloads\Windows Kits\10\WDK\Installers;C:\Users\tpave\Desktop\OpenCL\OpenCL-Headers\CL;C:\Program Files\Maven\apache-maven-3.6.3\bin;C:\Program Files\Java\jdk1.8.0_251\include;C:\Program Files (x86)\Python\Scripts;C:\Program Files (x86)\Python;C:\Program Files\CMake\bin;C:\Users\tpave\DLLs;C:\Program Files\Git\bin;C:\Program Files\Java\jdk1.8.0_251\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Users\tpave\AppData\Local\Programs\Python\Launcher;C:\Users\tpave\AppData\Local\Microsoft\WindowsApps;C:\Users\tpave\DLLs;;C:\Program Files\Java\jdk1.8.0_251\bin USERNAME=tpave OS=Windows_NT PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 8 Stepping 2, AuthenticAMD
--------------- S Y S T E M ---------------
OS: Windows 10.0 , 64 bit Build 18362 (10.0.18362.959)
CPU:total 16 (initial active 16) (16 cores per cpu, 1 threads per core) family 23 model 8 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, mmxext, 3dnowpref, lzcnt, sse4a, tsc, tscinvbit, tscinv, bmi1
Memory: 4k page, physical 16708320k(10444664k free), swap 23986964k(12373800k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (25.251-b08) for windows-amd64 JRE (1.8.0_251-b08), built on Mar 12 2020 06:31:49 by "" with MS VC++ 10.0 (VS2010)
time: Mon Sep 07 08:48:27 2020 timezone: Central Daylight Time elapsed time: 1 seconds (0d 0h 0m 1s)
Thanks again, I'll have to allocate some time to try this out. I think it is due to a wrong usage of iterators in https://github.com/gpu/JOCLCommon/blob/master/src/main/native/CLJNIUtils.cpp#L792 (and a first guess would be that the erase call might be the culprit here, "invalidating" the iterator - so it might be just a matter of swapping two lines). But first, I'll have to try out whether I can reporoduce this in debug mode.
Hello Marco, I was wondering how you deduced this conclusion. Was it from past experience with the JOCL you created, the log file, or testing you have already done? I am just trying to follow your thought process to learn something possibly. I already created an executable file from launch4j to debug the dll with, but I have not found any culprit yet. I have been busy with schoolwork and my girl. I have not looked in CLJNIUtils.cpp yet, but its true the JNI naming conventions are giving me a headache. I guess you get used to it after a while -- like the Matrix.
Until now, it was only a guess, but ... the search space should be small: I think this is the only place where I'm using a value-initialized iterator at all.
There's not much necessity to use actual C++-features in JOCL. In the end, OpenCL is plainly C-based. But the callbacks that may be associated with a CL context have to be maintained somehow, The CallbackInfo essentially stores everything that is required to call (back) the Java function from C. This has to be cleaned up then the context is destroyed. I thought that a map from the cl_context values to the CallbackInfo values might make sense there.