gpt4 book ai didi

gradle - Kotlin 构建导致 JVM 段错误

转载 作者:行者123 更新时间:2023-12-02 12:39:26 27 4
gpt4 key购买 nike

我有一个 Kotlin+Java 项目,我们正在使用 Gradle 构建它。这是我正在使用的命令:

./gradlew "-Pkotlin.incremental=false" --info clean build javadoc

此外,我的 GRADLE_OPTS 设置为:

GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.parallel=false"

这是我得到的错误:

Could not perform non-incremental compilation with Kotlin compile daemon, non-incremental compilation in fallback mode will be performed
Could not connect to kotlin daemon. Using fallback strategy.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f3b93fffeee, pid=8, tid=0x00007f3b954fb700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_121-b13) (build 1.8.0_121-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.121-b13 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x6e2eee] jni_SetStaticIntField+0xee

它写入一个文件(hs_err_pid8.log 或类似的文件),但这是在 CI 机器上,我无法读取它,因为 CI 在构建时破坏了容器完成(成功或失败)。我可以尝试什么或有什么方法可以得到进一步的诊断,或者是否有人遇到过这个问题?

编辑好的,所以我能够获取在SIGSEGV上生成的文件。它很大,所以我将它附加到粘贴箱中:https://pastebin.com/Jkvp6uYx

现在我不确定相关部分是什么,但我确实看到了可能相关部分的堆栈跟踪(到目前为止的日志让我们相信这与 gradle 增量任务有关):

    Stack: [0x00007fc7f0ece000,0x00007fc7f0fcf000],  sp=0x00007fc7f0fc7b20,  free space=998k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [libjvm.so+0x6e2eee] jni_SetStaticIntField+0xee
C [libjansi.so+0xf38] Java_org_fusesource_jansi_internal_CLibrary_init+0x108
j org.fusesource.jansi.internal.CLibrary.<clinit>()V+20
v ~StubRoutines::call_stub
V [libjvm.so+0x690dd6] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x1056
V [libjvm.so+0x642be7] InstanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*)+0xd7
V [libjvm.so+0x6451fc] InstanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x1ac
V [libjvm.so+0x6455c1] InstanceKlass::initialize(Thread*)+0x41
V [libjvm.so+0x7f3c2f] LinkResolver::resolve_field(fieldDescriptor&, KlassHandle, Symbol*, Symbol*, KlassHandle, Bytecodes::Code, bool, bool, Thread*)+0x4df
V [libjvm.so+0x7f3e95] LinkResolver::resolve_field_access(fieldDescriptor&, constantPoolHandle, int, Bytecodes::Code, Thread*)+0x245
V [libjvm.so+0x688d15] InterpreterRuntime::resolve_get_put(JavaThread*, Bytecodes::Code)+0x125
j org.jetbrains.kotlin.cli.common.messages.PlainTextMessageRenderer.<clinit>()V+21
v ~StubRoutines::call_stub
V [libjvm.so+0x690dd6] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x1056
V [libjvm.so+0x642be7] InstanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*)+0xd7
V [libjvm.so+0x6451fc] InstanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x1ac
V [libjvm.so+0x6455c1] InstanceKlass::initialize(Thread*)+0x41
V [libjvm.so+0x64543d] InstanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x3ed
V [libjvm.so+0x6455c1] InstanceKlass::initialize(Thread*)+0x41
V [libjvm.so+0x6854fa] InterpreterRuntime::_new(JavaThread*, ConstantPool*, int)+0x23a
j org.jetbrains.kotlin.cli.common.messages.MessageRenderer.<clinit>()V+10
v ~StubRoutines::call_stub
V [libjvm.so+0x690dd6] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x1056
V [libjvm.so+0x642be7] InstanceKlass::call_class_initializer_impl(instanceKlassHandle, Thread*)+0xd7
V [libjvm.so+0x6451fc] InstanceKlass::initialize_impl(instanceKlassHandle, Thread*)+0x1ac
V [libjvm.so+0x6455c1] InstanceKlass::initialize(Thread*)+0x41
V [libjvm.so+0x7f3c2f] LinkResolver::resolve_field(fieldDescriptor&, KlassHandle, Symbol*, Symbol*, KlassHandle, Bytecodes::Code, bool, bool, Thread*)+0x4df
V [libjvm.so+0x7f3e95] LinkResolver::resolve_field_access(fieldDescriptor&, constantPoolHandle, int, Bytecodes::Code, Thread*)+0x245
V [libjvm.so+0x688d15] InterpreterRuntime::resolve_get_put(JavaThread*, Bytecodes::Code)+0x125
j org.jetbrains.kotlin.cli.common.CLICompiler.execAndOutputXml(Ljava/io/PrintStream;Lorg/jetbrains/kotlin/config/Services;[Ljava/lang/String;)Lorg/jetbrains/kotlin/cli/common/ExitCode;+123
v ~StubRoutines::call_stub
V [libjvm.so+0x690dd6] JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*)+0x1056
V [libjvm.so+0x99c357] Reflection::invoke(instanceKlassHandle, methodHandle, Handle, bool, objArrayHandle, BasicType, objArrayHandle, bool, Thread*)+0x5d7
V [libjvm.so+0x99fa67] Reflection::invoke_method(oopDesc*, Handle, objArrayHandle, Thread*)+0x147
V [libjvm.so+0x72447b] JVM_InvokeMethod+0x26b
J 1277 sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (0 bytes) @ 0x00007fc7d9405bad [0x00007fc7d9405ac0+0xed]
J 1276 C1 sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (104 bytes) @ 0x00007fc7d940627c [0x00007fc7d9405ee0+0x39c]
J 8712 C2 java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (62 bytes) @ 0x00007fc7da72c92c [0x00007fc7da72c8a0+0x8c]
j org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compileInProcess([Ljava/lang/String;Ljava/lang/String;Lorg/jetbrains/kotlin/compilerRunner/GradleCompilerEnvironment;)Lorg/jetbrains/kotlin/cli/common/ExitCode;+142
j org.jetbrains.kotlin.compilerRunner.GradleCompilerRunner.compileWithDaemonOrFallback(Ljava/lang/String;Lorg/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments;Lorg/jetbrains/kotlin/compilerRunner/GradleCompilerEnvironment;)Lorg/jetbrains/kotlin/cli/common/ExitCode;+520

最佳答案

我把钱放在了困惑的类路径中。您有 2 个版本的 Kotlin stdlib(1.1.1 和 1.1-M2)以及 kotlin-annotation-processing 1.1.0。

确保一切都在 1.1.1(或现在的 1.1.2-2)

关于gradle - Kotlin 构建导致 JVM 段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43606380/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com