Skip to content

JvmCrashExamples Symbolic + Fuzzing mode produces errors with JDK 17 #1308

New issue

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

Closed
alisevych opened this issue Nov 3, 2022 · 3 comments
Closed
Labels
ctg-bug Issue is a bug priority-top-focus Top priority chosen by dev team

Comments

@alisevych
Copy link
Member

alisevych commented Nov 3, 2022

Description

JvmCrashExamples Symbolic + Fuzzing mode (default) generation produce errors in test class.

To Reproduce

  1. Install build from release branch into IDEA 2022.2.3
  2. Create IntelliJ project with JDK 17
  3. Copy-paste JvmCrashExamples to it
  4. Generate tests for it in default Fuzzing + Symbolic mode

Expected behavior

Tests are supposed to be generated without errors.

Actual behavior

An error test is generated with information about exceptions.

Visual proofs (screenshots, logs, images)

    ///region

    @Test
    @Disabled(value = "Disabled due to possible JVM crash")
    public void testCrash1() throws Exception {
        JvmCrashExamples jvmCrashExamples = new JvmCrashExamples();

        // This invocation possibly crashes JVM
        jvmCrashExamples.crash(1);
    }
    ///endregion

    ///region Errors report for crash

    public void testCrash_errors() {
        // Couldn't generate some tests. List of errors:
        // 
        // 4 occurrences of:
        /* Unable to make field static final java.lang.ref.ReferenceQueue java.lang.ref.ReferenceQueue.NULL accessible: module
        java.base does not "opens java.lang.ref" to unnamed module @358c99f5 */

        // 2 occurrences of:
        /* Unable to make field private static long java.lang.ref.SoftReference.clock accessible: module
        java.base does not "opens java.lang.ref" to unnamed module @358c99f5 */

    }
    ///endregion

    ///endregion

    ///region Test suites for executable exceptions.JvmCrashExamples.crashPrivileged

    ///region

    @Test
    @Disabled(value = "Disabled due to possible JVM crash")
    public void testCrashPrivileged1() {
        JvmCrashExamples jvmCrashExamples = new JvmCrashExamples();

        // This invocation possibly crashes JVM
        jvmCrashExamples.crashPrivileged(1);
    }
    ///endregion

    ///region Errors report for crashPrivileged

    public void testCrashPrivileged_errors() {
        // Couldn't generate some tests. List of errors:
        // 
        // 1 occurrences of:
        /* Unable to make field static final boolean java.security.AccessController.$assertionsDisabled accessible: module
        java.base does not "opens java.security" to unnamed module @358c99f5 */

    }
    ///endregion

    ///endregion

Also there are the following exceptions in rdEngineProcessLogs:

