Kotlin构建导致JVM分段错误

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

./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机器上,我无法读取它,因为配置文件在构建完成(成功或失败)时破坏了容器。 有什么我可以尝试或以任何方式得到进一步的诊断,或者如果有人遇到这个问题?

编辑好了,所以我能够得到SIGSEGV上正在生成的文件。 这是巨大的,所以我把它附加到一个pastebin: https : //pastebin.com/Jkvp6uYx

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

  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.()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.()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.()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 

Kotlin language will be the best programming language for Android.