How to resolve Apple Mach-O Linker Error? - iphone

Here is a log
CompileC /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.o Classes/iPadNewsbookViewController.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/RAGOpoR/Desktop/trunk/src
setenv LANG en_US.US-ASCII
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch armv7 -fmessage-length=0 -std=c99 -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wmissing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -DDEBUG_MODE=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-conversion -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=4.0 -iquote "/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-generated-files.hmap" "-I/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-own-target-headers.hmap" "-I/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-all-target-headers.hmap" -iquote "/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-project-headers.hmap" -iquote../src -I/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Products/Debug-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/libxml2 -I/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/DerivedSources/armv7 -I/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/DerivedSources -F/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Products/Debug-iphoneos -F/Users/RAGOpoR/Desktop/trunk/src -include /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/PrecompiledHeaders/iPortals_Prefix-gellvzrskltxesfcgpqcdmiyeqru/iPortals_Prefix.pch -MMD -MT dependencies -MF /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.d --serialize-diagnostics /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.dia -c /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.m -o /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.o
In file included from /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.m:9:
In file included from /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.h:10:
In file included from /Users/RAGOpoR/Desktop/trunk/src/Classes/WebViewerController.h:10:
In file included from /Users/RAGOpoR/Desktop/trunk/src/Classes/AppDelegate_iPhone.h:12:
/Users/RAGOpoR/Desktop/trunk/src/ShareKit/Reachability/Reachability.h:69:58: warning: declaration of 'struct sockaddr_in' will not be visible outside of this function
+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;
^
0 clang 0x000000010cadf6a2 PrintStackTrace(void*) + 34
1 clang 0x000000010cadfb29 SignalHandler(int) + 553
2 libsystem_c.dylib 0x00007fff83d827ea _sigtramp + 26
3 libsystem_c.dylib 0x00007fff6b7b6300 _sigtramp + 18446744073300818736
4 clang 0x000000010c428828 findRetainCycleOwner(clang::Expr*, (anonymous namespace)::RetainCycleOwner&) + 312
5 clang 0x000000010c428b02 clang::Sema::checkRetainCycles(clang::Expr*, clang::Expr*) + 50
6 clang 0x000000010c44d33a clang::Sema::checkPseudoObjectAssignment(clang::Scope*, clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) + 1242
7 clang 0x000000010bc85e86 clang::Sema::ActOnBinOp(clang::Scope*, clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 1606
8 clang 0x000000010bc8507a clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*, true>, clang::prec::Level) + 570
9 clang 0x000000010bc7e4cb clang::Parser::ParseAssignmentExpression() + 171
10 clang 0x000000010bc7e401 clang::Parser::ParseExpression() + 17
11 clang 0x000000010bcd3bde clang::Parser::ParseExprStatement(clang::ParsedAttributes&) + 46
12 clang 0x000000010bc7de9c clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*, 32u>&, bool) + 1564
13 clang 0x000000010bc7d1b9 clang::Parser::ParseCompoundStatementBody(bool) + 409
14 clang 0x000000010c3fb1f0 clang::Parser::ParseLexedObjCMethodDefs(clang::Parser::LexedMethod&) + 272
15 clang 0x000000010bd1f6fe clang::Parser::ParseObjCAtEndDeclaration(clang::SourceRange) + 158
16 clang 0x000000010bcfd0d2 clang::Parser::ParseObjCAtDirectives() + 386
17 clang 0x000000010bc3e887 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 759
18 clang 0x000000010bc3e519 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 249
19 clang 0x000000010bc2128b clang::ParseAST(clang::Sema&, bool) + 299
20 clang 0x000000010bc1fd19 clang::CodeGenAction::ExecuteAction() + 857
21 clang 0x000000010bbf20af clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 879
22 clang 0x000000010bbf0d3b clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2683
23 clang 0x000000010bbe353e cc1_main(char const**, char const**, char const*, void*) + 5086
24 clang 0x000000010bbbdcd8 main + 648
25 clang 0x000000010bbbda44 start + 52
26 clang 0x0000000000000079 start + 18446744069217724009
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple thumbv7-apple-ios4.0.0 -S -disable-free -disable-llvm-verifier -main-file-name iPadNewsbookViewController.m -pic-level 1 -mdisable-fp-elim -relaxed-aliasing -target-abi apcs-gnu -target-cpu cortex-a8 -mfloat-abi soft -target-feature +soft-float-abi -target-linker-version 131.3 -g -coverage-file /var/folders/2s/0vbgmlf914d3x7m4xjqwdfh80000gp/T/iPadNewsbookViewController-qXtlG9.s -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.0 -dependency-file /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.d -MT dependencies -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -iquote /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-generated-files.hmap -iquote /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-project-headers.hmap -iquote ../src -include-pch /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/PrecompiledHeaders/iPortals_Prefix-gellvzrskltxesfcgpqcdmiyeqru/iPortals_Prefix.pch.pth -D DEBUG_MODE=1 -D IBOutlet=__attribute__((iboutlet)) -D IBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName))) -D IBAction=void)__attribute__((ibaction) -I /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-own-target-headers.hmap -I /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Hope Demo-all-target-headers.hmap -I /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Products/Debug-iphoneos/include -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/libxml2 -I /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/DerivedSources/armv7 -I /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/DerivedSources -F/Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Products/Debug-iphoneos -F/Users/RAGOpoR/Desktop/trunk/src -fmodule-cache-path /var/folders/2s/0vbgmlf914d3x7m4xjqwdfh80000gp/T/clang-module-cache -O0 -Wno-trigraphs -Wno-missing-field-initializers -Wmissing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -Wprotocol -Wdeprecated-declarations -Wno-conversion -Wno-sign-conversion -std=c99 -fno-dwarf2-cfi-asm -fno-dwarf-directory-asm -ferror-limit 19 -fmessage-length 0 -fvisibility hidden -fblocks -fobjc-default-synthesize-properties -fobjc-arc -fobjc-exceptions -fexceptions -fsjlj-exceptions -fpascal-strings -fdiagnostics-show-option -serialize-diagnostic-file /Users/RAGOpoR/Library/Developer/Xcode/DerivedData/iPortals-hfedckfrrkbpaeeekwhpwwkrxkgz/Build/Intermediates/iPortals.build/Debug-iphoneos/iPortals.build/Objects-normal/armv7/iPadNewsbookViewController.dia -o /var/folders/2s/0vbgmlf914d3x7m4xjqwdfh80000gp/T/iPadNewsbookViewController-qXtlG9.s -x objective-c /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.m
1. /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.m:77:60: current parser token ';'
2. /Users/RAGOpoR/Desktop/trunk/src/Classes/iPadNewsbookViewController.m:57:20: in compound statement ('{}')
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/2s/0vbgmlf914d3x7m4xjqwdfh80000gp/T/iPadNewsbookViewController-Q4pbhm.mi
clang: note: diagnostic msg: /var/folders/2s/0vbgmlf914d3x7m4xjqwdfh80000gp/T/iPadNewsbookViewController-Q4pbhm.sh
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254

If this happens consistently at roughly the same location in your code, then
you seem to have found an internal error in the compiler, i think best way to proceed is to first submit this as a bugreport to apple ( the URL is listed in the output you pasted ).
And then, if you would like to proceed, try to make changes to the code you are trying to compile, like comment out the first half, then retry, then comment out the second half, and retry. This should point to the code causing the internal compiler error.
Sometimes reordering some code will solve the problem for you. So at least you can continue developing.

Related

Swift compiler segfaults on generic Collection

I was trying to create a generic collection, PowerCollection, such that e.g. PowerCollection([0,1], 2) would contain [0, 0], [0, 1], [1, 0], and [1, 1], but I ran into trouble. Even with all method implementations stubbed out, the compiler is segfaulting and I don't know why.
Here is a minimal example that causes the segfault. Am I doing something wrong here?
I am using: Xcode 12.3 (17715) (Build 12C33) on macOS Version 10.15.7 (Build 19H2)
struct PowerCollection<C : Collection> : Collection {
typealias Index = [C.Index]
typealias Element = [C.Element]
var startIndex, endIndex: Index
subscript(position: Index) -> [C.Element] {
return []
}
func index(after i: Index) -> Index {
return i
}
}
extension Array : Comparable where Element : Comparable {
public static func < (lhs: [Element], rhs: [Element]) -> Bool {
return false
}
}
Trying to compile the above gave me a compiler segfault with the following stack dump
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/justinh/Desktop/CrashInvestigation/CrashInvestigation/main.swift -emit-module-path /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/Objects-normal/x86_64/main~partial.swiftmodule -emit-module-doc-path /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/Objects-normal/x86_64/main~partial.swiftdoc -emit-module-source-info-path /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/Objects-normal/x86_64/main~partial.swiftsourceinfo -serialize-diagnostics-path /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/Objects-normal/x86_64/main.dia -emit-dependencies-path /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/Objects-normal/x86_64/main.d -emit-reference-dependencies-path /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/Objects-normal/x86_64/main.swiftdeps -target x86_64-apple-macos11.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -I /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Products/Debug -F /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Products/Debug -enable-testing -g -module-cache-path /Users/justinh/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 5 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -working-directory -Xcc /Users/justinh/Desktop/CrashInvestigation -enable-anonymous-context-mangled-names -Xcc -I/Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/CrashInvestigation-generated-files.hmap -Xcc -I/Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/CrashInvestigation-own-target-headers.hmap -Xcc -I/Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/CrashInvestigation-all-target-headers.hmap -Xcc -iquote -Xcc /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/CrashInvestigation-project-headers.hmap -Xcc -I/Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Products/Debug/include -Xcc -I/Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/DerivedSources-normal/x86_64 -Xcc -I/Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/DerivedSources/x86_64 -Xcc -I/Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/DerivedSources -Xcc -DDEBUG=1 -target-sdk-version 11.1 -module-name CrashInvestigation -o /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Build/Intermediates.noindex/CrashInvestigation.build/Debug/CrashInvestigation.build/Objects-normal/x86_64/main.o -index-store-path /Users/justinh/Library/Developer/Xcode/DerivedData/CrashInvestigation-hgzhbvtdchhupjellxarahpklfll/Index/DataStore -index-system-modules
1. Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)
2. While evaluating request IRGenSourceFileRequest(IR Generation for file "/Users/justinh/Desktop/CrashInvestigation/CrashInvestigation/main.swift")
3. While emitting IR SIL function "#$s18CrashInvestigation15PowerCollectionVyxGSlAASl20_failEarlyRangeCheck_6boundsySny5IndexQzG_AItFTW".
for '_failEarlyRangeCheck(_:bounds:)' (in module 'Swift')
4. While mangling type for debugger type 'Range<Array<τ_0_0.Index>>'
0 swift 0x000000011288f615 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1 swift 0x000000011288e615 llvm::sys::RunSignalHandlers() + 85
2 swift 0x000000011288fbcf SignalHandler(int) + 111
3 libsystem_platform.dylib 0x00007fff6fddd5fd _sigtramp + 29
4 libsystem_platform.dylib 0x00007faafe8397c0 _sigtramp + 18446743711030559200
5 swift 0x000000010f69e03f swift::GenericSignatureImpl::getConformanceAccessPath(swift::Type, swift::ProtocolDecl*) + 31
6 swift 0x000000010f598069 swift::Mangle::ASTMangler::appendAnyProtocolConformance(swift::CanGenericSignature, swift::CanType, swift::ProtocolConformanceRef) + 217
7 swift 0x000000010f596386 swift::Mangle::ASTMangler::appendConcreteProtocolConformance(swift::ProtocolConformance const*) + 2070
8 swift 0x000000010f594aa3 swift::Mangle::ASTMangler::appendRetroactiveConformances(swift::SubstitutionMap, swift::ModuleDecl*) + 179
9 swift 0x000000010f58de5e swift::Mangle::ASTMangler::appendType(swift::Type, swift::ValueDecl const*) + 3454
10 swift 0x000000010f591af8 swift::Mangle::ASTMangler::mangleTypeForDebugger(swift::Type, swift::DeclContext const*) + 632
11 swift 0x000000010e7c9d21 (anonymous namespace)::IRGenDebugInfoImpl::getOrCreateType(swift::irgen::DebugTypeInfo) + 1505
12 swift 0x000000010e7cb8e5 (anonymous namespace)::IRGenDebugInfoImpl::createParameterTypes(swift::CanTypeWrapper<swift::SILFunctionType>) + 1461
13 swift 0x000000010e7c2af4 (anonymous namespace)::IRGenDebugInfoImpl::emitFunction(swift::SILDebugScope const*, llvm::Function*, swift::SILFunctionTypeRepresentation, swift::SILType, swift::DeclContext*) + 2868
14 swift 0x000000010e7e245f swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 2639
15 swift 0x000000010e67d3a7 swift::irgen::IRGenerator::emitLazyDefinitions() + 1207
16 swift 0x000000010e7b8d20 performIRGeneration(swift::IRGenOptions const&, swift::ModuleDecl*, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, swift::SourceFile*, llvm::GlobalVariable**, llvm::StringSet<llvm::MallocAllocator>*) + 1920
17 swift 0x000000010e7e1781 swift::SimpleRequest<swift::IRGenSourceFileRequest, swift::GeneratedModule (swift::IRGenDescriptor), (swift::RequestFlags)9>::evaluateRequest(swift::IRGenSourceFileRequest const&, swift::Evaluator&) + 97
18 swift 0x000000010e7bd04c llvm::Expected<swift::IRGenSourceFileRequest::OutputType> swift::Evaluator::getResultUncached<swift::IRGenSourceFileRequest>(swift::IRGenSourceFileRequest const&) + 940
19 swift 0x000000010e7b929d swift::performIRGeneration(swift::IRGenOptions const&, swift::SourceFile&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::StringRef, swift::PrimarySpecificPaths const&, llvm::StringRef, llvm::GlobalVariable**, llvm::StringSet<llvm::MallocAllocator>*) + 269
20 swift 0x000000010e4031ba performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation const&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, int&, swift::FrontendObserver*) + 3002
21 swift 0x000000010e3f2d97 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 20695
22 swift 0x000000010e373c27 main + 1255
23 libdyld.dylib 0x00007fff6fbe4cc9 start + 1
24 libdyld.dylib 0x000000000000004b start + 18446603338641421187
error: Segmentation fault: 11 (in target 'CrashInvestigation' from project 'CrashInvestigation')

