We are going through a problem probably related to Jacob 1.14.3 dll when being used inside a Virtual Machine. When running our automation script from the jenkins pipeline inside our windows server VMs (master/slaves) the following error is shown in the logs:
A fatal error has been detected by the Java Runtime Environment:
EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000180012df1, pid=6404, tid=0x00000000000017bc
JRE version: Java(TM) SE Runtime Environment (8.0_271-b09) (build 1.8.0_271-b09)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.271-b09 mixed mode windows-amd64 compressed oops)
Problematic frame:
C [jacob-1.14.3-x64.dll+0x12df1]
Core dump written. Default location: c:\jenkins\workspace\PipelineCenarios\Test_Com_Claudio\hs_err_pid6404.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.
[...]log too big to be posted in stack overflow[...]
VM Arguments:
jvm_args: -Dclassworlds.conf=C:\apache-maven-3.6.0\bin\..\bin\m2.conf -Dmaven.home=C:\apache-maven-3.6.0\bin\.. -Dmaven.multiModuleProjectDirectory=c:\jenkins\workspace\PipelineCenarios\Test_Com_Claudio\pos
java_command: org.codehaus.plexus.classworlds.launcher.Launcher clean test -Demulator.model=S920 -Dlogic.number=790001291 -Ddriver.app=S920POS.exe -Drunner.type= -Demulator.initialization=false -Dcucumber.filter.tag=@TesteComunicacaoMaster -Dextent.reporter.klov.start=false -Dklov.project.name=Tst_comunicacao -Dklov.report.name=S920 -Dextent.reporter.html.config=src/test/resources/extent-config.xml -Dextent.reporter.klov.config=src/test/resources/klov.properties -Dextent.reporter.html.out=target/test-output/HtmlReport/ExtentHtml.html -e -X
java_class_path (initial): C:\apache-maven-3.6.0\bin\..\boot\plexus-classworlds-2.5.2.jar
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_271
JRE_HOME=C:\Program Files\Java\jdk1.8.0_271\jre
PATH=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:\apache-maven-3.6.0\bin;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_271\bin;C:\Program Files\Java\jdk1.8.0_271\jre\bin;C:\Users\fafezzi\AppData\Local\Microsoft\WindowsApps;"C:\Program Files\Java\jre1.8.0_271\bin"
USERNAME=fafezzi
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 62 Stepping 4, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 10.0 , 64 bit Build 14393 (10.0.14393.3630)
CPU:total 4 (initial active 4) (1 cores per cpu, 1 threads per core) family 6 model 62 stepping 4, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, aes, clmul, erms, tsc, tscinvbit
Memory: 4k page, physical 8191408k(3782304k free), swap 9502128k(5723824k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (25.271-b09) for windows-amd64 JRE (1.8.0_271-b09), built on Sep 16 2020 19:14:59 by "" with MS VC++ 15.9 (VS2017)
time: Wed Dec 2 15:26:51 2020
timezone: E. South America Standard Time
elapsed time: 14.765913 seconds (0d 0h 0m 14s)
The Master VM uses Maven to build the project and sends the tests to be run is the slave machines. We have to use the Jacob dll to integrate AutoITX with the Junit commands.
So far we have been checking different versions and the integrations between:
We also tried changing the OS language after finding some results in the web about this "exception acess violation". we also asked the virtualization teams to remove all of the hardening policies applied, we also had windows update runned and added C redist libraries in order to try to correct the DLL problem we are facing. we have also isolated ALL OF OUR CODE, in order to have only one file with only one command (the command where AutoIT uses jacob to automate anything, even a mouse movement) and the problem persists. In one of our attempts we have run a local VM with a new instalation and without jenkins at all, so that we now now that the pipeline is not the reason of the problem
ALSO: In the team local machines, the scripts run without problems, the program is instantiated, the communication between Maven > Java > Surefire > Jacob > AutoITX > Windows Application works fine. We have not been able to identify why this same build and procedure fails to work inside our pipeline (VM/Jenkins).
We have records that this same pipeline worked before, but we dont have any clue why it has stopped working.
Any insights or advices?
Try changing your java version build to 1.8.0_141.
Note that 141 is important here. Different version build numbers may not be compatible and throw similar errors.
You can find old java versions in the Java Archive, and search for Java SE Development Kit 8u141
Our team found the exact same problem by calling jacob dll via java code. In our case the error inside the "hs_pid_xxxx" file was the exact same as above:
The whole team searched the web for some months while exchanging java versions, jacob versions, AutoitX versions, even windows versions considering different builds for windows server/windows home.
During our attempts we realized that the code was only specifically running on our local company machines, it was not possible to run this specific jacob call within any of our VMs or even our personal computers. After some time we decided to try to use the SPECIFIC JAVA BUILD wich was installed in our company local setups. By specific build I mean not only using the same java version ( Java 8/ Java 11/ Java 15 ) but also using the same java build like in Java SE Development Kit 8u141 in this link we downloaded the file that stated 141 and the exception was gone https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html Aparently the jvm was raising a nullpointer to the jacob dll in the newer java versions
In any case... if anyone is experiencing that issue, I believe it is worth the try