17:29:42.945 | ERROR | UtBotSymbolicEngine | Test generation failed on stmt $z0 = <java.security.AccessController: boolean $assertionsDisabled>, symbolic stack trace:
<java.security.AccessController: java.lang.Object executePrivileged(java.security.PrivilegedAction,java.security.AccessControlContext,java.lang.Class)>
<java.security.AccessController: java.lang.Object doPrivileged(java.security.PrivilegedAction)>
<exceptions.JvmCrashExamples: int crashPrivileged(int)>
java.lang.reflect.InaccessibleObjectException: Unable to make field static final boolean java.security.AccessController.$assertionsDisabled accessible: module java.base does not "opens java.security" to unnamed module @358c99f5
	at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) ~[?:?]
	at java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) ~[?:?]
	at java.lang.reflect.Field.checkCanSetAccessible(Field.java:178) ~[?:?]
	at java.lang.reflect.Field.setAccessible(Field.java:172) ~[?:?]
	at org.utbot.engine.Traverser.extractConcreteValue(Traverser.kt:3723) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.Traverser.makeConcreteUpdatesForNonEnumStaticField(Traverser.kt:621) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.Traverser.processStaticFieldConcretely(Traverser.kt:530) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.Traverser.processStaticInitializer(Traverser.kt:430) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.Traverser.processStaticInitializerIfRequired(Traverser.kt:384) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.Traverser.doPreparatoryWorkIfRequired(Traverser.kt:357) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.Traverser.traverseStmt(Traverser.kt:321) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.Traverser.traverse(Traverser.kt:304) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.UtBotSymbolicEngine$traverseImpl$1.invokeSuspend(UtBotSymbolicEngine.kt:360) ~[utbot-framework-2022.11.500..jar:?]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.7.20.jar:1.7.20-release-201(1.7.20)]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at org.utbot.framework.process.RdSettingsContainer$settingFor$1$1.getValue(RdSettingsContainer.kt:32) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.framework.UtSettings.getCheckSolverTimeoutMillis(UtSettings.kt:46) ~[utbot-framework-api-2022.11.500..jar:?]
	at org.utbot.engine.pc.UtSolver.<init>(UtSolver.kt:125) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.pc.UtSolver.<init>(UtSolver.kt:165) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.UtBotSymbolicEngine$traverseImpl$1.invokeSuspend(UtBotSymbolicEngine.kt:258) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.UtBotSymbolicEngine$traverseImpl$1.invoke(UtBotSymbolicEngine.kt) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.engine.UtBotSymbolicEngine$traverseImpl$1.invoke(UtBotSymbolicEngine.kt) ~[utbot-framework-2022.11.500..jar:?]
	at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.FlowKt__EmittersKt$onStart$$inlined$unsafeFlow$1.collect(SafeCollector.common.kt:120) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.FlowKt__EmittersKt$onCompletion$$inlined$unsafeFlow$1.collect(SafeCollector.common.kt:114) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.FlowKt__CollectKt.emitAll(Collect.kt:109) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.FlowKt.emitAll(Unknown Source) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.FlowKt__MergeKt$flattenConcat$1$1.emit(Merge.kt:80) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.FlowKt__MergeKt$flattenConcat$1$1.emit(Merge.kt:80) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.FlowKt__BuildersKt$flowOf$$inlined$unsafeFlow$1.collect(SafeCollector.common.kt:114) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.FlowKt__BuildersKt$flowOf$$inlined$unsafeFlow$1$1.invokeSuspend(SafeCollector.common.kt) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.7.20.jar:1.7.20-release-201(1.7.20)]
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:284) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at org.utbot.common.ConcurrencyKt.runBlockingWithCancellationPredicate(Concurrency.kt:38) ~[utbot-core-2022.11.500..jar:?]
	at org.utbot.framework.plugin.api.TestCaseGenerator$generate$3.invoke(TestCaseGenerator.kt:157) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.framework.plugin.api.TestCaseGenerator$generate$3.invoke(TestCaseGenerator.kt:156) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.common.ConcurrencyKt.runIgnoringCancellationException(Concurrency.kt:47) ~[utbot-core-2022.11.500..jar:?]
	at org.utbot.framework.plugin.api.TestCaseGenerator.generate(TestCaseGenerator.kt:156) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.framework.process.EngineMainKt$setup$3.invoke(EngineMain.kt:104) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.framework.process.EngineMainKt$setup$3.invoke(EngineMain.kt:94) ~[utbot-framework-2022.11.500..jar:?]
	at org.utbot.rd.CallsSynchronizer$measureExecutionForTermination$1$1.invoke(ClientProcessUtil.kt:84) ~[utbot-rd-2022.11.500..jar:?]
	at org.utbot.rd.CallsSynchronizer.measureExecutionForTermination(ClientProcessUtil.kt:75) ~[utbot-rd-2022.11.500..jar:?]
	at org.utbot.rd.CallsSynchronizer$measureExecutionForTermination$1.invoke(ClientProcessUtil.kt:83) ~[utbot-rd-2022.11.500..jar:?]
	at com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182) ~[rd-framework-2022.3.1.jar:?]
	at com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182) ~[rd-framework-2022.3.1.jar:?]
	at com.jetbrains.rd.framework.impl.RdCall.onWireReceived(RdTask.kt:360) ~[rd-framework-2022.3.1.jar:?]
	at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:57) ~[rd-framework-2022.3.1.jar:?]
	at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:56) ~[rd-framework-2022.3.1.jar:?]
	at com.jetbrains.rd.framework.impl.ProtocolContexts.readMessageContextAndInvoke(ProtocolContexts.kt:148) ~[rd-framework-2022.3.1.jar:?]
	at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:56) ~[rd-framework-2022.3.1.jar:?]
	at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:54) ~[rd-framework-2022.3.1.jar:?]
	at com.jetbrains.rd.util.threading.SingleThreadSchedulerBase.queue$lambda-3(SingleThreadScheduler.kt:41) ~[rd-core-2022.3.1.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
	at java.lang.Thread.run(Thread.java:833) [?:?]

-837836269738182490-0.log

Environment

WIndows 10 Pro
IntelliJ IDEA 2022.2.3
IntelliJ project
JDK 17 (not reproducing on JDK 11)

Additional context

Not reproducing in UTBotJava project with JDK 11
Not reproducing with Fuzzing only mode or Symbolic only mode.
No exceptions present in Concrete executor log.

@alisevych alisevych added the ctg-bug Issue is a bug label Nov 3, 2022
@korifey korifey moved this to Todo in UTBot Java Nov 3, 2022
@alisevych alisevych changed the title JvmCrashExamples JvmCrashExamples Symbolic + Fuzzing mode produces errors with JDK 17 Nov 3, 2022
@alisevych alisevych added this to the 2022.12 Release milestone Nov 8, 2022
@alisevych alisevych added the priority-top-focus Top priority chosen by dev team label Nov 30, 2022
@denis-fokin denis-fokin removed this from the 2022.12 Release milestone Dec 21, 2022
@Domonion
Copy link
Collaborator

java.lang.reflect.InaccessibleObjectException: Unable to make field static final boolean java.security.AccessController.$assertionsDisabled accessible: module java.base does not "opens java.security" to unnamed module @358c99f

Looks like problem with modules. See OpenModulesContainer class

@alisevych alisevych added this to the 2023.03 Release milestone Feb 27, 2023
@alisevych alisevych assigned alisevych and unassigned alisevych Feb 28, 2023
@alisevych
Copy link
Member Author

Verified on the newest main - reproducing.

@alisevych alisevych removed this from the 2023.03 Release milestone Mar 2, 2023
@alisevych
Copy link
Member Author

Not reproducing any more - with UnitTestBot running on Java 17.
Verified on plugin built from unit-test-bot/rc2023.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-bug Issue is a bug priority-top-focus Top priority chosen by dev team
Projects
Archived in project
Development

No branches or pull requests

3 participants