URL(fileURLWithPath: isDirectory:) Segmentation fault under MacOSX 10.15 Catalina, swift 5.2.2

I have a small swift script
#!/usr/bin/swift
import Foundation
let url = URL(fileURLWithPath: ".", isDirectory: true)
print(url.absoluteString)
If I run it from command line I am getting a Segmentation fault
swift-test $ ./url-test.swift
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret ./url-test.swift -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -color-diagnostics -module-name main
1. Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51)
2. While running user code "./url-test.swift"
0 swift 0x0000000113fa74ea PrintStackTraceSignalHandler(void*) + 42
1 swift 0x0000000113fa6cc0 SignalHandler(int) + 352
2 libsystem_platform.dylib 0x00007fff724cf5fd _sigtramp + 29
3 libsystem_malloc.dylib 0x00007fff7248e0c6 szone_malloc_should_clear + 66
4 swift 0x000000010fd2a48a llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) + 458
5 swift 0x000000010fd314fb llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, char const* const*) + 2011
6 swift 0x000000010fd065ba performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 14362
7 swift 0x000000010fcfaf75 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 55813
8 swift 0x000000010fc70f53 main + 1283
9 libdyld.dylib 0x00007fff722d6cc9 start + 1
10 libdyld.dylib 0x000000000000000b start + 2379387715
Segmentation fault: 11
If I run it inside swift interpreter everything is fine
swift-test $ swift
Welcome to Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51).
Type :help for assistance.
1> import Foundation
2. let url = URL(fileURLWithPath: ".", isDirectory: true)
3. print(url.absoluteString)
file:///Users/user/projects/swift-test/
url: URL = {}
4>
Any thoughts how to fix segmentation fault?

Segmentation fault on a simple swift script

I have a very simple script written in swift and running this with swift file.swift
import Foundation
let url = URL(string: "www.google.com")
and this gives me a segfault error with this message
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -interpret file.swift -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -color-diagnostics -module-name file
1. Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)
2. While running user code "file.swift"
0 swift 0x00000001101354ea PrintStackTraceSignalHandler(void*) + 42
1 swift 0x0000000110134cc0 SignalHandler(int) + 352
2 libsystem_platform.dylib 0x00007fff6c0aa5fd _sigtramp + 29
3 libsystem_platform.dylib 0x00007ffee3e196a8 _sigtramp + 2010575048
4 swift 0x000000010beb89ba llvm::MCJIT::runFunction(llvm::Function*, llvm::ArrayRef<llvm::GenericValue>) + 458
5 swift 0x000000010bebfa2b llvm::ExecutionEngine::runFunctionAsMain(llvm::Function*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, char const* const*) + 2011
6 swift 0x000000010be94aea performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 14362
7 swift 0x000000010be894a5 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 55813
8 swift 0x000000010bdff4d3 main + 1283
9 libdyld.dylib 0x00007fff6beb1cc9 start + 1
zsh: segmentation fault swift file.swift
any ideas as to where the problem is? Thanks!
EDIT: I have tried putting the code to Xcode and it works as it should.
I had a script which was working and suddenly stopped. Exactly on the line where I have created an URL. It was working on Xcode but not from terminal.
Looks like, it is bug.
If you first compile by using swiftc then run it, it is working.
I have found the answer in the following page:
https://blog.kulman.sk/workaround-for-swift-scripts-crash/

SourceKitService Terminated error results in compiler error

I am using Ray Wenderlich's Storyboard tutorial part 1 to learn how to use storyboards, and I'm doing it in Swift. So I'm transferring the following code, which is located in the AppDelegate.swift file, from
UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
UINavigationController *navigationController = [tabBarController viewControllers][0];
PlayersViewController *playersViewController = [navigationController viewControllers][0];
playersViewController.players = _players;
to
let tabBarController : UITabBarController = self.window?.rootViewController as UITabBarController
let navBarController = tabBarController.viewControllers[0] as UINavigationController
let playersController = navBarController.viewControllers[0]
playersController.players = self.players
However, the latter section of code throws a compiler error because when I declare playersController I'm not downcasting the AnyObject that is returned by navBarController.viewControllers[0] to my custom PlayersTableViewController class. So I do that with the following code
let playersController = navBarController.viewControllers[0] as PlayersTableViewController
But this causes the SourceKitService Xcode 6 bug to be appear, and I lose all syntax highlighting.
So I'm left with either continuing with no syntax highlighting, or not continue at all because playersController needs to be recognized as a PlayersTableViewController in order to access the players property. I've narrowed it down to that downcast operation that causes Xcode to bug out, does anyone have any solutions to this problem?
EDIT: I tried to go ahead without syntax coloring, write the necessary code, and then compile it, but it threw the following messy compiler error.
0 swift 0x0000000109fed688 llvm::sys::PrintStackTrace(__sFILE*) + 40
1 swift 0x0000000109fedb74 SignalHandler(int) + 452
2 libsystem_platform.dylib 0x00007fff8f55b5aa _sigtramp + 26
3 libsystem_platform.dylib 000000000000000000 _sigtramp + 1890208368
4 swift 0x00000001094b8dab (anonymous namespace)::RValueEmitter::emitForceValue(swift::SILLocation, swift::Expr*, unsigned int, swift::Lowering::SGFContext) + 1291
5 swift 0x00000001094ace5f swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 4111
6 swift 0x00000001094b436d swift::Lowering::SILGenFunction::emitRValueAsSingleValue(swift::Expr*, swift::Lowering::SGFContext) + 45
7 swift 0x00000001094cb903 swift::Lowering::SILGenFunction::emitRValueAsOrig(swift::Expr*, swift::Lowering::AbstractionPattern, swift::Lowering::TypeLowering const&, swift::Lowering::SGFContext) + 179
8 swift 0x000000010949f496 (anonymous namespace)::CheckedCastEmitter::emitOperand(swift::Expr*) + 150
9 swift 0x00000001094b6350 emitUnconditionalCheckedCast(swift::Lowering::SILGenFunction&, swift::SILLocation, swift::Expr*, swift::Type, swift::CheckedCastKind, swift::Lowering::SGFContext) + 288
10 swift 0x00000001094ae40d swift::ASTVisitor<(anonymous namespace)::RValueEmitter, swift::Lowering::RValue, void, void, void, void, void, swift::Lowering::SGFContext>::visit(swift::Expr*, swift::Lowering::SGFContext) + 9661
11 swift 0x000000010949caeb swift::Lowering::SILGenFunction::emitExprInto(swift::Expr*, swift::Lowering::Initialization*) + 219
12 swift 0x000000010949397e swift::Lowering::SILGenFunction::visitPatternBindingDecl(swift::PatternBindingDecl*) + 190
13 swift 0x00000001094cfd4c swift::Lowering::SILGenFunction::visitBraceStmt(swift::BraceStmt*) + 332
14 swift 0x00000001094d2c54 swift::ASTVisitor<swift::Lowering::SILGenFunction, void, void, void, void, void, void>::visit(swift::Stmt*) + 148
15 swift 0x00000001094a0f93 swift::Lowering::SILGenFunction::emitFunction(swift::FuncDecl*) + 243
16 swift 0x0000000109482096 swift::Lowering::SILGenModule::emitFunction(swift::FuncDecl*) + 230
17 swift 0x000000010949bd83 swift::ASTVisitor<SILGenType, void, void, void, void, void, void>::visit(swift::Decl*) + 355
18 swift 0x000000010949a70b SILGenType::emitType() + 203
19 swift 0x00000001094956de swift::Lowering::SILGenModule::visitNominalTypeDecl(swift::NominalTypeDecl*) + 30
20 swift 0x000000010948400b swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*, unsigned int) + 411
21 swift 0x000000010948428c swift::SILModule::constructSIL(swift::Module*, swift::SourceFile*, unsigned int) + 268
22 swift 0x0000000109484390 swift::performSILGeneration(swift::SourceFile&, unsigned int) + 32
23 swift 0x00000001093751a7 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 3255
24 swift 0x000000010937448d main + 1645
25 libdyld.dylib 0x00007fff9a2fd5fd start + 1
26 libdyld.dylib 0x0000000000000039 start + 1708141117
Stack dump:
0. Program arguments: /Applications/Xcode6-Beta4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c /Users/alex/Desktop/CodingFolder/iOS/Ratings/Ratings/Player.swift /Users/alex/Desktop/CodingFolder/iOS/Ratings/Ratings/ViewController.swift -primary-file /Users/alex/Desktop/CodingFolder/iOS/Ratings/Ratings/AppDelegate.swift /Users/alex/Desktop/CodingFolder/iOS/Ratings/Ratings/PlayersTableViewController.swift -enable-objc-attr-requires-objc-module -target i386-apple-ios7.1 -module-name Ratings -sdk /Applications/Xcode6-Beta4.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk -I /Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Products/Debug-iphonesimulator -F /Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Products/Debug-iphonesimulator -g -module-cache-path /Users/alex/Library/Developer/Xcode/DerivedData/ModuleCache -Xcc -I/Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/Ratings-generated-files.hmap -Xcc -I/Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/Ratings-own-target-headers.hmap -Xcc -I/Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/Ratings-all-target-headers.hmap -Xcc -iquote -Xcc /Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/Ratings-project-headers.hmap -Xcc -I/Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Products/Debug-iphonesimulator/include -Xcc -I/Applications/Xcode6-Beta4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/DerivedSources/i386 -Xcc -I/Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/DerivedSources -Xcc -DDEBUG=1 -emit-module-doc-path /Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/Objects-normal/i386/AppDelegate~partial.swiftdoc -O0 -emit-module-path /Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/Objects-normal/i386/AppDelegate~partial.swiftmodule -serialize-diagnostics-path /Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/Objects-normal/i386/AppDelegate.dia -emit-dependencies-path /Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/Objects-normal/i386/AppDelegate.d -o /Users/alex/Library/Developer/Xcode/DerivedData/Ratings-cylggjacqbkxbeeotoghnkluxwly/Build/Intermediates/Ratings.build/Debug-iphonesimulator/Ratings.build/Objects-normal/i386/AppDelegate.o
1. While emitting SIL for 'application' at /Users/alex/Desktop/CodingFolder/iOS/Ratings/Ratings/AppDelegate.swift:18:5
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
Command /Applications/Xcode6-Beta4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254

Crash on creating new persistence store (jailbroken iPhone device 4.1)

Whenever I deploy "CoreDataBooks" Apple iOS sample application to my jailbroken device with self signed certificate and run it - it crashes at line where core-data persistent store is added to persistent store coordinator:
line 178:
if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:options error:&error]) {
// Update to handle the error appropriately.
NSLog(#"Unresolved error %#, %#", error, [error userInfo]);
abort();
}
It is also interesting that application's "Document" directory was never created and sqlite was never copied into it, so I'm suspected that it might be connected to write permissions issue. However, I've tested app by setting 777 permissions recursively and it was the same.
Sample works fine with iPhone Simulator.
Environment summary:
Xcode 3.2.4 / iOS SDK 4.1
Device: iPhone4 (iPhone3,1)
Firmware: 4.1 (8B117)
Jailbroken with: PwnageTool 4.1.2
Self signed certificate for code signing was used as described at http://ihackmyi.com/forum/index.php/topic,24020.0.html
Complete code was downloaded from this location: http: //developer.apple.com/library/ios/#samplecode/CoreDataBooks/Introduction/Intro.html
For building purpose, sample configuration was slightly changed:
Base SDK: iOS Device 4.1
Code Signing/Any iPhone OS Device: "Xcode Code Sign"
iOS Deployment Target: iOS 4.1
I used SSH to deploy it to /Applications directory on the device and set permissions to 777 with:
iPhone:~ root# chmod -R 777 /Applications/CoreDataBooks.app
I used Respring to restart Springboard and after that I run CoreDataBooks app and it crashed with following crash log (I provided symbilized version):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AutoSubmitted</key>
<true/>
<key>SysInfoCrashReporterKey</key>
<string>a2191deea05fc5a80608f23ca9d8a375f4e0dc82</string>
<key>bug_type</key>
<string>109</string>
<key>description</key>
<string>Incident Identifier: CC4CFD7A-F2F3-4882-BC5E-54718D60BD90
CrashReporter Key: a2191deea05fc5a80608f23ca9d8a375f4e0dc82
Hardware Model: iPhone3,1
Process: CoreDataBooks [681]
Path: /Applications/CoreDataBooks.app/CoreDataBooks
Identifier: CoreDataBooks
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2010-10-27 14:57:34.024 +0200
OS Version: iPhone OS 4.1 (8B117)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0x00078ac8 __kill + 8
1 libSystem.B.dylib 0x00078ab8 kill + 4
2 libSystem.B.dylib 0x00078aaa raise + 10
3 libSystem.B.dylib 0x0008d03a abort + 50
4 CoreDataBooks 0x00006242 -[CoreDataBooksAppDelegate persistentStoreCoordinator] (CoreDataBooksAppDelegate.m:178)
5 CoreDataBooks 0x00005ef0 -[CoreDataBooksAppDelegate managedObjectContext] (CoreDataBooksAppDelegate.m:120)
6 CoreDataBooks 0x00005ce0 -[CoreDataBooksAppDelegate applicationDidFinishLaunching:] (CoreDataBooksAppDelegate.m:65)
7 UIKit 0x0000e4b6 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 826
8 UIKit 0x000049e0 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 200
9 UIKit 0x0005dfd6 -[UIApplication handleEvent:withNewEvent:] + 1390
10 UIKit 0x0005d8fa -[UIApplication sendEvent:] + 38
11 UIKit 0x0005d330 _UIApplicationHandleEvent + 5104
12 GraphicsServices 0x00005044 PurpleEventCallback + 660
13 CoreFoundation 0x00034cdc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
14 CoreFoundation 0x00034ca0 __CFRunLoopDoSource1 + 160
15 CoreFoundation 0x00027566 __CFRunLoopRun + 514
16 CoreFoundation 0x00027270 CFRunLoopRunSpecific + 224
17 CoreFoundation 0x00027178 CFRunLoopRunInMode + 52
18 UIKit 0x000040fc -[UIApplication _run] + 364
19 UIKit 0x00002128 UIApplicationMain + 664
20 CoreDataBooks 0x00002f90 main (main.m:52)
21 CoreDataBooks 0x00002f44 start + 32
Thread 1:
0 libSystem.B.dylib 0x0002d330 kevent + 24
1 libSystem.B.dylib 0x000d6b6c _dispatch_mgr_invoke + 88
2 libSystem.B.dylib 0x000d65bc _dispatch_queue_invoke + 96
3 libSystem.B.dylib 0x000d675c _dispatch_worker_thread2 + 120
4 libSystem.B.dylib 0x0007a67a _pthread_wqthread + 258
5 libSystem.B.dylib 0x00073190 start_wqthread + 0
Thread 2:
0 libSystem.B.dylib 0x0007b19c __workq_kernreturn + 8
1 libSystem.B.dylib 0x0007a790 _pthread_wqthread + 536
2 libSystem.B.dylib 0x00073190 start_wqthread + 0
Thread 3:
0 libSystem.B.dylib 0x00000c98 mach_msg_trap + 20
1 libSystem.B.dylib 0x00002d64 mach_msg + 44
2 CoreFoundation 0x00027c38 __CFRunLoopServiceMachPort + 88
3 CoreFoundation 0x000274c2 __CFRunLoopRun + 350
4 CoreFoundation 0x00027270 CFRunLoopRunSpecific + 224
5 CoreFoundation 0x00027178 CFRunLoopRunInMode + 52
6 WebCore 0x000024e2 RunWebThread(void*) + 362
7 libSystem.B.dylib 0x0007a27e _pthread_start + 242
8 libSystem.B.dylib 0x0006f2a8 thread_start + 0
Thread 0 crashed with ARM Thread State:
r0: 0x00000000 r1: 0x00000000 r2: 0x00000001 r3: 0x3e0862b4
r4: 0x00000006 r5: 0x00159270 r6: 0x31703801 r7: 0x2fffe584
r8: 0x3e3063c8 r9: 0x355aa336 r10: 0x33028027 r11: 0x33028008
ip: 0x00000025 sp: 0x2fffe584 lr: 0x30277abf pc: 0x30277ac8
cpsr: 0x00000010
Binary Images:
0x1000 - 0x7fff +CoreDataBooks armv7 <f2c845d1e546f60fd0f58b8390c87892> /Applications/CoreDataBooks.app/CoreDataBooks
0x11000 - 0x11fff +MobileSubstrate.dylib armv6 /Library/MobileSubstrate/MobileSubstrate.dylib
0x39000 - 0x3afff +MobileLoader.dylib armv6 /Library/MobileSubstrate/MobileLoader.dylib
0x3e000 - 0x3ffff dns.so armv7 <240b8d3f07b4fcb234de598f8e67de1a> /usr/lib/info/dns.so
0x382000 - 0x3a4fff +Activator.dylib arm <688435a67edc753ddf0a6a83ecd3c1e4> /Library/MobileSubstrate/DynamicLibraries/Activator.dylib
0x2fe00000 - 0x2fe26fff dyld armv7 <a11905c8ef7906bf4b8910fc551f9dbb> /usr/lib/dyld
0x3002b000 - 0x300ebfff libobjc.A.dylib armv7 <49029949741e10f21b178b0a4b2df979> /usr/lib/libobjc.A.dylib
0x301ff000 - 0x3030cfff libSystem.B.dylib armv7 <0792bef82e8cde31cb32d06e80262288> /usr/lib/libSystem.B.dylib
0x307a0000 - 0x307a1fff CoreSurface armv7 <586f25579330ac060decd2df4cc05bd8> /System/Library/PrivateFrameworks/CoreSurface.framework/CoreSurface
0x307ef000 - 0x307f7fff libkxld.dylib armv7 <e86dd3313cbef5a3a0fb8598f6b0ab18> /usr/lib/system/libkxld.dylib
0x307f8000 - 0x308cbfff CoreFoundation armv7 <adb562d8b5eaadbb874e255a09d0e04b> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
0x30996000 - 0x30a7efff libGLProgrammability.dylib armv7 <ef656cb58e56a36789ee17d4d925e9ba> /System/Library/Frameworks/OpenGLES.framework/libGLProgrammability.dylib
0x30a7f000 - 0x30a87fff libgcc_s.1.dylib armv7 <6fb15d72d3ee5444d901dc9ef974a3b3> /usr/lib/libgcc_s.1.dylib
0x30a88000 - 0x30ac2fff IOKit armv7 <6810c1b44dd12227780dc88c76b692e4> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x30ac9000 - 0x30ad0fff libbz2.1.0.dylib armv7 <0011bd5af0230fcaf63005f7eefa11dd> /usr/lib/libbz2.1.0.dylib
0x30ad5000 - 0x30ad7fff MobileInstallation armv7 <8b23f794f02c2f7572a8fe6532630161> /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation
0x30bb3000 - 0x30bbffff SpringBoardServices armv7 <b715ca60b9e99b3b2b4f8270c478c138> /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices
0x30bc8000 - 0x30c59fff ImageIO armv7 <3f421780e67f0219e416287d3e684b54> /System/Library/Frameworks/ImageIO.framework/ImageIO
0x30cfb000 - 0x30d2afff SystemConfiguration armv7 <b79a5a4f0506ce17bedeef7799e81687> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration
0x30f4b000 - 0x30f82fff Security armv7 <4770002d4b443c186dc1e3ddaa1787c8> /System/Library/Frameworks/Security.framework/Security
0x30f8b000 - 0x30fbbfff AppSupport armv7 <20908678e860c23207574337097b94f1> /System/Library/PrivateFrameworks/AppSupport.framework/AppSupport
0x313a6000 - 0x313a8fff IOMobileFramebuffer armv7 <ef3a36680985b4db12a778d62f37961f> /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebuffer
0x31499000 - 0x314a4fff libz.1.dylib armv7 <19a78978d5908bedc6496470fe542936> /usr/lib/libz.1.dylib
0x31509000 - 0x31537fff libCGFreetype.A.dylib armv7 <41663f59614034ba151e9b4f86e1e141> /System/Library/Frameworks/CoreGraphics.framework/Resources/libCGFreetype.A.dylib
0x31565000 - 0x31572fff OpenGLES armv7 <6bdd1b930c09cfec7c6c7629551c0cbd> /System/Library/Frameworks/OpenGLES.framework/OpenGLES
0x315ec000 - 0x31601fff libresolv.9.dylib armv7 <1ed920d5a995cd94e71c41631d7c551e> /usr/lib/libresolv.9.dylib
0x31619000 - 0x3171dfff CoreData armv7 <36b5f42fcdceea61bedb2838f8279714> /System/Library/Frameworks/CoreData.framework/CoreData
0x318c3000 - 0x3196afff WebKit armv7 <a8bfa45e5c19efcf95e184e658d61a18> /System/Library/PrivateFrameworks/WebKit.framework/WebKit
0x31adb000 - 0x31ae4fff CoreVideo armv7 <d47b741a05fdbed287a454e834aeede2> /System/Library/Frameworks/CoreVideo.framework/CoreVideo
0x31c20000 - 0x31c20fff vecLib armv7 <e1d93756e63104d2861a277e8a70df44> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib
0x31c88000 - 0x31c8efff liblockdown.dylib armv7 <e89050debe57ae71a3f0ed2bc9c46145> /usr/lib/liblockdown.dylib
0x31e40000 - 0x31e4cfff GraphicsServices armv7 <7075593b53fcd90c8d2aa40ba9ff4397> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices
0x31e4d000 - 0x3308dfff UIKit armv7 <3f1f8f7555dcf93cc4ce2146286bd3f6> /System/Library/Frameworks/UIKit.framework/UIKit
0x330af000 - 0x33601fff WebCore armv7 <4d60fdc638b6218c26d3c143af5e829c> /System/Library/PrivateFrameworks/WebCore.framework/WebCore
0x337dd000 - 0x337fcfff Bom armv7 <f49558f211241498f37af577051611b3> /System/Library/PrivateFrameworks/Bom.framework/Bom
0x33847000 - 0x33876fff CoreText armv7 <0855144a7f9eeade285f2e7c030f7478> /System/Library/Frameworks/CoreText.framework/CoreText
0x3390e000 - 0x33951fff CoreTelephony armv7 <deafb4c98c723215e43f07c3bf6d77e9> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony
0x3396a000 - 0x3399dfff AddressBook armv7 <59286907142fc76ead3dab9fa3baff5c> /System/Library/Frameworks/AddressBook.framework/AddressBook
0x3399e000 - 0x339b6fff libRIP.A.dylib armv7 <6d9b86e946a18416f1a50586beabd716> /System/Library/Frameworks/CoreGraphics.framework/Resources/libRIP.A.dylib
0x339c7000 - 0x339cafff libGFXShared.dylib armv7 <0d33b320dcac6cb6a594171f3f8c3b04> /System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib
0x339ea000 - 0x33a93fff QuartzCore armv7 <1628da07ea69b89c0b6a5a7d2dc42a24> /System/Library/Frameworks/QuartzCore.framework/QuartzCore
0x33b8b000 - 0x33bd0fff libsqlite3.dylib armv7 <7de3ef8f02a0af58ef9f58348d5dbc50> /usr/lib/libsqlite3.dylib
0x33bfc000 - 0x33d17fff CoreGraphics armv7 <6dcc299d5ca75f73afbc98a1b4bd2c7a> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics
0x33d21000 - 0x33d8ffff ProofReader armv7 <184b846e1f602485068db7a9c943595f> /System/Library/PrivateFrameworks/ProofReader.framework/ProofReader
0x33f5a000 - 0x33f99fff libGLImage.dylib armv7 <f261ea6e5f00e4ba4fda02bb4d7712b4> /System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib
0x33fde000 - 0x34087fff libxml2.2.dylib armv7 <1d74fa3a5cec309857503a51cb2df667> /usr/lib/libxml2.2.dylib
0x34091000 - 0x340dbfff libstdc++.6.dylib armv7 <7b2a8cf02f12c636c6db7f5e1906f9f0> /usr/lib/libstdc++.6.dylib
0x340fc000 - 0x34396fff libLAPACK.dylib armv7 <795a79616d24a733fae53d9df6c46998> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib
0x34464000 - 0x34503fff JavaScriptCore armv7 <28583b202a5108a6e93c9990a2f1d576> /System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore
0x34569000 - 0x345befff libvDSP.dylib armv7 <ec6199ca9490baba91f9bc644063bef1> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib
0x3473e000 - 0x34740fff libAccessibility.dylib armv7 <ee5bb3b14b91bcf192f0d18e9f31c40a> /usr/lib/libAccessibility.dylib
0x34781000 - 0x34786fff MobileKeyBag armv7 <dabd32c6bac583a6809c2b04c5907acf> /System/Library/PrivateFrameworks/MobileKeyBag.framework/MobileKeyBag
0x34787000 - 0x348b7fff AudioToolbox armv7 <9420239a007f28f7aa2163b05053d110> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox
0x348ba000 - 0x348fafff CoreAudio armv7 <96e6c0b793449c9e08a507693c956aad> /System/Library/Frameworks/CoreAudio.framework/CoreAudio
0x34906000 - 0x34951fff libBLAS.dylib armv7 <9e5eadf1538d47142a4257d2fa5bbdd5> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib
0x34979000 - 0x3497cfff IOSurface armv7 <83927fd3641791e5bcdadcca0edd196b> /System/Library/PrivateFrameworks/IOSurface.framework/IOSurface
0x349a7000 - 0x34ac6fff Foundation armv7 <5cffb5458e87beccdb75770cea676753> /System/Library/Frameworks/Foundation.framework/Foundation
0x34ad8000 - 0x34ae5fff libbsm.0.dylib armv7 <df1574298fea28ad799e1549425b44a4> /usr/lib/libbsm.0.dylib
0x34b3c000 - 0x34c55fff libicucore.A.dylib armv7 <71ef015f1994cf85658df91a50a37815> /usr/lib/libicucore.A.dylib
0x34c56000 - 0x34c56fff Accelerate armv7 <0601858b149ba0586210ad15b0d41c1e> /System/Library/Frameworks/Accelerate.framework/Accelerate
0x34cdf000 - 0x34da1fff CFNetwork armv7 <0860d900e5328f349290feaaa3eb6e9a> /System/Library/Frameworks/CFNetwork.framework/CFNetwork
0x35122000 - 0x3514bfff MobileCoreServices armv7 <fe6ab911eb680b758f415e20afec8e00> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices
</string>
<key>displayName</key>
<string>CoreDataBooks</string>
<key>name</key>
<string>CoreDataBooks</string>
<key>os_version</key>
<string>iPhone OS 4.1 (8B117)</string>
<key>system_ID</key>
<string></string>
<key>version</key>
<string>??? (???)</string>
</dict>
</plist>
It is the same with other core-data related samples.
Thanks in advance,
Nikola
Just a guess, but try to create the documents directory manually. It crashes because of the abort(); which gets called when the persistent store could not be accessed. And it can't be accessed (i.e. created) if the directory is not there.
I think the documents directory is created upon regular install of the app.
Or try adding this somewhere at the beginning:
NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
[[NSFileManager defaultManager] createDirectoryAtPath:path attributes:0];