Skip to content
This repository has been archived by the owner on Aug 10, 2021. It is now read-only.

0.8.2 regression: java.lang.ArrayIndexOutOfBoundsException: 73 #1869

Closed
soywiz opened this issue Aug 11, 2018 · 5 comments
Closed

0.8.2 regression: java.lang.ArrayIndexOutOfBoundsException: 73 #1869

soywiz opened this issue Aug 11, 2018 · 5 comments

Comments

@soywiz
Copy link
Contributor

soywiz commented Aug 11, 2018

The stacktrace: (I'm going to investigate the root cause)

 * Compiler version info: Konan: 0.8.2 / Kotlin: 1.2.70
 * Output kind: LIBRARY

exception: java.lang.ArrayIndexOutOfBoundsException: 73
        at org.jetbrains.kotlin.backend.konan.optimizations.DFGSerializer$Node$Companion.read(DFGSerializer.kt:690)
        at org.jetbrains.kotlin.backend.konan.optimizations.DFGSerializer$FunctionBody.<init>(DFGSerializer.kt:715)
        at org.jetbrains.kotlin.backend.konan.optimizations.DFGSerializer$Function.<init>(DFGSerializer.kt:726)
        at org.jetbrains.kotlin.backend.konan.optimizations.DFGSerializer$Module.<init>(DFGSerializer.kt:736)
        at org.jetbrains.kotlin.backend.konan.optimizations.DFGSerializer.deserialize(DFGSerializer.kt:956)
        at org.jetbrains.kotlin.backend.konan.llvm.IrToBitcodeKt$emitLLVM$3.invoke(IrToBitcode.kt:84)
        at org.jetbrains.kotlin.backend.konan.llvm.IrToBitcodeKt$emitLLVM$3.invoke(IrToBitcode.kt)
        at org.jetbrains.kotlin.backend.konan.PhaseManager$phase$$inlined$with$lambda$1.invoke(KonanPhases.kt:145)
        at org.jetbrains.kotlin.backend.konan.PhaseManager$phase$$inlined$with$lambda$1.invoke(KonanPhases.kt:119)
        at org.jetbrains.kotlin.konan.util.UtilKt.profileIf(Util.kt:34)
        at org.jetbrains.kotlin.backend.konan.PhaseManager.phase(KonanPhases.kt:144)
        at org.jetbrains.kotlin.backend.konan.llvm.IrToBitcodeKt.emitLLVM(IrToBitcode.kt:83)
        at org.jetbrains.kotlin.backend.konan.KonanDriverKt$runTopLevelPhases$5$2.invoke(KonanDriver.kt:102)
        at org.jetbrains.kotlin.backend.konan.KonanDriverKt$runTopLevelPhases$5$2.invoke(KonanDriver.kt)
        at org.jetbrains.kotlin.backend.konan.PhaseManager$phase$$inlined$with$lambda$1.invoke(KonanPhases.kt:145)
        at org.jetbrains.kotlin.backend.konan.PhaseManager$phase$$inlined$with$lambda$1.invoke(KonanPhases.kt:119)
        at org.jetbrains.kotlin.konan.util.UtilKt.profileIf(Util.kt:34)
@homuroll
Copy link
Contributor

Seems like klib formats clash. Does cleaning & rebuilding help?

@soywiz
Copy link
Contributor Author

soywiz commented Aug 13, 2018

I tried ./gradlew clean + ./gradlew --stop several times before posting including several combinations of Kotlin versions. It is a bit strange because with master I don't have this error (but get some other link-time errors).

Going to try again just in case I missed something and get in touch again with the results.

@soywiz
Copy link
Contributor Author

soywiz commented Aug 13, 2018

Reproduced here: https://travis-ci.org/korlibs/korlibs/jobs/415351482#L2584-L2639

I thought that everything was compiled from source, but now I remember that I was using kotlinx.coroutines 0.24.0. So my bet is that somehow it is not compatible.

If you can confirm it is due to that. I would propose the following:

  • Request a new version of kotlinx.coroutines compatible with 0.8.2
  • Keep a table with compatible versions of kotlinx.coroutines with kotlin-native
  • Insert a binary version tag in the libraries, and change it each time the binary serialization format changes
  • Check that version when loading a library and fail fast and providing information about the offending library

@homuroll
Copy link
Contributor

Thank you. Actually there is a version tag in a library, seems like there is a bug in the algorithm that builds it.

@homuroll
Copy link
Contributor

Fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants