Error in instrumented process when Fuzzing a recursive class
Description
Error in instrumented process when Fuzzing IR method in Unit tests
To Reproduce
- Install UnitTestBot plugin built from main in IntelliJ IDEA
- Open
UTBotJavaproject - Set Fuzzing 100% mode //not strictly necessary
- Generate tests for
Recursionclass inutbot-sample
Expected behavior
No errors in instrumented process are expected. Class is expected to be correctly instantiated and methods executed.
Actual behavior
There is error report with 11K-20K occurrences of Default concrete execution failed
for every method under test
Screenshots, logs
public final class RecursionTest {
///region Test suites for executable org.utbot.examples.recursion.Recursion.fib
///region Errors report for fib
public void testFib_errors() {
// Couldn't generate some tests. List of errors:
//
// 11099 occurrences of:
// Default concrete execution failed
}
///endregion
///endregion
Environment
IntelliJ IDEA version - 2023.2 Ultimate Project - Maven/Gradle JDK - 1.8/17
After setting Hanging test timeout to 100 ms, enabling Power saving mode on my laptop (to worsen the performance) and generating tests a few times, I've managed to get some concrete execution failures.
Here are the logs: utbot-engine-current.log.
It seems that concrete failures were caused by timeout happening during evaluation of static initialization block in JavaStdLibCustomModelConstructorsKt, which caused class loader to mark JavaStdLibCustomModelConstructorsKt as non-loadable, since it can't be initialized, which in turn made all later invocations to fail with NoClassDefFoundError: Could not initialize class JavaStdLibCustomModelConstructorsKt.
That raises the question about of safe termination of hanging threads. I propose to do class loading, executing <clinit> methods, and thread termination under same monitor to avoid such problems, however further discussion is advised.
@tyuldashev The issue is not reproducing for me in UTBotJava with plugin built from latest main. Can you please verify it?
Yep, not reproducible at the moment. Though if probable cause is identified then we maybe should not close case without further discussion.