Invalid `UTestCyclicReferenceDescriptor`
@DaniilStepanov 已经在做这个了。
开始于 2023年11月24日。
评估
这个 Issue 还没有评估数据。
描述
Add com.google.common.collect.TreeMultiset$AvlNode to UTBotJava/utbot-junit-contest/src/main/resources/classes/guava/list.
Run ContestEstimator with following settings:
timeLimit = 120
methodFilter = "com.google.common.collect.TreeMultiset\$AvlNode.deleteMe"
projectFilter = listOf("guava")
There's following error in logs:
23:55:01.029 | ERROR | JcToUtExecutionConverter.convert((id:19)com.google.common.collect.TreeMultiset$AvlNode#deleteMe()) failed
java.lang.IllegalStateException: Invalid UTestCyclicReferenceDescriptor: UTestCyclicReferenceDescriptor(refId=903229461, type=org.jacodb.impl.types.JcClassTypeImpl@105962b3)
at org.utbot.contest.usvm.converter.JcToUtModelConverter.convertIgnoringOriginExprForThisModel(JcToUtModelConverter.kt:152) ~[main/:?]
at org.utbot.contest.usvm.converter.JcToUtModelConverter.convert(JcToUtModelConverter.kt:72) ~[main/:?]
at org.utbot.contest.usvm.converter.JcToUtModelConverter.convertIgnoringOriginExprForThisModel(JcToUtModelConverter.kt:106) ~[main/:?]
at org.utbot.contest.usvm.converter.JcToUtModelConverter.convert(JcToUtModelConverter.kt:72) ~[main/:?]
at org.utbot.contest.usvm.converter.JcToUtModelConverter.convertIgnoringOriginExprForThisModel(JcToUtModelConverter.kt:106) ~[main/:?]
at org.utbot.contest.usvm.converter.JcToUtModelConverter.convert(JcToUtModelConverter.kt:72) ~[main/:?]
at org.utbot.contest.usvm.converter.JcToUtExecutionConverter.convertState(JcToUtExecutionConverter.kt:224) ~[main/:?]
at org.utbot.contest.usvm.converter.JcToUtExecutionConverter.convert(JcToUtExecutionConverter.kt:73) ~[main/:?]
at org.utbot.contest.usvm.ContestUsvmKt$runUsvmGeneration$1$9$5.invoke(ContestUsvm.kt:190) [main/:?]
at org.utbot.contest.usvm.ContestUsvmKt$runUsvmGeneration$1$9$5.invoke(ContestUsvm.kt:168) [main/:?]
at org.utbot.contest.usvm.ContestUsvmKt$analyzeAsync$1$1$1.addState(ContestUsvm.kt:275) [main/:?]
at org.utbot.contest.usvm.ContestUsvmKt$analyzeAsync$1$1$1.addState(ContestUsvm.kt:269) [main/:?]
at org.usvm.statistics.collectors.CoveredNewStatesCollector.onStateTerminated(CoveredNewStatesCollector.kt:33) [usvm-core-local24-22-29.jar:?]
at org.usvm.statistics.CompositeUMachineObserver.onStateTerminated(UMachineObserver.kt:48) [usvm-core-local24-22-29.jar:?]
at org.usvm.UMachine.run(Machine.kt:66) [usvm-core-local24-22-29.jar:?]
at org.usvm.machine.JcMachine.analyze(JcMachine.kt:195) [usvm-jvm-local24-22-29.jar:?]
at org.utbot.contest.usvm.ContestUsvmKt$analyzeAsync$1.invoke(ContestUsvm.kt:267) [main/:?]
at org.utbot.contest.usvm.ContestUsvmKt$analyzeAsync$1.invoke(ContestUsvm.kt:265) [main/:?]
at org.utbot.common.ThreadBasedExecutor$invokeWithTimeout$1.invoke(ThreadUtil.kt:75) [utbot-core-2023.11-SNAPSHOT.jar:?]
at org.utbot.common.ThreadBasedExecutor$ensureThreadIsAlive$1.invoke(ThreadUtil.kt:129) [utbot-core-2023.11-SNAPSHOT.jar:?]
at org.utbot.common.ThreadBasedExecutor$ensureThreadIsAlive$1.invoke(ThreadUtil.kt:125) [utbot-core-2023.11-SNAPSHOT.jar:?]
at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30) [kotlin-stdlib-1.8.22.jar:1.8.22-release-407(1.8.22)]
The issue is that in the instrumentation output there is UTestCyclicReferenceDescriptor with refId=903229461 in such place that no UTestObjectDescriptor containing it has refId=903229461.
Note, that is generally impossible in current abstractions to simultaneously always:
- Have no cycles of
UTestValueDescriptor - Only have
UTestCyclicReferenceDescriptorin such places where there'sUTestObjectDescriptorcontaining it and having samerefId(here "containing" allows for indirect containing with intermediate layers, i.e. transitive closure of direct containment relationship) - Never use multiple
UTestObjectDescriptors to describe same object in same state (initialStateorfinalState)
Consider the following example, where we want to build descriptor for result:
val x = X()
val y = Y()
y.x = x
x.y = y
val result = Result(x=x, y=y)
Here descriptors for result.y.x.y should be UTestCyclicReferenceDescriptor (to satisfy assumption 1) and descriptor for result.x.y should be UTestObjectDescriptor (to satisfy assumption 2), but they should be the same descriptor, i.e. descriptor in y field of descriptor for x, where x can only be described by only one instance of UTestObjectDescriptor (to satisfy assumption 3).
Further discussion is advised.
- 主要语言
- Kotlin
- 星标
- 33
- 派生
- 27
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 15
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
UnitTestBot/usvm 的其他 Issue
-
难度 5/5 一周以上 新手友好度 45/100
UnitTestBot/usvm#388 ·
-
难度 5/5 一周以上 新手友好度 25/100
UnitTestBot/usvm#384 ·
-
难度 5/5 一周以上 新手友好度 35/100
UnitTestBot/usvm#382 ·
-
难度 4/5 3-5 天 新手友好度 48/100
UnitTestBot/usvm#379 ·
-
难度 5/5 一周以上 新手友好度 25/100
UnitTestBot/usvm#373 ·
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
Anthonyy232/Paperize#614 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Issue: Bug
难度 1/5 1 小时以内 新手友好度 91/100
OpenAPITools/openapi-generator#24978 ·
-
helsemelding-json-schema json-schema-core
难度 2/5 1-3 小时 新手友好度 68/100