在 Jenkins 管道中使用 VM 的 Jacob dll 中的 EXCEPTION_ACCESS_VIOLATION [英] EXCEPTION_ACCESS_VIOLATION in Jacob dll using VM in Jenkins pipeline

查看:25
本文介绍了在 Jenkins 管道中使用 VM 的 Jacob dll 中的 EXCEPTION_ACCESS_VIOLATION的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在虚拟机中使用时,我们正在解决一个可能与 Jacob 1.14.3 dll 相关的问题.当从我们的 windows 服务器虚拟机(主/从)内的 jenkins 管道运行我们的自动化脚本时,日志中会显示以下错误:

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:jenkinsworkspacePipelineCenariosTest_Com_Claudiohs_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.0in..inm2.conf -Dmaven.home=C:apache-maven-3.6.0in.. -Dmaven.multiModuleProjectDirectory=c:jenkinsworkspacePipelineCenariosTest_Com_Claudiopos 
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.0in..ootplexus-classworlds-2.5.2.jar
Launcher Type: SUN_STANDARD

Environment Variables:
JAVA_HOME=C:Program FilesJavajdk1.8.0_271
JRE_HOME=C:Program FilesJavajdk1.8.0_271jre
PATH=C:Program Files (x86)Common FilesOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:apache-maven-3.6.0in;C:Program FilesGitcmd;C:Program FilesJavajdk1.8.0_271in;C:Program FilesJavajdk1.8.0_271jrein;C:UsersfafezziAppDataLocalMicrosoftWindowsApps;"C:Program FilesJavajre1.8.0_271in"
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)

Master VM 使用 Maven 构建项目并发送要运行的测试是从机.我们必须使用 Jacob dll 将 AutoITX 与 Junit 命令集成.

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:

  • jacob dll(1.14.3 并审查了安装和权限)
  • Maven (3.3.9/3.6.0/3.5.3)
  • surefire 插件(尝试使用 3.0.0-M4 和 2.22.0)
  • JDK 和 JRE(在 1.8.0_271 和 1.11 中尝试过)
  • AutoITX(已审核安装和权限)

在网络上找到一些有关此异常访问违规"的结果后,我们还尝试更改操作系统语言.我们还要求虚拟化团队删除所有应用的强化策略,我们还运行了 Windows 更新并添加了 C redist 库,以尝试纠正我们面临的 DLL 问题.我们还隔离了我们所有的代码,以便只有一个文件和一个命令(AutoIT 使用 jacob 自动执行任何操作,甚至鼠标移动的命令),问题仍然存在.在我们的一次尝试中,我们运行了一个带有新安装的本地 VM,根本没有 jenkins,所以我们现在知道管道不是问题的原因

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:在团队本地机器上,脚本运行没有问题,程序被实例化,Maven之间的通信>爪哇>万无一失 >雅各布>AutoITX >Windows 应用程序工作正常.我们无法确定为什么相同的构建和过程无法在我们的管道(VM/Jenkins)中工作.

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.

有什么见解或建议吗?

推荐答案

可能的解决方案

尝试将您的 Java 版本版本更改为 1.8.0_141.

Possible Solution

Try changing your java version build to 1.8.0_141.

请注意,141 在这里很重要.不同版本的内部版本号可能不兼容并引发类似错误.

Note that 141 is important here. Different version build numbers may not be compatible and throw similar errors.

您可以在 Java 存档中找到旧的 Java 版本,然后搜索 Java SE Development Kit 8u141

You can find old java versions in the Java Archive, and search for Java SE Development Kit 8u141

我们的团队通过java代码调用jacob dll发现了完全相同的问题.在我们的例子中,hs_pid_xxxx"中的错误是错误的.文件与上面完全相同:

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:

  • Variant_getVariantType+0x51
  • 内存地址 180012df1
  • EXCEPTION_ACCESS_VIOLATION

整个团队在网上搜索了几个月,同时交换了 java 版本、jacob 版本、AutoitX 版本,甚至考虑 windows server/windows home 不同版本的 windows 版本.

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.

在我们的尝试中,我们意识到代码只专门在我们本地公司的机器上运行,不可能在我们的任何 VM 甚至我们的个人计算机中运行这个特定的 jacob 调用.一段时间后,我们决定尝试使用安装在我们公司本地设置中的SPECIFIC JAVA BUILD.通过特定构建,我的意思是不仅使用相同的 Java 版本(Java 8/Java 11/Java 15),而且还使用与 Java SE Development Kit 8u 中相同的 Java 构建141在此链接中,我们下载了说明 141 的文件,并且异常消失了https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html显然,jvm 在较新的 Java 版本中引发了指向 jacob dll 的空指针

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

这篇关于在 Jenkins 管道中使用 VM 的 Jacob dll 中的 EXCEPTION_ACCESS_VIOLATION的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