Skip to content

Requiring rugged gem causes segfault #1088

@liamwhite

Description

@liamwhite

This took me hours to find.

$ pry
[1] pry(main)> require 'rugged'
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fa42f10a02a, pid=9844, tid=0x00007fa43029e700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_151-b12) (build 1.8.0_151-b12)
# Java VM: GraalVM 0.31 (25.71-b01-internal-jvmci-0.40 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0xade02a]  Unsafe_SetNativeAddress+0xca
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/backups/truffletest/hs_err_pid9844.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Aborted
Stack: [0x00007fa43019e000,0x00007fa43029f000],  sp=0x00007fa43028a240,  free space=944k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0xade02a]  Unsafe_SetNativeAddress+0xca
j  sun.misc.Unsafe.putAddress(JJ)V+0
j  com.oracle.truffle.llvm.runtime.memory.LLVMMemory.putAddress(JJ)V+25
j  com.oracle.truffle.llvm.runtime.memory.LLVMMemory.putAddress(JLcom/oracle/truffle/llvm/runtime/LLVMAddress;)V+6
j  com.oracle.truffle.llvm.runtime.global.LLVMGlobalWriteNode$WriteObjectNode.doNative(Lcom/oracle/truffle/api/frame/VirtualFrame;Lcom/oracle/truffle/llvm/runtime/global/LLVMGlobal;Ljava/lang/Object;Lcom/oracle/truffle/llvm/runtime/global/LLVMGlobal$GetNativePointer;Lcom/oracle/truffle/llvm/runtime/nodes/api/LLVMToNativeNode;)Ljava/lang/Object;+21
j  com.oracle.truffle.llvm.runtime.global.LLVMGlobalWriteNodeFactory$WriteObjectNodeGen.executeAndSpecialize(Lcom/oracle/truffle/api/frame/VirtualFrame;Lcom/oracle/truffle/llvm/runtime/global/LLVMGlobal;Ljava/lang/Object;)Ljava/lang/Object;+182
j  com.oracle.truffle.llvm.runtime.global.LLVMGlobalWriteNodeFactory$WriteObjectNodeGen.execute(Lcom/oracle/truffle/api/frame/VirtualFrame;Lcom/oracle/truffle/llvm/runtime/global/LLVMGlobal;Ljava/lang/Object;)Ljava/lang/Object;+82
j  com.oracle.truffle.llvm.nodes.memory.store.LLVMGlobalVariableStoreNode.doNative(Lcom/oracle/truffle/api/frame/VirtualFrame;Lcom/oracle/truffle/llvm/runtime/LLVMAddress;Lcom/oracle/truffle/llvm/runtime/global/LLVMGlobalWriteNode$WriteObjectNode;)Ljava/lang/Object;+7
j  com.oracle.truffle.llvm.nodes.memory.store.LLVMGlobalVariableStoreNodeGen.executeAndSpecialize(Lcom/oracle/truffle/api/frame/VirtualFrame;Ljava/lang/Object;)Ljava/lang/Object;+152
j  com.oracle.truffle.llvm.nodes.memory.store.LLVMGlobalVariableStoreNodeGen.executeGeneric(Lcom/oracle/truffle/api/frame/VirtualFrame;)Ljava/lang/Object;+243
j  com.oracle.truffle.llvm.nodes.others.LLVMStaticInitsBlockNode.execute(Lcom/oracle/truffle/api/frame/VirtualFrame;)Ljava/lang/Object;+44
J 5618 C1 org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callProxy(Lcom/oracle/truffle/api/frame/VirtualFrame;)Ljava/lang/Object; (138 bytes) @ 0x00007fa414bc7e24 [0x00007fa414bc7dc0+0x64]
J 5617 C1 org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callRoot([Ljava/lang/Object;)Ljava/lang/Object; (53 bytes) @ 0x00007fa414bc795c [0x00007fa414bc78a0+0xbc]
J 11153 JVMCI org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary([Ljava/lang/Object;)Ljava/lang/Object; (33 bytes) @ 0x00007fa41490328c [0x00007fa4149031e0+0xac]
J 8922 C1 org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call([Ljava/lang/Object;)Ljava/lang/Object; (19 bytes) @ 0x00007fa4153da95c [0x00007fa4153da720+0x23c]
j  com.oracle.truffle.llvm.Runner.handleParserResult(Lcom/oracle/truffle/llvm/runtime/LLVMContext;Lcom/oracle/truffle/llvm/parser/LLVMParserResult;)V+95
j  com.oracle.truffle.llvm.Runner.parse(Lcom/oracle/truffle/llvm/runtime/LLVMLanguage;Lcom/oracle/truffle/llvm/runtime/LLVMContext;Lcom/oracle/truffle/api/source/Source;Lcom/oracle/truffle/llvm/runtime/LLVMContext$ExternalLibrary;Ljava/nio/ByteBuffer;)Lcom/oracle/truffle/api/CallTarget;+204
j  com.oracle.truffle.llvm.Runner.parse(Lcom/oracle/truffle/llvm/runtime/LLVMLanguage;Lcom/oracle/truffle/llvm/runtime/LLVMContext;Lcom/oracle/truffle/api/source/Source;)Lcom/oracle/truffle/api/CallTarget;+169
j  com.oracle.truffle.llvm.Sulong.parse(Lcom/oracle/truffle/api/TruffleLanguage$ParsingRequest;)Lcom/oracle/truffle/api/CallTarget;+22
j  com.oracle.truffle.api.TruffleLanguage$ParsingRequest.parse(Lcom/oracle/truffle/api/TruffleLanguage;)Lcom/oracle/truffle/api/CallTarget;+2
j  com.oracle.truffle.api.TruffleLanguage.parse(Lcom/oracle/truffle/api/source/Source;Lcom/oracle/truffle/api/nodes/Node;Lcom/oracle/truffle/api/frame/MaterializedFrame;[Ljava/lang/String;)Lcom/oracle/truffle/api/CallTarget;+17
j  com.oracle.truffle.api.TruffleLanguage$Env.parse(Lcom/oracle/truffle/api/source/Source;[Ljava/lang/String;)Lcom/oracle/truffle/api/CallTarget;+32
j  org.truffleruby.language.loader.FeatureLoader.parseSource(Lcom/oracle/truffle/api/source/Source;)Lcom/oracle/truffle/api/CallTarget;+12
j  org.truffleruby.language.loader.FeatureLoader$$Lambda$828.accept(Ljava/lang/Object;)V+8
j  org.truffleruby.cext.Linker.loadLibrary(Ljava/io/File;Ljava/util/function/Consumer;Ljava/util/function/Consumer;)V+327
j  org.truffleruby.language.loader.FeatureLoader.loadCExtLibrary(Ljava/lang/String;)V+76
j  org.truffleruby.language.loader.RequireNode.requireCExtension(Ljava/lang/String;Ljava/lang/String;)V+52
j  org.truffleruby.language.loader.RequireNode.require(Ljava/lang/String;Lcom/oracle/truffle/api/profiles/BranchProfile;Lcom/oracle/truffle/api/profiles/BranchProfile;Lcom/oracle/truffle/api/profiles/ConditionProfile;Lorg/truffleruby/core/string/StringNodes$MakeStringNode;)Z+284
[...]
open("/opt/graalvm-0.31/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/rugged-0.26.0/ext/rugged/rugged_tag.c", O_RDONLY) = 56
fstat(56, {st_mode=S_IFREG|0644, st_size=6147, ...}) = 0
read(56, "/*\n * Copyright (C) the Rugged c"..., 6147) = 6147
read(56, "", 1)                         = 0
close(56)                               = 0
stat("/opt/graalvm-0.31/jre/languages/ruby/lib/cext/ruby/ruby.h", {st_mode=S_IFREG|0664, st_size=61304, ...}) = 0
access("/opt/graalvm-0.31/jre/languages/ruby/lib/cext/ruby/ruby.h", R_OK) = 0
open("/opt/graalvm-0.31/jre/languages/ruby/lib/cext/ruby/ruby.h", O_RDONLY) = 56
fstat(56, {st_mode=S_IFREG|0664, st_size=61304, ...}) = 0
read(56, "/*******************************"..., 61304) = 61304
read(56, "", 1)                         = 0
close(56)                               = 0
stat("/opt/graalvm-0.31/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/rugged-0.26.0/ext/rugged/rugged.h", {st_mode=S_IFREG|0644, st_size=5554, ...}) = 0
access("/opt/graalvm-0.31/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/rugged-0.26.0/ext/rugged/rugged.h", R_OK) = 0
open("/opt/graalvm-0.31/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/rugged-0.26.0/ext/rugged/rugged.h", O_RDONLY) = 56
fstat(56, {st_mode=S_IFREG|0644, st_size=5554, ...}) = 0
read(56, "/*\n * Copyright (C) the Rugged c"..., 5554) = 5554
read(56, "", 1)                         = 0
close(56)                               = 0
stat("/opt/graalvm-0.31/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/rugged-0.26.0/vendor/libgit2/include/git2/types.h", {st_mode=S_IFREG|0644, st_size=14245, ...}) = 0
access("/opt/graalvm-0.31/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/rugged-0.26.0/vendor/libgit2/include/git2/types.h", R_OK) = 0
open("/opt/graalvm-0.31/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/rugged-0.26.0/vendor/libgit2/include/git2/types.h", O_RDONLY) = 56
fstat(56, {st_mode=S_IFREG|0644, st_size=14245, ...}) = 0
read(56, "/*\n * Copyright (C) the libgit2 "..., 14245) = 14245
read(56, "", 1)                         = 0
close(56)                               = 0
stat("/opt/graalvm-0.31/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/rugged-0.26.0/vendor/libgit2/include/git2/oid.h", {st_mode=S_IFREG|0644, st_size=8277, ...}) = 0
access("/opt/graalvm-0.31/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/rugged-0.26.0/vendor/libgit2/include/git2/oid.h", R_OK) = 0
open("/opt/graalvm-0.31/jre/languages/ruby/lib/ruby/gems/2.3.0/gems/rugged-0.26.0/vendor/libgit2/include/git2/oid.h", O_RDONLY) = 56
fstat(56, {st_mode=S_IFREG|0644, st_size=8277, ...}) = 0
read(56, "/*\n * Copyright (C) the libgit2 "..., 8277) = 8277
read(56, "", 1)                         = 0
close(56)                               = 0
stat("/usr/include/x86_64-linux-gnu/sys/types.h", {st_mode=S_IFREG|0644, st_size=6705, ...}) = 0
access("/usr/include/x86_64-linux-gnu/sys/types.h", R_OK) = 0
open("/usr/include/x86_64-linux-gnu/sys/types.h", O_RDONLY) = 56
fstat(56, {st_mode=S_IFREG|0644, st_size=6705, ...}) = 0
read(56, "/* Copyright (C) 1991-2014 Free "..., 6705) = 6705
read(56, "", 1)                         = 0
close(56)                               = 0
lseek(26, 1574643, SEEK_SET)            = 1574643
read(26, "PK\3\4\24\0\0\0\0\0\253LFL)DA\241\22\30\0\0\22\30\0\0V\0\0\0", 30) = 30
lseek(26, 1574759, SEEK_SET)            = 1574759
read(26, "\312\376\272\276\0\0\0004\0\270\n\0!\0l\t\0\37\0m\t\0\37\0n\t\0\26\0o\n\0"..., 1024) = 1024
lseek(26, 1575783, SEEK_SET)            = 1575783
read(26, "/global/LLVMGlobal;\1\0\5state\1\0\rSt"..., 2048) = 2048
lseek(26, 1577831, SEEK_SET)            = 1577831
read(26, "com/oracle/truffle/api/frame/Mat"..., 3090) = 3090
futex(0x7fc2c4081354, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7fc2c4081350, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
futex(0x7fc2c400b254, FUTEX_WAIT_PRIVATE, 8079, NULL) = 0
futex(0x7fc2c400b228, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0x7fc2c40c5154, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0x7fc2c40c5150, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
lseek(26, 1502925, SEEK_SET)            = 1502925
read(26, "PK\3\4\24\0\0\0\0\0\253LFL\372\367\21wL\6\0\0L\6\0\0m\0\0\0", 30) = 30
lseek(26, 1503064, SEEK_SET)            = 1503064
read(26, "\312\376\272\276\0\0\0004\0001\n\0\4\0#\t\0\3\0$\7\0%\7\0&\1\0\5nex"..., 1024) = 1024
lseek(26, 1504088, SEEK_SET)            = 1504088
read(26, "GlobalFactory$GetNativePointerNo"..., 588) = 588
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions