Skip to content
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

Fuzzing is stopped because of an error IllegalStateException: unknown type of value abc (class kotlin.String) #2527

Closed
tyuldashev opened this issue Aug 17, 2023 · 0 comments · Fixed by #2558
Assignees
Labels
comp-fuzzing Issue is related to the fuzzing ctg-bug Issue is a bug status-verified Bug fix is verified

Comments

@tyuldashev
Copy link
Collaborator

Description
Fuzzing cannot generate tests for String::startWith with constant string as parameter.

To Reproduce

  1. Install UnitTestBot plugin built from main in IntelliJ IDEA
  2. Open UTBot project
  3. Set Fuzzing = 100%
  4. Generate tests for org.utbot.examples.strings.StringExamples#prefixWithOffset methods.
    public int prefixWithOffset(int o) {
        return "babc".startsWith("abc", o) ? 1 : 2;
    }

Expected behavior
Tests are generated.

Actual behavior
No tests are generated. The is an error in the log.

Screenshots, logs
utbot-engine-current.log:

13:35:54.089 | INFO  | JavaLanguage              | Fuzzing is stopped because of an error
java.lang.IllegalStateException: unknown type of value abc (class kotlin.String)
	at org.utbot.fuzzing.seeds.BitVectorValue$Companion.fromValue(BitVectorValue.kt:166) ~[utbot-fuzzing-2023.8.5094.jar:?]
	at org.utbot.fuzzing.providers.IntegerValueProvider$generate$1.invokeSuspend(Primitives.kt:140) ~[utbot-java-fuzzing-2023.8.5094.jar:?]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
	at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:129) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
	at org.utbot.fuzzing.ValueProvider$Combined$generate$1.invokeSuspend(Providers.kt:231) ~[utbot-fuzzing-2023.8.5094.jar:?]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
	at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:129) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
	at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:307) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
	at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
	at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:787) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
	at kotlin.sequences.SequencesKt___SequencesKt.toMutableList(_Sequences.kt:817) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
	at kotlin.sequences.SequencesKt___SequencesKt.toList(_Sequences.kt:808) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
	at org.utbot.fuzzing.FuzzingApi.produce(Api.kt:416) ~[utbot-fuzzing-2023.8.5094.jar:?]
	at org.utbot.fuzzing.FuzzingApi.fuzz(Api.kt:391) ~[utbot-fuzzing-2023.8.5094.jar:?]
	at org.utbot.fuzzing.FuzzingApi.fuzz$fuzzOne(Api.kt:323) ~[utbot-fuzzing-2023.8.5094.jar:?]
	at org.utbot.fuzzing.FuzzingApi.fuzz(Api.kt:342) ~[utbot-fuzzing-2023.8.5094.jar:?]
	at org.utbot.fuzzing.FuzzingApi.fuzz(Api.kt:306) ~[utbot-fuzzing-2023.8.5094.jar:?]
	at org.utbot.fuzzing.ProvidersKt.runFuzzing(Providers.kt:18) ~[utbot-fuzzing-2023.8.5094.jar:?]
	at org.utbot.fuzzing.JavaLanguageKt.runJavaFuzzing(JavaLanguage.kt:120) ~[utbot-java-fuzzing-2023.8.5094.jar:?]
	at org.utbot.engine.UtBotSymbolicEngine$fuzzing$2.invokeSuspend(UtBotSymbolicEngine.kt:451) ~[utbot-framework-2023.8.5094.jar:?]
	at org.utbot.engine.UtBotSymbolicEngine$fuzzing$2.invoke(UtBotSymbolicEngine.kt) ~[utbot-framework-2023.8.5094.jar:?]
	at org.utbot.engine.UtBotSymbolicEngine$fuzzing$2.invoke(UtBotSymbolicEngine.kt) ~[utbot-framework-2023.8.5094.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__ErrorsKt.catchImpl(Errors.kt:156) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.FlowKt.catchImpl(Unknown Source) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at kotlinx.coroutines.flow.FlowKt__ErrorsKt$catch$$inlined$unsafeFlow$1.collect(SafeCollector.common.kt:113) ~[kotlinx-coroutines-core-jvm-1.6.3.jar:?]
	at org.utbot.framework.plugin.api.TestCaseGenerator$generate$2$3$1$1.invokeSuspend(TestCaseGenerator.kt:222) ~[utbot-framework-2023.8.5094.jar:?]
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.8.10.jar:1.8.10-release-430(1.8.10)]
	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.common.ConcurrencyKt.runBlockingWithCancellationPredicate(Concurrency.kt:38) ~[utbot-core-2023.8.5094.jar:?]
	at org.utbot.framework.plugin.api.TestCaseGenerator$generate$2$3.invoke(TestCaseGenerator.kt:196) ~[utbot-framework-2023.8.5094.jar:?]
	at org.utbot.framework.plugin.api.TestCaseGenerator$generate$2$3.invoke(TestCaseGenerator.kt:195) ~[utbot-framework-2023.8.5094.jar:?]
	at org.utbot.common.ConcurrencyKt.runIgnoringCancellationException(Concurrency.kt:47) ~[utbot-core-2023.8.5094.jar:?]
	at org.utbot.framework.plugin.api.TestCaseGenerator.generate(TestCaseGenerator.kt:195) ~[utbot-framework-2023.8.5094.jar:?]
	at org.utbot.framework.process.EngineProcessMainKt$setup$4.invoke(EngineProcessMain.kt:139) ~[utbot-framework-2023.8.5094.jar:?]
	at org.utbot.framework.process.EngineProcessMainKt$setup$4.invoke(EngineProcessMain.kt:124) ~[utbot-framework-2023.8.5094.jar:?]
	at org.utbot.rd.IdleWatchdog$measureTimeForActiveCall$1$2$1.invoke(ClientProcessUtil.kt:115) ~[utbot-rd-2023.8.5094.jar:?]
	at org.utbot.rd.IdleWatchdog.wrapActive(ClientProcessUtil.kt:88) ~[utbot-rd-2023.8.5094.jar:?]
	at org.utbot.rd.IdleWatchdog$measureTimeForActiveCall$1.invoke(ClientProcessUtil.kt:114) ~[utbot-rd-2023.8.5094.jar:?]
	at com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182) ~[rd-framework-2023.1.2.jar:?]
	at com.jetbrains.rd.framework.IRdEndpoint$set$1.invoke(TaskInterfaces.kt:182) ~[rd-framework-2023.1.2.jar:?]
	at com.jetbrains.rd.framework.impl.RdCall.onWireReceived(RdTask.kt:362) ~[rd-framework-2023.1.2.jar:?]
	at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:57) ~[rd-framework-2023.1.2.jar:?]
	at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:56) ~[rd-framework-2023.1.2.jar:?]
	at com.jetbrains.rd.framework.impl.ProtocolContexts.readMessageContextAndInvoke(ProtocolContexts.kt:148) ~[rd-framework-2023.1.2.jar:?]
	at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:56) ~[rd-framework-2023.1.2.jar:?]
	at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:54) ~[rd-framework-2023.1.2.jar:?]
	at com.jetbrains.rd.util.threading.SingleThreadSchedulerBase.queue$lambda-3(SingleThreadScheduler.kt:41) ~[rd-core-2023.1.2.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) [?:?]
13:35:54.179 | INFO  | Summarization             | Started: ----------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-fuzzing Issue is related to the fuzzing ctg-bug Issue is a bug status-verified Bug fix is verified
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants