[SOLVED] Maple_Upload.bat : EXCEPTION_ACCESS_VIOLATION
Posted: Sun Aug 09, 2020 12:32 pm
Hi all,
just in case anyone encounters the same problem i had...
I successfully used Arduino UI to program my bluepill board using "STM32duino bootloader" (which i serial-loaded to the board before).
After some weeks of playing around with other boards i found that uploading a sketch resulted in
C:\Users\xyz\Documents\Arduino\hardware\Arduino_STM32/tools/win/maple_upload.bat COM12 2 1EAF:0003 C:\Users\xyz\AppData\Local\Temp\arduino_build_457508/Blink.ino.bin
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=12636, tid=0x0000000000003c0c
#
# JRE version: Java(TM) SE Runtime Environment (8.0_261-b12) (build 1.8.0_261-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.261-b12 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [jSSC-2.8_x86_64.dll+0xb5db]
a bit down in the crash log i found:
Internal exceptions (2 events):
Event: 0.024 Thread 0x0000022c00dd4000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x000000066b187cc0) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u261\295\hots
Event: 0.024 Thread 0x0000022c00dd4000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x000000066b187fa8) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u261\295\hotspot\src\share\vm\p
Events (10 events):
Event: 0.067 loading class jssc/SerialPort$LinuxEventThread
Event: 0.067 loading class jssc/SerialPort$LinuxEventThread done
Event: 0.067 loading class jssc/SerialPortTimeoutException
Event: 0.067 loading class jssc/SerialPortTimeoutException done
Event: 0.067 loading class java/lang/NoSuchMethodException
Updating libraries and reading a bit i found that arduino should come with its own java version and use that... unfornately, that doesn't appy to the maple_upload.bat!
My "default" java installation currenty is java 1.8.0.261.
If found that the latest Arduino IDE 1.8.13 comes with java 1.8.0_191.
I patched the maple_upload.bat (from 2018, which seems to be the latest version...) to use the Arduino java instead of the default one:
set JAVAPATH=C:\Program Files (x86)\Arduino\java\bin\
%driverLetter%
cd %~dp0
"%JAVAPATH%java" -jar maple_loader.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
With the patched version uploading a sketch works again.
just in case anyone encounters the same problem i had...
I successfully used Arduino UI to program my bluepill board using "STM32duino bootloader" (which i serial-loaded to the board before).
After some weeks of playing around with other boards i found that uploading a sketch resulted in
C:\Users\xyz\Documents\Arduino\hardware\Arduino_STM32/tools/win/maple_upload.bat COM12 2 1EAF:0003 C:\Users\xyz\AppData\Local\Temp\arduino_build_457508/Blink.ino.bin
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=12636, tid=0x0000000000003c0c
#
# JRE version: Java(TM) SE Runtime Environment (8.0_261-b12) (build 1.8.0_261-b12)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.261-b12 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [jSSC-2.8_x86_64.dll+0xb5db]
a bit down in the crash log i found:
Internal exceptions (2 events):
Event: 0.024 Thread 0x0000022c00dd4000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.defineClass(Ljava/lang/String;[BII)Ljava/lang/Class; name or signature does not match> (0x000000066b187cc0) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u261\295\hots
Event: 0.024 Thread 0x0000022c00dd4000 Exception <a 'java/lang/NoSuchMethodError': Method sun.misc.Unsafe.prefetchRead(Ljava/lang/Object;J)V name or signature does not match> (0x000000066b187fa8) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u261\295\hotspot\src\share\vm\p
Events (10 events):
Event: 0.067 loading class jssc/SerialPort$LinuxEventThread
Event: 0.067 loading class jssc/SerialPort$LinuxEventThread done
Event: 0.067 loading class jssc/SerialPortTimeoutException
Event: 0.067 loading class jssc/SerialPortTimeoutException done
Event: 0.067 loading class java/lang/NoSuchMethodException
Updating libraries and reading a bit i found that arduino should come with its own java version and use that... unfornately, that doesn't appy to the maple_upload.bat!
My "default" java installation currenty is java 1.8.0.261.
If found that the latest Arduino IDE 1.8.13 comes with java 1.8.0_191.
I patched the maple_upload.bat (from 2018, which seems to be the latest version...) to use the Arduino java instead of the default one:
set JAVAPATH=C:\Program Files (x86)\Arduino\java\bin\
%driverLetter%
cd %~dp0
"%JAVAPATH%java" -jar maple_loader.jar %1 %2 %3 %4 %5 %6 %7 %8 %9
With the patched version uploading a sketch works again.