[Sikuli-driver] [Bug 1840077] Re: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows --- fixed 2019-08-19 build #365
** Changed in: sikuli Status: Fix Committed => Fix Released ** Changed in: sikuli Milestone: 1.1.4 => 2.0.0 -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1840077 Title: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows --- fixed 2019-08-19 build #365 Status in Sikuli: Fix Released Bug description: SikuliX API crashes on Windows when running under OpenJ9 JVM (formerly IBM J9). The crash happens when the JVM loads the Finder class. I'm using SikuliX1 API version 1.1.4, latest build. This is a simple test program to reproduce the crash: public class SikuliBug { public static void main(String[] args) { new org.sikuli.script.Pattern("blah"); } } Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.ensureError(J9VMInternals.java:148) at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:137) at org.sikuli.script.Pattern.(Pattern.java:123) at SikuliBug.main(SikuliBug.java:3) Caused by: java.lang.IllegalArgumentException: Last character in replacement string can't be \, character to be escaped is required. at java.lang.String.checkLastChar(String.java:62) at java.lang.String.replaceAll(String.java:3530) at org.sikuli.script.support.RunTime.addToWindowsSystemPath(RunTime.java:1722) at org.sikuli.script.support.RunTime.libsExport(RunTime.java:1661) at org.sikuli.script.support.RunTime.libsLoad(RunTime.java:1486) at org.sikuli.script.support.RunTime.loadLibrary(RunTime.java:1690) at org.sikuli.script.Finder$Finder2.(Finder.java:571) ... 2 more The problem happens on this line in addToWindowsSystemPath(): String libsPath = (fLibsFolder.getAbsolutePath()).replaceAll("/", "\\"); Proposed fix: Use replace() instead of replaceAll() String libsPath = (fLibsFolder.getAbsolutePath()).replace("/", "\\"); This is more appropriate anyway, since you just want to replace all occurences of a fixed string or a character. By the way, try to run this line with the JVM of your choice (you might be surprised): "C:/bang/bang".replaceAll("/", "\\") I get this with Oracle JVM: Exception in thread "main" java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2223) at J9StringReplaceAllBug.main(SikuliBug.java:4) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1840077/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1840077] Re: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows
** Changed in: sikuli Importance: High => Critical ** Summary changed: - [1.1.4] API: Crash when running under OpenJ9 JVM on Windows + [1.1.4] API: Crash when running under OpenJ9 JVM on Windows --- fixed 2019-08-19 build #365 -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1840077 Title: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows --- fixed 2019-08-19 build #365 Status in Sikuli: Fix Committed Bug description: SikuliX API crashes on Windows when running under OpenJ9 JVM (formerly IBM J9). The crash happens when the JVM loads the Finder class. I'm using SikuliX1 API version 1.1.4, latest build. This is a simple test program to reproduce the crash: public class SikuliBug { public static void main(String[] args) { new org.sikuli.script.Pattern("blah"); } } Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.ensureError(J9VMInternals.java:148) at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:137) at org.sikuli.script.Pattern.(Pattern.java:123) at SikuliBug.main(SikuliBug.java:3) Caused by: java.lang.IllegalArgumentException: Last character in replacement string can't be \, character to be escaped is required. at java.lang.String.checkLastChar(String.java:62) at java.lang.String.replaceAll(String.java:3530) at org.sikuli.script.support.RunTime.addToWindowsSystemPath(RunTime.java:1722) at org.sikuli.script.support.RunTime.libsExport(RunTime.java:1661) at org.sikuli.script.support.RunTime.libsLoad(RunTime.java:1486) at org.sikuli.script.support.RunTime.loadLibrary(RunTime.java:1690) at org.sikuli.script.Finder$Finder2.(Finder.java:571) ... 2 more The problem happens on this line in addToWindowsSystemPath(): String libsPath = (fLibsFolder.getAbsolutePath()).replaceAll("/", "\\"); Proposed fix: Use replace() instead of replaceAll() String libsPath = (fLibsFolder.getAbsolutePath()).replace("/", "\\"); This is more appropriate anyway, since you just want to replace all occurences of a fixed string or a character. By the way, try to run this line with the JVM of your choice (you might be surprised): "C:/bang/bang".replaceAll("/", "\\") I get this with Oracle JVM: Exception in thread "main" java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2223) at J9StringReplaceAllBug.main(SikuliBug.java:4) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1840077/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1840077] Re: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows
Thanks for your evaluation. ... but the solution simply is to just use: String libsPath = fLibsFolder.getAbsolutePath() since this only runs on Windows and (fLibsFolder is a File object) always returns a path string with correct back-slashes. Will be fixed in the next snapshot. -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1840077 Title: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows Status in Sikuli: Fix Committed Bug description: SikuliX API crashes on Windows when running under OpenJ9 JVM (formerly IBM J9). The crash happens when the JVM loads the Finder class. I'm using SikuliX1 API version 1.1.4, latest build. This is a simple test program to reproduce the crash: public class SikuliBug { public static void main(String[] args) { new org.sikuli.script.Pattern("blah"); } } Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.ensureError(J9VMInternals.java:148) at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:137) at org.sikuli.script.Pattern.(Pattern.java:123) at SikuliBug.main(SikuliBug.java:3) Caused by: java.lang.IllegalArgumentException: Last character in replacement string can't be \, character to be escaped is required. at java.lang.String.checkLastChar(String.java:62) at java.lang.String.replaceAll(String.java:3530) at org.sikuli.script.support.RunTime.addToWindowsSystemPath(RunTime.java:1722) at org.sikuli.script.support.RunTime.libsExport(RunTime.java:1661) at org.sikuli.script.support.RunTime.libsLoad(RunTime.java:1486) at org.sikuli.script.support.RunTime.loadLibrary(RunTime.java:1690) at org.sikuli.script.Finder$Finder2.(Finder.java:571) ... 2 more The problem happens on this line in addToWindowsSystemPath(): String libsPath = (fLibsFolder.getAbsolutePath()).replaceAll("/", "\\"); Proposed fix: Use replace() instead of replaceAll() String libsPath = (fLibsFolder.getAbsolutePath()).replace("/", "\\"); This is more appropriate anyway, since you just want to replace all occurences of a fixed string or a character. By the way, try to run this line with the JVM of your choice (you might be surprised): "C:/bang/bang".replaceAll("/", "\\") I get this with Oracle JVM: Exception in thread "main" java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2223) at J9StringReplaceAllBug.main(SikuliBug.java:4) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1840077/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1840077] Re: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows
Thanks! In the meantime I have built the naked jar, took the modified class file and monkey patched it into the full jar. I can confirm that with this modification, sikuliX API now works with OpenJ9 on Windows. For reference, this is the patch I used: --- a/API/src/main/java/org/sikuli/script/support/RunTime.java +++ b/API/src/main/java/org/sikuli/script/support/RunTime.java @@ -1644,7 +1644,7 @@ public class RunTime { if (syspath == null) { terminate(999, "addToWindowsSystemPath: cannot access system path"); } else { - String libsPath = (fLibsFolder.getAbsolutePath()).replaceAll("/", "\\"); + String libsPath = (fLibsFolder.getAbsolutePath()).replace("/", "\\"); if (!syspath.toUpperCase().contains(libsPath.toUpperCase())) { // TODO if (SysJNA.WinKernel32.setEnvironmentVariable("PATH", libsPath + ";" + syspath)) { if (null != (syspath = WinUtil.setEnv("PATH", libsPath + ";" + syspath))) { -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1840077 Title: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows Status in Sikuli: Fix Committed Bug description: SikuliX API crashes on Windows when running under OpenJ9 JVM (formerly IBM J9). The crash happens when the JVM loads the Finder class. I'm using SikuliX1 API version 1.1.4, latest build. This is a simple test program to reproduce the crash: public class SikuliBug { public static void main(String[] args) { new org.sikuli.script.Pattern("blah"); } } Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.ensureError(J9VMInternals.java:148) at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:137) at org.sikuli.script.Pattern.(Pattern.java:123) at SikuliBug.main(SikuliBug.java:3) Caused by: java.lang.IllegalArgumentException: Last character in replacement string can't be \, character to be escaped is required. at java.lang.String.checkLastChar(String.java:62) at java.lang.String.replaceAll(String.java:3530) at org.sikuli.script.support.RunTime.addToWindowsSystemPath(RunTime.java:1722) at org.sikuli.script.support.RunTime.libsExport(RunTime.java:1661) at org.sikuli.script.support.RunTime.libsLoad(RunTime.java:1486) at org.sikuli.script.support.RunTime.loadLibrary(RunTime.java:1690) at org.sikuli.script.Finder$Finder2.(Finder.java:571) ... 2 more The problem happens on this line in addToWindowsSystemPath(): String libsPath = (fLibsFolder.getAbsolutePath()).replaceAll("/", "\\"); Proposed fix: Use replace() instead of replaceAll() String libsPath = (fLibsFolder.getAbsolutePath()).replace("/", "\\"); This is more appropriate anyway, since you just want to replace all occurences of a fixed string or a character. By the way, try to run this line with the JVM of your choice (you might be surprised): "C:/bang/bang".replaceAll("/", "\\") I get this with Oracle JVM: Exception in thread "main" java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2223) at J9StringReplaceAllBug.main(SikuliBug.java:4) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1840077/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1840077] Re: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows
the link only points to a "naked" sikulixapi.jar without the needed dependencies. This can only be used in Maven/Gradle projects. If you need the jar as a local library in your project: https://raiman.github.io/SikuliX1/downloads.html There you will always get the latest build. -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1840077 Title: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows Status in Sikuli: Fix Committed Bug description: SikuliX API crashes on Windows when running under OpenJ9 JVM (formerly IBM J9). The crash happens when the JVM loads the Finder class. I'm using SikuliX1 API version 1.1.4, latest build. This is a simple test program to reproduce the crash: public class SikuliBug { public static void main(String[] args) { new org.sikuli.script.Pattern("blah"); } } Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.ensureError(J9VMInternals.java:148) at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:137) at org.sikuli.script.Pattern.(Pattern.java:123) at SikuliBug.main(SikuliBug.java:3) Caused by: java.lang.IllegalArgumentException: Last character in replacement string can't be \, character to be escaped is required. at java.lang.String.checkLastChar(String.java:62) at java.lang.String.replaceAll(String.java:3530) at org.sikuli.script.support.RunTime.addToWindowsSystemPath(RunTime.java:1722) at org.sikuli.script.support.RunTime.libsExport(RunTime.java:1661) at org.sikuli.script.support.RunTime.libsLoad(RunTime.java:1486) at org.sikuli.script.support.RunTime.loadLibrary(RunTime.java:1690) at org.sikuli.script.Finder$Finder2.(Finder.java:571) ... 2 more The problem happens on this line in addToWindowsSystemPath(): String libsPath = (fLibsFolder.getAbsolutePath()).replaceAll("/", "\\"); Proposed fix: Use replace() instead of replaceAll() String libsPath = (fLibsFolder.getAbsolutePath()).replace("/", "\\"); This is more appropriate anyway, since you just want to replace all occurences of a fixed string or a character. By the way, try to run this line with the JVM of your choice (you might be surprised): "C:/bang/bang".replaceAll("/", "\\") I get this with Oracle JVM: Exception in thread "main" java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2223) at J9StringReplaceAllBug.main(SikuliBug.java:4) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1840077/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1840077] Re: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows
Thanks for the super fast reply! I'll try the next snapshot build and report back. When are you releasing the next build? Is this the correct link? https://oss.sonatype.org/content/repositories/snapshots/com/sikulix/sikulixapi/1.1.4-SNAPSHOT/ -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1840077 Title: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows Status in Sikuli: Fix Committed Bug description: SikuliX API crashes on Windows when running under OpenJ9 JVM (formerly IBM J9). The crash happens when the JVM loads the Finder class. I'm using SikuliX1 API version 1.1.4, latest build. This is a simple test program to reproduce the crash: public class SikuliBug { public static void main(String[] args) { new org.sikuli.script.Pattern("blah"); } } Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.ensureError(J9VMInternals.java:148) at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:137) at org.sikuli.script.Pattern.(Pattern.java:123) at SikuliBug.main(SikuliBug.java:3) Caused by: java.lang.IllegalArgumentException: Last character in replacement string can't be \, character to be escaped is required. at java.lang.String.checkLastChar(String.java:62) at java.lang.String.replaceAll(String.java:3530) at org.sikuli.script.support.RunTime.addToWindowsSystemPath(RunTime.java:1722) at org.sikuli.script.support.RunTime.libsExport(RunTime.java:1661) at org.sikuli.script.support.RunTime.libsLoad(RunTime.java:1486) at org.sikuli.script.support.RunTime.loadLibrary(RunTime.java:1690) at org.sikuli.script.Finder$Finder2.(Finder.java:571) ... 2 more The problem happens on this line in addToWindowsSystemPath(): String libsPath = (fLibsFolder.getAbsolutePath()).replaceAll("/", "\\"); Proposed fix: Use replace() instead of replaceAll() String libsPath = (fLibsFolder.getAbsolutePath()).replace("/", "\\"); This is more appropriate anyway, since you just want to replace all occurences of a fixed string or a character. By the way, try to run this line with the JVM of your choice (you might be surprised): "C:/bang/bang".replaceAll("/", "\\") I get this with Oracle JVM: Exception in thread "main" java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2223) at J9StringReplaceAllBug.main(SikuliBug.java:4) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1840077/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1840077] Re: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows
Thanks for finding and the evaluation. ** Changed in: sikuli Status: New => Fix Committed ** Changed in: sikuli Importance: Undecided => High ** Changed in: sikuli Assignee: (unassigned) => RaiMan (raimund-hocke) ** Changed in: sikuli Milestone: None => 1.1.4 -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1840077 Title: [1.1.4] API: Crash when running under OpenJ9 JVM on Windows Status in Sikuli: Fix Committed Bug description: SikuliX API crashes on Windows when running under OpenJ9 JVM (formerly IBM J9). The crash happens when the JVM loads the Finder class. I'm using SikuliX1 API version 1.1.4, latest build. This is a simple test program to reproduce the crash: public class SikuliBug { public static void main(String[] args) { new org.sikuli.script.Pattern("blah"); } } Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.J9VMInternals.ensureError(J9VMInternals.java:148) at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:137) at org.sikuli.script.Pattern.(Pattern.java:123) at SikuliBug.main(SikuliBug.java:3) Caused by: java.lang.IllegalArgumentException: Last character in replacement string can't be \, character to be escaped is required. at java.lang.String.checkLastChar(String.java:62) at java.lang.String.replaceAll(String.java:3530) at org.sikuli.script.support.RunTime.addToWindowsSystemPath(RunTime.java:1722) at org.sikuli.script.support.RunTime.libsExport(RunTime.java:1661) at org.sikuli.script.support.RunTime.libsLoad(RunTime.java:1486) at org.sikuli.script.support.RunTime.loadLibrary(RunTime.java:1690) at org.sikuli.script.Finder$Finder2.(Finder.java:571) ... 2 more The problem happens on this line in addToWindowsSystemPath(): String libsPath = (fLibsFolder.getAbsolutePath()).replaceAll("/", "\\"); Proposed fix: Use replace() instead of replaceAll() String libsPath = (fLibsFolder.getAbsolutePath()).replace("/", "\\"); This is more appropriate anyway, since you just want to replace all occurences of a fixed string or a character. By the way, try to run this line with the JVM of your choice (you might be surprised): "C:/bang/bang".replaceAll("/", "\\") I get this with Oracle JVM: Exception in thread "main" java.lang.IllegalArgumentException: character to be escaped is missing at java.util.regex.Matcher.appendReplacement(Matcher.java:809) at java.util.regex.Matcher.replaceAll(Matcher.java:955) at java.lang.String.replaceAll(String.java:2223) at J9StringReplaceAllBug.main(SikuliBug.java:4) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1840077/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp