Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save return/3a020deb3f512101466a5f712946b4ff to your computer and use it in GitHub Desktop.
Save return/3a020deb3f512101466a5f712946b4ff to your computer and use it in GitHub Desktop.
swift-3.1 runtime crash in Haiku (pthread_mutex_lock)
Debug information for team /boot/home/Desktop/swift_31_build/build/Ninja+cmark-ReleaseAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-DebugAssert/swift-haiku-x86_64/bin/swift (6749):
CPU(s): 8x Intel Core™ i7-4790
Memory: 13.61 GiB total, 873.69 MiB used
Haiku revision: hrev51127 Apr 25 2017 13:02:39 (x86_64)
Active Threads:
thread 6751: team 6749 debug task
thread 6749: swift (main)
state: Exception (Segment violation)
Frame IP Function Name
-----------------------------------------------
0x7fb269751570 0x1c1ba659dee mutex_lock(_pthread_mutex*, long) + 0x1e
Disassembly:
mutex_lock(_pthread_mutex*, long):
0x000001c1ba659dd0: 55 push %rbp
0x000001c1ba659dd1: 4889e5 mov %rsp, %rbp
0x000001c1ba659dd4: 4157 push %r15
0x000001c1ba659dd6: 4156 push %r14
0x000001c1ba659dd8: 4155 push %r13
0x000001c1ba659dda: 4154 push %r12
0x000001c1ba659ddc: 4989fd mov %rdi, %r13
0x000001c1ba659ddf: 53 push %rbx
0x000001c1ba659de0: 31ff xor %edi, %edi
0x000001c1ba659de2: 4989f4 mov %rsi, %r12
0x000001c1ba659de5: 4883ec08 sub $0x8, %rsp
0x000001c1ba659de9: e8f276feff call 0x1c1ba6414e0
0x000001c1ba659dee: 413b450c cmp 0xc(%r13), %eax <--
Frame memory:
[0x7fb269751530] P.ui....(.ui.... 50 15 75 69 b2 7f 00 00 28 19 75 69 b2 7f 00 00
[0x7fb269751540] .ui............ 20 19 75 69 b2 7f 00 00 c0 13 9c da fc 01 00 00
[0x7fb269751550] ..O............. b0 03 4f da fc 01 00 00 02 00 00 00 00 00 00 00
[0x7fb269751560] ..ui......V..... 80 15 75 69 b2 7f 00 00 b5 da 56 cc fa 00 00 00
0x7fb269751590 0xfacc56dab0 swift::MutexPlatformHelper::lock(swift::MutexHandle&) + 0x10 (/boot/home/Desktop/swift_31_build/swift/stdlib/public/runtime/MutexPThread.cpp:100)
Variables:
mutex: 0 {
flags: Invalid Argument
lock: Bad address
unused: Bad address
owner: Bad address
owner_count: Bad address
}
errorcode: 32690
0x7fb2697515b0 0xfacc5621f0 swift::Mutex::lock(void) + 0x10 (/boot/home/Desktop/swift_31_build/swift/include/swift/Runtime/Mutex.h:94)
Variables:
this: 0 {
Handle
}
0x7fb2697515e0 0xfacc55392f swift::Mutex::withLock<(lambda at /boot/home/Desktop/swift_31_build/swift/include/swift/Runtime/Mutex.h:220:14)>(void) + 0x1f (/boot/home/Desktop/swift_31_build/swift/include/swift/Runtime/Mutex.h:141)
Variables:
this: 0 {
Handle
}
criticalSection {
criticalSection: 0x7fb269751600
condition: 0x18
}
0x7fb269751620 0xfacc552cf4 swift::Mutex::withLockThenNotifyAll<(lambda at /boot/home/Desktop/swift_31_build/swift/stdlib/public/runtime/MetadataCache.h:346:29)>(swift::ConditionVariable&, ) + 0x34 (/boot/home/Desktop/swift_31_build/swift/include/swift/Runtime/Mutex.h:219)
Variables:
this: 0 {
Handle
}
condition: 0x18 {
Handle
}
criticalSection {
entry: 0x7fb269751698
value: 0x7fb269751668
}
0x7fb269751730 0xfacc54d7e9 swift::MetadataCache<(anonymous namespace)::GenericCacheEntry>::findOrAdd(const void* const *, size_t, llvm::function_ref<(anonymous namespace)::GenericCacheEntry *()>) + 0x1f9 (/boot/home/Desktop/swift_31_build/swift/stdlib/public/runtime/MetadataCache.h:344)
Variables:
this: 0xfacc89ed78 {
}
arguments: 0x7fb2697517a8 {
*arguments: 0x1fcda207728
}
numArguments: 1
builder {
callback: 0xfacc553a00
callable: 140404250187592
}
key {
Hash: 8576801911595402176
}
insertResult {
first: 0x1fcda207b20
second: true
}
entry: 0x1fcda207b20 {
Hash: 8576801911595402176
KeyLength: 1
}
value: 0x1fcda2178d8 {
}
concurrency: 0 {
}
0x7fb269751790 0xfacc54d5a8 swift_getGenericMetadata + 0x78
0x7fb2697517b0 0xfacc4211cd _TMaCs23_ContiguousArrayStorage + 0x1d
0x7fb269751810 0xfacc1091e6 _TFs27_allocateUninitializedArrayurFBwTGSax_Bp_ + 0x26
0x7fb269751850 0x89ac02e ?
0x7fb269751900 0x1dc40223641 llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) + 0x3f1
0x7fb269751a90 0x1dc4022719e llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, char const* const*) + 0x47e
0x7fb269752180 0x1dc3f4d87b4 swift::RunImmediately(swift::CompilerInstance&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, swift::IRGenOptions&, swift::SILOptions const&) + 0x8f4
0x7fb269752fc0 0x1dc3f4bb41a performCompile(std::unique_ptr<swift::CompilerInstance, std::default_delete<swift::CompilerInstance> >&, swift::CompilerInvocation&, llvm::ArrayRef<const char *>, int&, swift::FrontendObserver*) + 0x242a (/boot/home/Desktop/swift_31_build/swift/lib/FrontendTool/FrontendTool.cpp:722)
Variables:
Instance: 0x7fb269753938 {
_M_t
}
Invocation: 0x7fb269753448 {
CodeCompletionBuffer: 0
CodeCompletionOffset: 4294967295
CodeCompletionFactory: 0
}
Args {
Data: 0x7fb2697547b0
Length: 6
}
ReturnValue: 0x7fb26975311c {
*ReturnValue: 0
}
observer: 0 {
_vptr$FrontendObserver: Invalid Argument
}
opts {
InputKind: IFK_Swift
ImplicitObjCHeaderPath
ModuleName
ModuleOutputPath
ModuleDocOutputPath
ModuleLinkName
ObjCHeaderOutputPath
SerializedDiagnosticsPath
DependenciesFilePath
ReferenceDependenciesFilePath
FixitsOutputPath
DumpAPIPath
GroupInfoPath
WarnLongFunctionBodies: 0
RequestedAction: Immediate
ParseStdlib: false
AlwaysSerializeDebuggingOptions: false
DebugTimeFunctionBodies: false
DebugTimeExpressionTypeChecking: false
DebugTimeCompilation: false
DelayedFunctionBodyParsing: false
EnableSerializationNestedTypeLookupTable: true
EnableSourceImport: false
EnableTesting: false
EnableResilience: false
EmitVerboseSIL: false
ImportUnderlyingModule: false
SerializeBridgingHeader: false
SILSerializeAll: false
PrintStats: false
PrintClangStats: false
PlaygroundTransform: false
PCMacro: false
PlaygroundHighPerformance: false
PrintHelp: false
PrintHelpHidden: false
EmitSortedSIL: false
CrashMode: None
}
Action: Immediate
IRGenOpts: 0x7fb2697537b0 {
MainInputFilename
ModuleName
DebugCompilationDir
DWARFVersion: 4
DWARFDebugFlags
ForceLoadSymbolName
OutputKind: Module
Verify: 0
Optimize: 0
Sanitize: None
DebugInfoKind: None
UseJIT: 0
DisableLLVMOptzns: 0
DisableLLVMARCOpts: 0
DisableLLVMSLPVectorizer: 0
DisableFPElim: 0
Playground: 0
EmitStackPromotionChecks: 0
StackPromotionSizeLimit: 1024
GenerateProfile: 0
PrintInlineTree: 1
EmbedMode: EmbedBitcode
HasValueNamesSetting: 0
ValueNames: 0
EnableReflectionMetadata: 0
EnableReflectionNames: 0
UseIncrementalLLVMCodeGen: 0
UseSwiftCall: 0
}
inputIsLLVMIr: false
nameTracker {
}
shouldTrackReferences: false
CrashMode: None
Context: 0x1fcda21aa30 {
Impl: 0x1fcda2131d0
LangOpts: 0x1fcda213dd0
SearchPathOpts: 0x1fcda214070
SourceMgr: 0x1fcda214280
Diags: 0x1fcda214338
TheBuiltinModule: 0x1fcda2004d0
TheStdlibModule: 0x1fcda201230
LastCheckedExternalDefinition: 0
CurrentGeneration: 4
TheErrorType
TheUnresolvedType
TheEmptyTupleType
TheAnyType
TheNativeObjectType
TheBridgeObjectType
TheUnknownObjectType
TheRawPointerType
TheUnsafeValueBufferType
TheIEEE32Type
TheIEEE64Type
TheIEEE16Type
TheIEEE80Type
TheIEEE128Type
ThePPC128Type
}
PrimarySourceFile: 0 {
}
moduleIsPublic: false
SM {
_M_t
}
LLVMContext: 0x1dc3fe5a639 {
pImpl: 0x5590c35d20c48348
}
IRModule {
_M_t
}
HashGlobal: 0 {
}
HadError: false
TargetMachine {
_M_t
}
EffectiveLanguageVersion {
}
Diags: 0x7fb269752510 {
SourceMgr: 0x7fb269752550
TransactionCount: 0
}
DiagOpts: 0x7fb269752548 {
UseColor: false
VerifyMode: NoVerify
SkipDiagnosticPasses: true
ShowDiagnosticsAfterFatalError: false
FixitCodeForAllDiagnostics: false
SuppressWarnings: false
WarningsAsErrors: false
}
CmdLine: 0x7fb2697525c0 {
}
0x7fb269753a00 0x1dc3f4b8c0e swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 0xcbe
0x7fb269755400 0x1dc3f43470d main(int, const char**) + 0xdbd (/boot/home/Desktop/swift_31_build/swift/tools/driver/driver.cpp:159)
Variables:
argc_: 8
argv_: 0x7fb269756648 {
*argv_: /boot/home/Desktop/swift_31_build/build/Ninja+cmark-ReleaseAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-DebugAssert/swift-haiku-x86_64/bin/swift
}
_INITIALIZE_LLVM_STACKTRACE
_INITIALIZE_LLVM_SHUTDOWN_OBJ
argv {
}
ArgAllocator {
Allocator
}
EC {
_M_value: 0
_M_cat: 0xa58748c48
}
ExecName {
npos: Invalid Argument
Data: swift
Length: 5
}
SubcommandName {
}
Path
PDC
SM {
CodeCompletionBufferID: 0
CodeCompletionOffset: 0
HashbangBufferID: 0
}
Diags {
SourceMgr: 0x7fb269753d40
TransactionCount: 0
}
TheDriver {
Diags: 0x14
Name
DriverExecutable
driverKind: 1769291386
DefaultTargetTriple
DriverPrintBindings: true
SuppressNoInputFilesError: true
CheckInputFilesExist: true
}
C {
_M_t
}
FirstArg {
npos: Invalid Argument
Data: -frontend
Length: 9
}
0x7fb269755420 0x1dc3f42d19c _start + 0x4c
0x7fb269755450 0x122ff5a1b8f runtime_loader + 0xef
00000000 0x7ffbc5644260 commpage_thread_exit + 0
Registers:
rip: 0x000001c1ba659dee
rsp: 0x00007fb269751530
rbp: 0x00007fb269751560
rax: 0x0000000000001a5d
rbx: 0x00007fb269751928
rcx: 0x00007fb269751668
rdx: 0x0000000000000000
rsi: 0x7fffffffffffffff
rdi: 0x0000000000000000
r8: 0x0000000000000001
r9: 0x0000000000000001
r10: 0x0000000000000003
r11: 0x0000000000000001
r12: 0x7fffffffffffffff
r13: 0x0000000000000000
r14: 0x000001fcda4f03b0
r15: 0x0000000000000002
cs: 0x0023
ds: 0x0000
es: 0x0000
fs: 0x0000
gs: 0x0000
ss: 0x001b
st0: 0
st1: 0
st2: 0
st3: 0
st4: 0
st5: 5
st6: 5
st7: 11
mm0: {0, 0, 0, 0}
mm1: {0, 0, 0, 0}
mm2: {0, 0, 0, 0}
mm3: {0, 0, 0, 0}
mm4: {0, 0, 0, 0}
mm5: {0, 0, 0, 0xa000}
mm6: {0, 0, 0, 0xa000}
mm7: {0, 0, 0, 0xb000}
xmm0: {0, 0, 0, 0, 0, 0, 0, 0}
xmm1: {0, 0, 0, 0, 0, 0, 0, 0}
xmm2: {0, 0, 0, 0, 0, 0, 0, 0}
xmm3: {0, 0, 0, 0, 0, 0, 0, 0}
xmm4: {0, 0, 0, 0, 0, 0, 0, 0}
xmm5: {0, 0, 0, 0, 0, 0, 0, 0}
xmm6: {0, 0, 0, 0, 0, 0, 0, 0}
xmm7: {0, 0, 0, 0, 0, 0, 0, 0}
xmm8: {0, 0, 0, 0, 0, 0, 0, 0}
xmm9: {0, 0, 0, 0, 0, 0, 0, 0}
xmm10: {0, 0, 0, 0, 0, 0, 0, 0}
xmm11: {0, 0, 0, 0, 0, 0, 0, 0}
xmm12: {0, 0, 0, 0, 0, 0, 0, 0}
xmm13: {0, 0, 0, 0, 0, 0, 0, 0}
xmm14: {0, 0, 0, 0, 0, 0, 0, 0}
xmm15: {0, 0, 0, 0, 0, 0, 0, 0}
Loaded Images:
ID Text Base Text End Data Base Data End Type Name
--------------------------------------------------------------------------------
168984 0xa583db000 0xa5853d000 0xa5873d000 0xa58751000 lib /boot/system/lib/libstdc++.so.6.0.21
168985 0x7f91d4b000 0x7f91d60000 0x7f91f5f000 0x7f91f60000 lib /boot/system/lib/libgcc_s.so.1
168981 0x9a48efb000 0x9a48efe000 0x9a490fd000 0x9a490fe000 lib /boot/system/lib/libuuid.so.1.0.0
168983 0xe16bcb0000 0xe16bccc000 0xe16becb000 0xe16becc000 lib /boot/system/lib/libz.so.1.2.11
168986 0xfacbfde000 0xfacc66e000 0xfacc86d000 0xfacc8c3000 lib /boot/home/Desktop/swift_31_build/build/Ninja+cmark-ReleaseAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-DebugAssert/swift-haiku-x86_64/lib/swift/haiku/libswiftCore.so
168987 0x10507870000 0x105079f9000 0x10507bf9000 0x10507c0c000 lib /boot/system/lib/libicuuc.so.56.1
168980 0x106da5c6000 0x106da5cb000 0x106da7ca000 0x106da7cb000 lib /boot/system/lib/libbsd.so
168977 0x122ff58e000 0x122ff5ad000 0x122ff7ac000 0x122ff7ae000 lib /boot/system/runtime_loader
168988 0x18fb657a000 0x18fb67f7000 0x18fb69f7000 0x18fb6a0d000 lib /boot/system/lib/libicui18n.so.56.1
168989 0x1b358e14000 0x1b35a5fa000 0x1b35a7f9000 0x1b35a7fa000 lib /boot/system/lib/libicudata.so.56.1
168990 0x1be43d00000 0x1be43d02000 0x1be43f01000 0x1be43f02000 lib /boot/home/Desktop/swift_31_build/build/Ninja+cmark-ReleaseAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-DebugAssert/swift-haiku-x86_64/lib/swift/haiku/libswiftSwiftOnoneSupport.so
168979 0x1c1ba60a000 0x1c1ba76b000 0x1c1ba96b000 0x1c1ba9bc000 lib /boot/system/lib/libroot.so
168982 0x1cc30332000 0x1cc30388000 0x1cc30587000 0x1cc3058c000 lib /boot/system/lib/libncurses.so.6.0.0
168978 0x1dc3eb87000 0x1dc440bb000 0x1dc442ba000 0x1dc4453e000 app /boot/home/Desktop/swift_31_build/build/Ninja+cmark-ReleaseAssert+llvm-ReleaseAssert+swift-DebugAssert+stdlib-DebugAssert/swift-haiku-x86_64/bin/swift
168976 0x7ffbc5644000 0x7ffbc564c000 0x00000000 0x00000000 system commpage
Areas:
ID Base End Size (KiB) Protection Locking Name
--------------------------------------------------------------------------------
667565 0x01852000 0x01853000 4 rw- full mmap area
667564 0x089ac000 0x089ad000 4 rw- full mmap area
667563 0x0e529000 0x0e52a000 4 rw- full mmap area
667548 0x13786000 0x137a6000 128 r-- full mmap area
667547 0x31ed9000 0x31eea000 68 r-- full mmap area
667546 0x32f0e000 0x33338000 4264 r-- full mmap area
667545 0xeb2b1000 0xebf48000 12892 r-- full mmap area
667543 0x10ace1000 0x10ad49000 416 rw- full rld heap
667542 0x41070c000 0x410774000 416 rw- full rld heap
667541 0x560528000 0x560538000 64 rw- full rld heap
667536 0xa583db000 0xa5853d000 1416 r-x full libstdc++.so.6.0.21_seg0ro
667537 0xa5873d000 0xa58749000 48 rw- full libstdc++.so.6.0.21_seg1rw
667538 0xa58749000 0xa58751000 32 rw- full libstdc++.so.6.0.21_seg2rw
667521 0xcfe3c3000 0xcfe3c4000 4 rw-S full _rld_debug_
667520 0x14c66be000 0x14c66ce000 64 rw- full rld heap
667539 0x7f91d4b000 0x7f91d60000 84 r-x full libgcc_s.so.1_seg0ro
667540 0x7f91f5f000 0x7f91f60000 4 rw- full libgcc_s.so.1_seg1rw
667530 0x9a48efb000 0x9a48efe000 12 r-x full libuuid.so.1.0.0_seg0ro
667531 0x9a490fd000 0x9a490fe000 4 rw- full libuuid.so.1.0.0_seg1rw
667534 0xe16bcb0000 0xe16bccc000 112 r-x full libz.so.1.2.11_seg0ro
667535 0xe16becb000 0xe16becc000 4 rw- full libz.so.1.2.11_seg1rw
667551 0xfacbfde000 0xfacc66e000 6720 r-x full libswiftCore.so_seg0ro
667552 0xfacc86d000 0xfacc8c1000 336 rw- full libswiftCore.so_seg1rw
667553 0xfacc8c1000 0xfacc8c3000 8 rw- full libswiftCore.so_seg2rw
667554 0x10507870000 0x105079f9000 1572 r-x full libicuuc.so.56.1_seg0ro
667555 0x10507bf9000 0x10507c0c000 76 rw- full libicuuc.so.56.1_seg1rw
667528 0x106da5c6000 0x106da5cb000 20 r-x full libbsd.so_seg0ro
667529 0x106da7ca000 0x106da7cb000 4 rw- full libbsd.so_seg1rw
667518 0x122ff58e000 0x122ff5ad000 124 r-x full runtime_loader_seg0ro
667519 0x122ff7ac000 0x122ff7ae000 8 rw- full runtime_loader_seg1rw
667556 0x18fb657a000 0x18fb67f7000 2548 r-x full libicui18n.so.56.1_seg0ro
667557 0x18fb69f7000 0x18fb6a0c000 84 rw- full libicui18n.so.56.1_seg1rw
667558 0x18fb6a0c000 0x18fb6a0d000 4 rw- full libicui18n.so.56.1_seg2rw
667559 0x1b358e14000 0x1b35a5fa000 24472 r-x full libicudata.so.56.1_seg0ro
667560 0x1b35a7f9000 0x1b35a7fa000 4 rw- full libicudata.so.56.1_seg1rw
667561 0x1be43d00000 0x1be43d02000 8 r-x full libswiftSwiftOnoneSupport.so_se
667562 0x1be43f01000 0x1be43f02000 4 rw- full libswiftSwiftOnoneSupport.so_se
667525 0x1c1ba60a000 0x1c1ba76b000 1412 r-x full libroot.so_seg0ro
667526 0x1c1ba96b000 0x1c1ba979000 56 rw- full libroot.so_seg1rw
667527 0x1c1ba979000 0x1c1ba9bc000 268 rw- full libroot.so_seg2rw
667532 0x1cc30332000 0x1cc30388000 344 r-x full libncurses.so.6.0.0_seg0ro
667533 0x1cc30587000 0x1cc3058c000 20 rw- full libncurses.so.6.0.0_seg1rw
667522 0x1dc3eb87000 0x1dc440bb000 87248 r-x full swift_seg0ro
667523 0x1dc442ba000 0x1dc44516000 2416 rw- full swift_seg1rw
667524 0x1dc44516000 0x1dc4453e000 160 rw- full swift_seg2rw
667544 0x1fcda190000 0x1fcdaa00000 8640 rw- full heap
667516 0x7fb268752000 0x7fb269758000 16408 rw-s full swift_6749_stack
667515 0x7fd69ff39000 0x7fd69ff3d000 16 rw- full user area
667517 0x7ffbc5644000 0x7ffbc564c000 32 r-xSk full commpage
Protection Flags: r - read, w - write, x - execute, s - stack, o - overcommit, c - cloneable, S - shared, k - kernel
Semaphores:
ID Count Last Holder Name
------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment