Skip to content

JBMC with Kotlin. #6579

Open
Open
@jkbbwr

Description

@jkbbwr

Upfront want to say, I know its not the standard usecase but it seems that JBMC works great out the box with kotlin for most situations.

This is awesome thank you guys!

I did however find a strange behaviour.

When running this code via JBMC

package dev.kibb.kfx

fun main() {
    val s: String? = null
    s!!
}

When executed via the JVM normally it results in

Exception in thread "main" java.lang.NullPointerException
        at dev.kibb.kfx.MainKt.main(main.kt:5)
        at dev.kibb.kfx.MainKt.main(main.kt)

When executed via JBMC it seems to infinitely unroll some internal stacktrace function.

Summary Details:

CBMC version: 5.48.0 (cbmc-5.48.0-19-g9f9ee0788)
Operating system: Arch Linux - Linux devroot 5.15.12-arch1-1 #1 SMP PREEMPT Wed, 29 Dec 2021 12:04:56 +0000 x86_64 GNU/Linux
Exact command line resulting in the issue: ~/tmp/cbmc/build/bin/jbmc -jar build/libs/kfx-1.0-SNAPSHOT-all.jar --java-assume-inputs-non-null --trace
What behaviour did you expect: Verification to fail with a null pointer failure state.
What happened instead: Seems to be an infinite unwind in internal code.

Unwinding loop java::kotlin.jvm.internal.Intrinsics.sanitizeStackTrace:(Ljava/lang/Throwable;Ljava/lang/String;)Ljava/lang/Throwable;.0 iteration 692 file kotlin/jvm/internal/Intrinsics.java line 259 function java::kotlin.jvm.internal.Intrinsics.sanitizeStackTrace:(Ljava/lang/Throwable;Ljava/lang/String;)Ljava/lang/Throwable; bytecode-index 23 thread 0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions