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

exception: java.lang.AssertionError: Assertion failed #1811

Closed
chinacharis opened this issue Jul 18, 2018 · 5 comments
Closed

exception: java.lang.AssertionError: Assertion failed #1811

chinacharis opened this issue Jul 18, 2018 · 5 comments
Assignees
Labels

Comments

@chinacharis
Copy link

fun String.Companion.format(format: String, args: Array): String {
var buffer = StringBuilder()

return buffer.toString()

}

fun String.Companion.format(format: String, value: String): String {
var buffer = StringBuilder()

return buffer.toString()

}

val sql = String.format("SELECT updatetime from %s where account='%s'", arrayOf("uinfo", "zhua"))

lead this exception:
Information:Building target 'testsdk' for architecture 'arm64' using 'iOS 11.4' sdk
Information:Running script 'Compile Kotlin/Native'

Configure project :
feature GRADLE_METADATA is not enabled: publication is disabled
Task :checkKonanCompiler
Task :compileKonanTestsdkIos_arm64
Error:compilation failed: Assertion failed

  • Source files: AObserve.kt, AuthServiceObserver.kt, Base64.kt, Decoder.kt, Encoder.kt, Observer.kt, StringEx.kt, UcSTARSystem.kt
  • Compiler version info: Konan: 0.8 / Kotlin: 1.2.70
  • Output kind: FRAMEWORK
    exception: java.lang.AssertionError: Assertion failed
    at org.jetbrains.kotlin.backend.konan.llvm.LlvmUtilsKt.importGlobal(LlvmUtils.kt:219)
    at org.jetbrains.kotlin.backend.konan.llvm.CodeGenerator.getObjectInstanceStorage(CodeGenerator.kt:64)
    at org.jetbrains.kotlin.backend.konan.llvm.FunctionGenerationContext.getObjectValue(CodeGenerator.kt:698)
    at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGeneratorKt.createObjectInstanceAdapter(ObjCExportCodeGenerator.kt:1048)
    at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGeneratorKt.createTypeAdapter(ObjCExportCodeGenerator.kt:950)
    at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGeneratorKt.access$createTypeAdapter(ObjCExportCodeGenerator.kt:1)
    at org.jetbrains.kotlin.backend.konan.llvm.objcexport.ObjCExportCodeGenerator.emitRtti$backend_native_compiler(ObjCExportCodeGenerator.kt:160)
    at org.jetbrains.kotlin.backend.konan.objcexport.ObjCExport.produce$backend_native_compiler(ObjCExport.kt:74)
    at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitModuleFragment(IrToBitcode.kt:354)
    at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitModuleFragment(IrElementVisitorVoid.kt:28)
    at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitModuleFragment(IrToBitcode.kt:263)
    at org.jetbrains.kotlin.backend.konan.llvm.CodeGeneratorVisitor.visitModuleFragment(IrToBitcode.kt:263)
    at org.jetbrains.kotlin.ir.declarations.impl.IrModuleFragmentImpl.accept(IrModuleFragmentImpl.kt:46)
    at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoidKt.acceptVoid(IrElementVisitorVoid.kt:247)
    at org.jetbrains.kotlin.backend.konan.llvm.IrToBitcodeKt$emitLLVM$7.invoke(IrToBitcode.kt:130)
    at org.jetbrains.kotlin.backend.konan.llvm.IrToBitcodeKt$emitLLVM$7.invoke(IrToBitcode.kt)
    at org.jetbrains.kotlin.backend.konan.PhaseManager$phase$$inlined$with$lambda$1.invoke(KonanPhases.kt:139)
    at org.jetbrains.kotlin.backend.konan.PhaseManager$phase$$inlined$with$lambda$1.invoke(KonanPhases.kt:118)
    at org.jetbrains.kotlin.konan.util.UtilKt.profileIf(Util.kt:34)
    at org.jetbrains.kotlin.backend.konan.PhaseManager.phase$backend_native_compiler(KonanPhases.kt:138)
    at org.jetbrains.kotlin.backend.konan.llvm.IrToBitcodeKt.emitLLVM(IrToBitcode.kt:129)
    at org.jetbrains.kotlin.backend.konan.KonanDriverKt$runTopLevelPhases$4$2.invoke(KonanDriver.kt:97)
    at org.jetbrains.kotlin.backend.konan.KonanDriverKt$runTopLevelPhases$4$2.invoke(KonanDriver.kt)
    at org.jetbrains.kotlin.backend.konan.PhaseManager$phase$$inlined$with$lambda$1.invoke(KonanPhases.kt:139)
    at org.jetbrains.kotlin.backend.konan.PhaseManager$phase$$inlined$with$lambda$1.invoke(KonanPhases.kt:118)
    at org.jetbrains.kotlin.konan.util.UtilKt.profileIf(Util.kt:34)
    at org.jetbrains.kotlin.backend.konan.PhaseManager.phase$backend_native_compiler(KonanPhases.kt:138)
    at org.jetbrains.kotlin.backend.konan.KonanDriverKt$runTopLevelPhases$4.invoke(KonanDriver.kt:96)
    at org.jetbrains.kotlin.backend.konan.KonanDriverKt$runTopLevelPhases$4.invoke(KonanDriver.kt)
    at org.jetbrains.kotlin.backend.konan.PhaseManager$phase$$inlined$with$lambda$1.invoke(KonanPhases.kt:139)
    at org.jetbrains.kotlin.backend.konan.PhaseManager$phase$$inlined$with$lambda$1.invoke(KonanPhases.kt:118)
    at org.jetbrains.kotlin.konan.util.UtilKt.profileIf(Util.kt:34)
    at org.jetbrains.kotlin.backend.konan.PhaseManager.phase$backend_native_compiler(KonanPhases.kt:138)
    at org.jetbrains.kotlin.backend.konan.KonanDriverKt.runTopLevelPhases(KonanDriver.kt:90)
    at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:75)
    at org.jetbrains.kotlin.cli.bc.K2Native.doExecute(K2Native.kt:42)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:95)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:50)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:88)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:66)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:34)
    at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:180)
    at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:171)
    at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:197)
    at org.jetbrains.kotlin.cli.bc.K2Native$Companion$main$1.invoke(K2Native.kt:188)
    at org.jetbrains.kotlin.konan.util.UtilKt.profileIf(Util.kt:34)
    at org.jetbrains.kotlin.konan.util.UtilKt.profile(Util.kt:29)
    at org.jetbrains.kotlin.cli.bc.K2Native$Companion.main(K2Native.kt:190)
    at org.jetbrains.kotlin.cli.bc.K2NativeKt.main(K2Native.kt:202)
    at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:27)

Task :compileKonanTestsdkIos_arm64 FAILED
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileKonanTestsdkIos_arm64'.

Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_172.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
  • Get more help at https://help.gradle.org
    BUILD FAILED in 20s
    2 actionable tasks: 2 executed
    Error:Build failed in 21 s 614 ms
@olonho
Copy link
Contributor

olonho commented Aug 7, 2018

Is it still reproducible?

@vvlevchenko
Copy link
Contributor

I can't reproduce, feel free to reopen in case you're still experiencing the issue. It will be helpful if you provide the project or simplified its version.

@alexfacciorusso
Copy link

Same problem with 0.8.1 kotlin-platform-native plugin. Last lines in the log:

 * Source files: [various .kt files]
 * Compiler version info: Konan: 0.8.1 / Kotlin: 1.2.70
 * Output kind: FRAMEWORK

exception: java.lang.AssertionError: Assertion failed
	at org.jetbrains.kotlin.backend.konan.llvm.LlvmUtilsKt.importGlobal(LlvmUtils.kt:219)
	at org.jetbrains.kotlin.backend.konan.llvm.CodeGenerator.getObjectInstanceStorage(CodeGenerator.kt:64)
	at org.jetbrains.kotlin.backend.konan.llvm.FunctionGenerationContext.getObjectValue(CodeGenerator.kt:698)

@alexfacciorusso
Copy link

Checking the LlvmUtils.kt file at the line 219, seems that the failed assertion is
assert(LLVMGetThreadLocalMode(found) == context.llvm.tlsMode)

@sbogolepov sbogolepov reopened this Aug 8, 2018
@sbogolepov sbogolepov self-assigned this Aug 8, 2018
@sbogolepov sbogolepov added bug and removed need info labels Aug 8, 2018
sbogolepov added a commit that referenced this issue Aug 8, 2018
sbogolepov added a commit that referenced this issue Aug 8, 2018
sbogolepov added a commit that referenced this issue Aug 8, 2018
@sbogolepov
Copy link
Contributor

Fixed in master.

homuroll pushed a commit that referenced this issue Aug 8, 2018
homuroll pushed a commit that referenced this issue Aug 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants