UTBotJava icon indicating copy to clipboard operation
UTBotJava copied to clipboard

Error in instrumented process when Fuzzing a recursive class

Open alisevych opened this issue 3 years ago • 3 comments

Description

Error in instrumented process when Fuzzing IR method in Unit tests

To Reproduce

  1. Install UnitTestBot plugin built from main in IntelliJ IDEA
  2. Open UTBotJava project
  3. Set Fuzzing 100% mode //not strictly necessary
  4. Generate tests for Recursion class in utbot-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

alisevych avatar Aug 22 '23 14:08 alisevych

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.

IlyaMuravjov avatar Aug 24 '23 15:08 IlyaMuravjov

@tyuldashev The issue is not reproducing for me in UTBotJava with plugin built from latest main. Can you please verify it?

alisevych avatar Sep 19 '23 13:09 alisevych

Yep, not reproducible at the moment. Though if probable cause is identified then we maybe should not close case without further discussion.

tyuldashev avatar Sep 19 '23 15:09 tyuldashev