We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description
Sandboxed test is not compiling because commented stack trace contains "illegal unicode escape".
To Reproduce
public class SecurityCheck { public int normalTest(int value) { if (value < 0) { return -value; } return value; } public int read(File path) throws IOException { byte[] bytes = Files.readAllBytes(path.toPath()); return bytes.length; } public int connect(Socket socket) throws IOException { socket.connect(new InetSocketAddress("0.0.0.0", 22)); return 0; } public String property(String key) { return System.getProperty(key); } public String systemExit() { System.exit(0); return "bad"; } }
Expected behavior
Project can be successfully build after test generation.
Actual behavior
SecurityCheckTest is not compiled. The following error is displayed:
C:\Users\<user_name>\UTBotJava\utbot-sample\src\test\java\org\utbot\examples\securitycheck\SecurityCheckTest.java:2823: error: illegal unicode escape /* This test fails because method [org.utbot.examples.securitycheck.SecurityCheck.read] produces [java.security.AccessControlException: access denied ("java.io.FilePermission" "jkmqh\uhauh" "read")]
Visual proofs (screenshots, logs, images)
There is the following test generated by Fuzzer
///region FUZZER: EXPLICITLY_THROWN_UNCHECKED_EXCEPTIONS for method read(java.io.File) @Test @DisplayName("read: path = File(String, String)") @Disabled(value = "Disabled due to sandbox") public void testRead() { SecurityCheck securityCheck = new SecurityCheck(); File path = new File("jkmqh", "uhauh"); /* This test fails because method [org.utbot.examples.securitycheck.SecurityCheck.read] produces [java.security.AccessControlException: access denied ("java.io.FilePermission" "jkmqh\uhauh" "read")] java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) java.base/java.security.AccessController.checkPermission(AccessController.java:897) java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:322) java.base/java.lang.SecurityManager.checkRead(SecurityManager.java:661) java.base/sun.nio.fs.WindowsChannelFactory.open(WindowsChannelFactory.java:299) java.base/sun.nio.fs.WindowsChannelFactory.newFileChannel(WindowsChannelFactory.java:168) java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230) java.base/java.nio.file.Files.newByteChannel(Files.java:371) java.base/java.nio.file.Files.newByteChannel(Files.java:422) java.base/java.nio.file.Files.readAllBytes(Files.java:3206) org.utbot.examples.securitycheck.SecurityCheck.read(SecurityCheck.java:19) */ } ///endregion
Environment
Windows 10 Pro IntelliJ IDEA 2022.2.2
Additional context
Originally posted by @alisevych in #1125 (comment)
The text was updated successfully, but these errors were encountered:
Looks like that it is relative to #609
Reproducable for a simple example without sandboxing (fuzzer is on, test should fail):
public int error() { Integer.parseInt("my" + "\\" + "union"); return -1; }
@Vassiliy-Kudryashov could you please take a look?
Sorry, something went wrong.
Sandboxed test is not compiling because of illegal unicode escape #1134
7f952fd
Sandboxed test is not compiling because of illegal unicode escape #1134…
5bd3235
… (#1182)
Vassiliy-Kudryashov
Successfully merging a pull request may close this issue.
Description
Sandboxed test is not compiling because commented stack trace contains "illegal unicode escape".
To Reproduce
Expected behavior
Project can be successfully build after test generation.
Actual behavior
SecurityCheckTest is not compiled.
The following error is displayed:
Visual proofs (screenshots, logs, images)
There is the following test generated by Fuzzer
Environment
Windows 10 Pro
IntelliJ IDEA 2022.2.2
Additional context
Originally posted by @alisevych in #1125 (comment)
The text was updated successfully, but these errors were encountered: