0

I am using Sikuli-api to automate a standalone application. This application starts on running *.bat file. In code I am opening this application as:

 m_sikscr=new SikuliScript();
    m_sikscr.openApp("path of bat file");

I am getting below exception on this openApp() command.

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x515ee11e, pid=3992, tid=5868
#
# JRE version: Java(TM) SE Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26)
# Java VM: Java HotSpot(TM) Client VM (25.20-b23 mixed mode windows-x86 )

Whereas, when I try to open same bat file via below line of code, it gets open successfully.:

String[] command = {"cmd.exe", "/C", "Start", "*.bat"};
    Runtime r = Runtime.getRuntime();
     Process p = r.exec(command);
     p.waitFor();

Below is stack trace :

Stack: [0x00d50000,0x00da0000],  sp=0x00d9edc8,  free space=315k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [jvm.dll+0xce11e]
C  [Win32Util.dll+0x147d]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.sikuli.script.Win32Util.openApp(Ljava/lang/String;)I+0
j  org.sikuli.script.App.open()Lorg/sikuli/script/App;+19
j  org.sikuli.script.App.open(Ljava/lang/String;)Lorg/sikuli/script/App;+8
j  org.sikuli.script.SikuliScript.openApp(Ljava/lang/String;)I+1
j  testpack.OmsTest.openOMS()V+1509
v  ~StubRoutines::call_stub

I am failing to understand if it is an issue with bat file or Sikuli.

MKay
  • 818
  • 9
  • 32

2 Answers2

0

Based on what you show, sikuli calls into native code, where Win32utils fails. This is how Java reports Crashes in C code.

You most likely forgot some configuration bit.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
  • I set `JPARAM=-Xms64M -Xmx512M -Dfile.encoding=UTF-8` environment variable, as got some hint from [here](https://answers.launchpad.net/sikuli/+faq/2220). For now , `openApp()` method not crashing the JVM. But I am not sure if JPARAM environment variable did the trick. (not that experienced in Java.) – MKay Oct 01 '15 at 09:36
0

I got similar issue with openApp() but on OS X. As workaround i use old versiom Sikuli (1.0.1).

https://bugs.launchpad.net/sikuli/+bug/1498949

  • Thank you for sharing the bug. As I commented on below answer, I set JPARAM env. veriable. Do you think it would have solved the problem? Since JVM is not crashing on openApp method. – MKay Oct 05 '15 at 04:09