Title: Concrete executor fails when generating tests for sockets · Issue #1590 · UnitTestBot/UTBotJava · GitHub
Open Graph Title: Concrete executor fails when generating tests for sockets · Issue #1590 · UnitTestBot/UTBotJava
X Title: Concrete executor fails when generating tests for sockets · Issue #1590 · UnitTestBot/UTBotJava
Description: To Reproduce Generate a test for the following method with sandbox.policy file configured: class SecurityCheck { public int connect(Socket socket) throws IOException { socket.connect(new InetSocketAddress("0.0.0.0", 22)); return 0; } } A...
Open Graph Description: To Reproduce Generate a test for the following method with sandbox.policy file configured: class SecurityCheck { public int connect(Socket socket) throws IOException { socket.connect(new InetSocket...
X Description: To Reproduce Generate a test for the following method with sandbox.policy file configured: class SecurityCheck { public int connect(Socket socket) throws IOException { socket.connect(new InetSocket...
Opengraph URL: https://github.com/UnitTestBot/UTBotJava/issues/1590
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Concrete executor fails when generating tests for sockets","articleBody":"**To Reproduce**\r\n\r\n1. Generate a test for the following method with sandbox.policy file configured:\r\n```java\r\nclass SecurityCheck {\r\n public int connect(Socket socket) throws IOException {\r\n socket.connect(new InetSocketAddress(\"0.0.0.0\", 22));\r\n return 0;\r\n }\r\n}\r\n```\r\n\r\n**Actual behavior**\r\n\r\nOne of the generated tests looks like this:\r\n```java\r\npublic void testConnect_errors() {\r\n // Couldn't generate some tests. List of errors:\r\n // \r\n // 2 occurrences of:\r\n // Default concrete execution failed\r\n\r\n // 2 occurrences of:\r\n /* RefType java.net.Inet6AddressImpl not loaded. If you tried to get the\r\n RefType of a library class, did you call loadNecessaryClasses()? Otherwise\r\n please check Soot's classpath. */\r\n\r\n}\r\n```\r\n\r\n2. Head to TEMP/UTBot/utbot-instrumentedprocess-errors folder and find the last log. This is where the stacktrace was found.\r\n\r\n\r\n**Visual proofs (screenshots, logs, images)**\r\n\r\n```\r\nWARNING: package jdk.internal.jtrfs not in java.base\r\n15:26:28.901 | INFO | RdCoroutineScope | RdCoroutineHost overridden \r\n15:26:28.953 | INFO | ClientProtocolBuilder | pid - 6292, port - 57422 \r\n15:26:28.955 | INFO | ClientProtocolBuilder | isJvm8 - false, isJvm9Plus - true, isWindows - true \r\nWARNING: Illegal reflective access by com.esotericsoftware.kryo.kryo5.unsafe.UnsafeUtil (file:/C:/DevFolder/UTBotJava/utbot-intellij/build/idea-sandbox/plugins/utbot-intellij/lib/utbot-instrumentation-2022.12-SNAPSHOT.jar) to constructor java.nio.DirectByteBuffer(long,int)\r\nWARNING: Illegal reflective access by com.esotericsoftware.kryo.kryo5.unsafe.UnsafeUtil (file:/C:/DevFolder/UTBotJava/utbot-intellij/build/idea-sandbox/plugins/utbot-intellij/lib/utbot-instrumentation-2022.12-SNAPSHOT.jar) to method sun.nio.ch.DirectBuffer.cleaner()\r\n15:26:29.326 | INFO | InstrumentedProcess | setup started \r\n15:26:29.357 | INFO | InstrumentedProcess | setup ended \r\n15:26:29.361 | INFO | ClientProtocolBuilder | signalled \r\n15:26:30.380 | INFO | DynamicClassTransformer | Transforming: SecurityCheck \r\n15:26:30.614 | ERROR | InstrumentedProcess | | org.utbot.framework.concrete.phases.ValueConstructionPhaseError: Error during phase of constructing values from models\r\n\tat org.utbot.framework.concrete.phases.ValueConstructionContext.wrapError(ValueConstructionContext.kt:29)\r\n\tat org.utbot.framework.concrete.phases.ValueConstructionContext.wrapError(ValueConstructionContext.kt:24)\r\n\tat org.utbot.framework.concrete.UtExecutionInstrumentation.invoke(UtExecutionInstrumentation.kt:243)\r\n\tat org.utbot.framework.concrete.UtExecutionInstrumentation.invoke(UtExecutionInstrumentation.kt:96)\r\n\tat org.utbot.instrumentation.process.InstrumentedProcessMainKt$setup$2.invoke(InstrumentedProcessMain.kt:128)\r\n\tat org.utbot.instrumentation.process.InstrumentedProcessMainKt$setup$2.invoke(InstrumentedProcessMain.kt:124)\r\n\tat org.utbot.rd.IdleWatchdog$wrapActiveCall$1$1.invoke(ClientProcessUtil.kt:96)\r\n\tat org.utbot.rd.IdleWatchdog.wrapActive(ClientProcessUtil.kt:83)\r\n\tat org.utbot.rd.IdleWatchdog$wrapActiveCall$1.invoke(ClientProcessUtil.kt:95)\r\n\tat com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182)\r\n\tat com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:173)\r\n\tat com.jetbrains.rd.framework.impl.RdCall.onWireReceived(RdTask.kt:360)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:57)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:12)\r\n\tat com.jetbrains.rd.framework.impl.ProtocolContexts.readMessageContextAndInvoke(ProtocolContexts.kt:151)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:56)\r\n\tat com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:12)\r\n\tat com.jetbrains.rd.util.threading.SingleThreadSchedulerBase$queue$1.run(SingleThreadScheduler.kt:41)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\r\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\r\n\tat java.base/java.lang.Thread.run(Thread.java:829)\r\nCaused by: java.lang.reflect.InvocationTargetException\r\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n\tat java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)\r\n\tat org.utbot.framework.concrete.constructors.MockValueConstructor$call$2.invoke(MockValueConstructor.kt:488)\r\n\tat org.utbot.framework.concrete.constructors.MockValueConstructor$call$2.invoke(MockValueConstructor.kt:487)\r\n\tat org.utbot.instrumentation.process.SecurityKt$runSandbox$1$1.invoke(Security.kt:38)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$1.invoke(Security.kt:61)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$2.invoke(Security.kt:77)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$3.invoke(Security.kt:82)\r\n\tat org.utbot.instrumentation.process.SecurityKt$sandbox$4.run(Security.kt:88)\r\n\tat java.base/java.security.AccessController.doPrivileged(Native Method)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:88)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:82)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:77)\r\n\tat org.utbot.instrumentation.process.SecurityKt.sandbox(Security.kt:61)\r\n\tat org.utbot.instrumentation.process.SecurityKt.runSandbox(Security.kt:38)\r\n\tat org.utbot.framework.concrete.constructors.MockValueConstructor.call(MockValueConstructor.kt:487)\r\n\tat org.utbot.framework.concrete.constructors.MockValueConstructor.updateWithExecutableCallModel(MockValueConstructor.kt:426)\r\n\tat org.utbot.framework.concrete.constructors.MockValueConstructor.constructFromAssembleModel(MockValueConstructor.kt:367)\r\n\tat org.utbot.framework.concrete.constructors.MockValueConstructor.construct(MockValueConstructor.kt:136)\r\n\tat org.utbot.framework.concrete.constructors.MockValueConstructor.constructMethodParameters(MockValueConstructor.kt:111)\r\n\tat org.utbot.framework.concrete.phases.ValueConstructionContext.constructParameters(ValueConstructionContext.kt:39)\r\n\tat org.utbot.framework.concrete.UtExecutionInstrumentation.invoke(UtExecutionInstrumentation.kt:136)\r\n\t... 18 more\r\nCaused by: java.lang.IllegalArgumentException: port out of range:-1\r\n\tat java.base/java.net.InetSocketAddress.checkPort(InetSocketAddress.java:143)\r\n\tat java.base/java.net.InetSocketAddress.\u003cinit\u003e(InetSocketAddress.java:224)\r\n\tat java.base/java.net.Socket.\u003cinit\u003e(Socket.java:395)\r\n\t... 42 more\r\n```\r\n\r\n**Environment**\r\n\r\n- JDK11\r\n- Fresh main\r\n- sandbox.policy file\r\n\r\n","author":{"url":"https://github.com/sofurihafe","@type":"Person","name":"sofurihafe"},"datePublished":"2022-12-26T12:52:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1590/UTBotJava/issues/1590"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c1310452-b848-3f88-1629-b8c2958104a6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CD56:1D22:7DF571:A708AD:698D88F0 |
| html-safe-nonce | b6cf8a172afa751a56db539086b50a29d7423b02da31c3b25a963022d0d30af5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDU2OjFEMjI6N0RGNTcxOkE3MDhBRDo2OThEODhGMCIsInZpc2l0b3JfaWQiOiI2MDA2NzU2OTA5MDc1MjM3MTA0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b70df33130b76ac781a8ea18ee217b9744905b1cd6a7c8eacca066533cd75bc3 |
| hovercard-subject-tag | issue:1510926223 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/UnitTestBot/UTBotJava/1590/issue_layout |
| twitter:image | https://opengraph.githubassets.com/30dbd40fec3710cd9b2c8327b576677fc2cd7ca5d296370e3e9e0beee2a0907d/UnitTestBot/UTBotJava/issues/1590 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/30dbd40fec3710cd9b2c8327b576677fc2cd7ca5d296370e3e9e0beee2a0907d/UnitTestBot/UTBotJava/issues/1590 |
| og:image:alt | To Reproduce Generate a test for the following method with sandbox.policy file configured: class SecurityCheck { public int connect(Socket socket) throws IOException { socket.connect(new InetSocket... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sofurihafe |
| hostname | github.com |
| expected-hostname | github.com |
| None | c0818105fa276287e9369cfdefa0a0fa7953719791ceff9b94d69623c0a4fe8a |
| turbo-cache-control | no-preview |
| go-import | github.com/UnitTestBot/UTBotJava git https://github.com/UnitTestBot/UTBotJava.git |
| octolytics-dimension-user_id | 87413538 |
| octolytics-dimension-user_login | UnitTestBot |
| octolytics-dimension-repository_id | 480810501 |
| octolytics-dimension-repository_nwo | UnitTestBot/UTBotJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 480810501 |
| octolytics-dimension-repository_network_root_nwo | UnitTestBot/UTBotJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4c8f4bd0b67d7f1472d0ab3f49827eaae062a36b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width