Crashing on some devices when inserting objects to realm - ios

I have an application that uses Realm as the internal storage extensively, I recently run into a problem that appears to happen in some devices but not all devices. I did open an issue, but since the app is crashing quite seriously, I am hoping I could also get some insight from here.
Each time I tried to insert a message into realm, it crashed. I was using 3.18.0 at first and encounter this problem, then I saw there is a bug mentioned in #6268 and #6257. I upgrade to version 3.20.0 and it seems that the problem still appeared. Below is a reference for the error log.
The log:
Another log:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000019ba1e0dc 0x19b9fb000 + 143580
1 libsystem_pthread.dylib 0x000000019ba9b9b0 0x19ba95000 + 27056
2 libsystem_c.dylib 0x000000019b977f4c 0x19b91d000 + 372556
3 libsystem_c.dylib 0x000000019b977eb4 0x19b91d000 + 372404
4 Realm 0x0000000106023918 realm::util::terminate+ 3176728 (char const*, char const*, long) + 0
5 Realm 0x0000000106023be4 realm::util::terminate_internal+ 3177444 (std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 264
6 Realm 0x0000000106023d5c realm::util::terminate+ 3177820 (char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) + 328
7 Realm 0x0000000105d4db38 realm::Column<long long>::do_erase(unsigned long, unsigned long, bool) + 203576 (column.hpp:1606)
8 Realm 0x00000001060b60e0 realm::sync::TableInfoCache::get_table_info+ 3776736 (unsigned long) const + 1908
9 Realm 0x00000001060b6bf8 realm::sync::create_object_with_primary_key+ 3779576 (realm::sync::TableInfoCache const&, realm::Table&, realm::util::Optional<long long>) + 52
10 Realm 0x0000000105d9a400 realm::Object realm::Object::create<objc_object* __strong, RLMAccessorContext>(RLMAccessorContext&, std::__1::shared_ptr<realm::Realm> const&, realm::ObjectSchema const&, objc_object* __strong, bool, bool, unsigned long, realm::BasicRow<realm::Table>*) + 517120 (object_accessor.hpp:0)
11 Realm 0x0000000105d9a090 RLMAddObjectToRealm + 516240 (RLMObjectStore.mm:152)
12 <myapp> 0x0000000104b4b4a4 MyClass.insertRealmMessage(_:scrollToBottom:) + 357540 (MyClass+Realm.swift:0)
13 <myapp> 0x0000000104c04010 specialized MyClass.handle(_:something:) + 1114128 (MyClass+Socket.swift:0)
14 <myapp> 0x0000000104bec4a0 MyClass.process(_:didReceive:) + 1016992 (MyClass.swift:0)
15 <myapp> 0x0000000104ba84b8 closure #1 in MyClass.stream(_:didReceive:) + 738488 (MyClass.swift:0)
16 <myapp> 0x0000000104b0c8cc thunk for #escaping #callee_guaranteed () -> () + 100556 (<compiler-generated>:0)
17 libdispatch.dylib 0x000000019b8c0a38 0x19b861000 + 391736
18 libdispatch.dylib 0x000000019b8c17d4 0x19b861000 + 395220
19 libdispatch.dylib 0x000000019b8a19e4 0x19b861000 + 264676
20 CoreFoundation 0x000000019be11ec0 0x19bd68000 + 696000
21 CoreFoundation 0x000000019be0cdf8 0x19bd68000 + 675320
22 CoreFoundation 0x000000019be0c354 0x19bd68000 + 672596
23 GraphicsServices 0x000000019e00c79c 0x19e002000 + 42908
24 UIKitCore 0x00000001c83f7b68 0x1c7b3d000 + 9153384
25 <myapp> 0x0000000104afbcd0 main + 31952 (User.swift:29)
26 libdyld.dylib 0x000000019b8d28e0 0x19b8d1000 + 6368
Another log:
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000019ba1e0dc 0x19b9fb000 + 143580
1 libsystem_pthread.dylib 0x000000019ba9b9b0 0x19ba95000 + 27056
2 libsystem_c.dylib 0x000000019b977f4c 0x19b91d000 + 372556
3 libsystem_c.dylib 0x000000019b977eb4 0x19b91d000 + 372404
4 Realm 0x00000001018f3918 realm::util::terminate+ 3176728 (char const*, char const*, long) + 0
5 Realm 0x00000001018f3be4 realm::util::terminate_internal+ 3177444 (std::__1::basic_stringstream<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 264
6 Realm 0x00000001018f3d5c realm::util::terminate+ 3177820 (char const*, char const*, long, std::initializer_list<realm::util::Printable>&&) + 328
7 Realm 0x000000010161db38 realm::Column<long long>::do_erase(unsigned long, unsigned long, bool) + 203576 (column.hpp:1606)
8 Realm 0x00000001019860e0 realm::sync::TableInfoCache::get_table_info+ 3776736 (unsigned long) const + 1908
9 Realm 0x0000000101986bf8 realm::sync::create_object_with_primary_key+ 3779576 (realm::sync::TableInfoCache const&, realm::Table&, realm::util::Optional<long long>) + 52
10 Realm 0x000000010166a400 realm::Object realm::Object::create<objc_object* __strong, RLMAccessorContext>(RLMAccessorContext&, std::__1::shared_ptr<realm::Realm> const&, realm::ObjectSchema const&, objc_object* __strong, bool, bool, unsigned long, realm::BasicRow<realm::Table>*) + 517120 (object_accessor.hpp:0)
11 Realm 0x000000010166a090 RLMAddObjectToRealm + 516240 (RLMObjectStore.mm:152)
12 <myapp> 0x000000010047ebb0 MyClass.handle(realmMessage:shouldGenerateAutoIncrement:) + 207792 (MyClass.swift:0)
13 <myapp> 0x0000000100482588 specialized MyClass.handle(_:chat:) + 222600 (MyClass.swift:0)
14 <myapp> 0x00000001005444a0 MyClass.function(_:didReceive:) + 1016992 (MyClass.swift:0)
15 <myapp> 0x00000001005004b8 closure #1 in MyClass.strem(_:didReceive:) + 738488 (MyClass.swift:0)
16 <myapp> 0x00000001004648cc thunk for #escaping #callee_guaranteed () -> () + 100556 (<compiler-generated>:0)
17 libdispatch.dylib 0x000000019b8c0a38 0x19b861000 + 391736
18 libdispatch.dylib 0x000000019b8c17d4 0x19b861000 + 395220
19 libdispatch.dylib 0x000000019b8a19e4 0x19b861000 + 264676
20 CoreFoundation 0x000000019be11ec0 0x19bd68000 + 696000
21 CoreFoundation 0x000000019be0cdf8 0x19bd68000 + 675320
22 CoreFoundation 0x000000019be0c354 0x19bd68000 + 672596
23 GraphicsServices 0x000000019e00c79c 0x19e002000 + 42908
24 UIKitCore 0x00000001c83f7b68 0x1c7b3d000 + 9153384
25 <myapp> 0x0000000100453cd0 main + 31952 (User.swift:29)
26 libdyld.dylib 0x000000019b8d28e0 0x19b8d1000 + 6368
Steps to Reproduce
I can't actually reproduce the problem, it seems that it only happens to the device that is previously installed and update to the new version, I did try to reinstall older versions of the app and simulate the upgrade process, still no result.
Nearly each of the INSERT actions of the message object would result in a crash according to my clients.
It could happen anywhere in the app that does such a thing, below is some example.
Example One:
realm.beginWrite()
conversation.unread += 1
realm.add(message, update: Realm.UpdatePolicy.all)
// Update Conversation Timestamp
conversation.lastMessageTimestamp = message.timestamp
do {
try realm.commitWrite()
} catch let error {
log.debug("Unable to create Message")
log.debug(error.localizedDescription)
return
}
Example Two:
realm.beginWrite()
realm.add(newRealmMessage, update: Realm.UpdatePolicy.error)
// Update Conversation Timestamp
if let conversation = newRealmMessage.conversation {
conversation.lastMessageTimestamp = newRealmMessage.timestamp
}
DispatchQueue.main.async {
/*Some UI Modification*/
}
commit()
There are other places that I do similar things and seem to be producing the same result.

Related

Crashed: AVAudioSession Notify Thread EXC_BREAKPOINT in IOS 12 and 13

I am getting EXC_BREAKPOINT crash that occurs in the AVAudioSession Notify Thread. its happends in IOS 12 and 13 only, How to handle this?
Please have a look at crashlytics logs for more info from Firebase .
Crashed: AVAudioSession Notify Thread
0 WebKit 0x18a6b4430 WTFCrashWithInfo(int, char const*, char const*, int) + 20
1 WebKit 0x18a934484 WebKit::CallbackMap::put(WTF::Ref<WebKit::CallbackBase, WTF::DumbPtrTraits<WebKit::CallbackBase> >&&) + 312
2 WebKit 0x18a92681c WebKit::CallbackID WebKit::CallbackMap::put<API::SerializedScriptValue*, WTF::Optional<WebCore::ExceptionDetails>, WebKit::CallbackBase::Error>(WTF::Function<void (API::SerializedScriptValue*, WTF::Optional<WebCore::ExceptionDetails>, WebKit::CallbackBase::Error)>&&, WTF::Variant<std::nullptr_t, WTF::UniqueRef<WebKit::ProcessThrottler::Activity<(WebKit::ProcessThrottler::ActivityType)0> >, WTF::UniqueRef<WebKit::ProcessThrottler::Activity<(WebKit::ProcessThrottler::ActivityType)1> > >&&) + 112
3 WebKit 0x18a9266a4 WebKit::WebPageProxy::runJavaScriptInMainFrameScriptWorld(WebCore::RunJavaScriptParameters&&, WTF::Optional<WTF::String> const&, WTF::Function<void (API::SerializedScriptValue*, WTF::Optional<WebCore::ExceptionDetails>, WebKit::CallbackBase::Error)>&&) + 176
4 WebKit 0x18a9265bc WebKit::WebPageProxy::runJavaScriptInMainFrame(WebCore::RunJavaScriptParameters&&, WTF::Function<void (API::SerializedScriptValue*, WTF::Optional<WebCore::ExceptionDetails>, WebKit::CallbackBase::Error)>&&) + 32
5 WebKit 0x18a879680 -[WKWebView _evaluateJavaScript:asAsyncFunction:withArguments:forceUserGesture:completionHandler:] + 548
6 VIsualVoiceMail Production 0x1020e8d50 ViewController.audioRouteChanged() + 4363767120 (<compiler-generated>:4363767120)
7 VIsualVoiceMail Production 0x1020e9538 #objc ViewController.audioRouteChanged() + 4363769144 (<compiler-generated>:4363769144)
8 CoreFoundation 0x1830d0504 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
9 CoreFoundation 0x1830d054c ___CFXRegistrationPost1_block_invoke + 64
10 CoreFoundation 0x1830cf8a4 _CFXRegistrationPost1 + 368
11 CoreFoundation 0x1830cf57c ___CFXNotificationPost_block_invoke + 88
12 CoreFoundation 0x18304c2d4 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1412
13 CoreFoundation 0x1830ceedc _CFXNotificationPost + 1236
14 Foundation 0x18343c974 -[NSNotificationCenter postNotificationName:object:userInfo:] + 60
15 AVFAudio 0x18feec104 avfaudio::AVAudioSessionPropertyListener(void*, unsigned int, unsigned int, void const*) + 2640
16 AudioToolbox 0x18e3b5484 AudioSessionPropertyListeners::CallPropertyListeners(unsigned int, unsigned int, void const*) + 596
17 AudioToolbox 0x18e4098b0 HandleCFPropertyListChange(unsigned int, unsigned int, unsigned long, unsigned char*, unsigned int) + 696
18 AudioToolbox 0x18e40f468 HandleAudioSessionCFTypePropertyChangedMessage(unsigned int, unsigned int, void*, unsigned int) + 328
19 AudioToolbox 0x18e40eb80 ProcessDeferredMessage(unsigned int, __CFData const*, unsigned int, unsigned int) + 1620
20 AudioToolbox 0x18e40e17c ASCallbackReceiver_AudioSessionPingMessage + 632
21 AudioToolbox 0x18e47c398 _XAudioSessionPingMessage + 44
22 libAudioToolboxUtility.dylib 0x18e50f430 mshMIGPerform + 264
23 CoreFoundation 0x1830f3174 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
24 CoreFoundation 0x1830f2880 __CFRunLoopDoSource1 + 444
25 CoreFoundation 0x1830ed634 __CFRunLoopRun + 1888
26 CoreFoundation 0x1830ecba8 CFRunLoopRunSpecific + 424
27 AVFAudio 0x18fec3a2c GenericRunLoopThread::Entry(void*) + 156
28 AVFAudio 0x18ff147a0 CAPThread::Entry(CAPThread*) + 204
29 libsystem_pthread.dylib 0x182e8ad98 _pthread_start + 156
30 libsystem_pthread.dylib 0x182e8e74c thread_start + 8

Xcode. Unable to stop at breakpoint

I have an issue with debugging my iOS application. When the app reaches the breakpoint it stops there for a second and then the debugger crashes. (The app doesn't crash, only the debugger. A behavior similar to a device being disconnected from cable while it's in debug mode).
The print from Xcode Console:
Message from debugger: The LLDB RPC server has crashed. The crash log
is located in ~/Library/Logs/DiagnosticReports and has a prefix
'lldb-rpc-server'. Please file a bug and attach the most recent crash
log.
I checked the crash log and here's the part of the file:
Process: lldb-rpc-server [21320]
Path: /Applications/Xcode.app/Contents/SharedFrameworks/LLDBRPC.framework/Versions/A/Resources/lldb-rpc-server
Identifier: lldb-rpc-server
Version: 2
Code Type: X86-64 (Native)
Parent Process: Xcode [15500]
Responsible: lldb-rpc-server [21320]
User ID: 502
Date/Time: 2018-04-12 17:20:19.901 +0300
OS Version: Mac OS X 10.13.4 (17E199)
Report Version: 12
Anonymous UUID: BCD9F4BE-3ECF-2DD0-68EC-671CF1821432
Time Awake Since Boot: 24000 seconds
System Integrity Protection: enabled
Crashed Thread: 8 RPC packet thread for client tid 00055ab9 (350905)
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
Stack dump:
0. error finding type for _T07Staging11AppDelegateCD
abort() called
Thread 8 Crashed:: RPC packet thread for client tid 00055ab9 (350905)
0 libsystem_kernel.dylib 0x00007fff70cdcb6e __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff70ea7080 pthread_kill + 333
2 libsystem_c.dylib 0x00007fff70c3824d __abort + 144
3 libsystem_c.dylib 0x00007fff70c381bd abort + 142
4 com.apple.LLDB.framework 0x000000011132acdd swift::ModuleFile::fatal(llvm::Error) + 1213
5 com.apple.LLDB.framework 0x0000000111332711 swift::ModuleFile::getDeclChecked(llvm::PointerEmbeddedInt<unsigned int, 31>, llvm::Optional<swift::DeclContext*>) + 27649
6 com.apple.LLDB.framework 0x0000000111359e39 swift::ModuleFile::lookupValue(swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&) + 841
7 com.apple.LLDB.framework 0x0000000110b43f9a swift::ModuleDecl::lookupValue(llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, swift::NLKind, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 90
8 com.apple.LLDB.framework 0x0000000110b4e8aa void lookupInModule<llvm::SmallSet<swift::CanType, 4u, (anonymous namespace)::SortCanType>, swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >)::$_0>(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::namelookup::ResolutionKind, bool, swift::LazyResolver*, llvm::SmallDenseMap<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*>, 32u, llvm::DenseMapInfo<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, llvm::detail::DenseMapPair<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*>, llvm::TinyPtrVector<swift::ValueDecl*> > >&, swift::DeclContext const*, bool, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >, swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >)::$_0) + 346
9 com.apple.LLDB.framework 0x0000000110b4e71e swift::namelookup::lookupInModule(swift::ModuleDecl*, llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::DeclName, llvm::SmallVectorImpl<swift::ValueDecl*>&, swift::NLKind, swift::namelookup::ResolutionKind, swift::LazyResolver*, swift::DeclContext const*, llvm::ArrayRef<std::__1::pair<llvm::ArrayRef<std::__1::pair<swift::Identifier, swift::SourceLoc> >, swift::ModuleDecl*> >) + 1278
10 com.apple.LLDB.framework 0x0000000110b550e1 swift::DeclContext::lookupQualified(swift::Type, swift::DeclName, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) const + 1089
11 com.apple.LLDB.framework 0x0000000110c56db2 DeclsLookupSource::lookupQualified(swift::Identifier, swift::NLOptions, swift::LazyResolver*, llvm::SmallVectorImpl<swift::ValueDecl*>&) + 226
12 com.apple.LLDB.framework 0x0000000110c5693d FindFirstNamedDeclWithKind(swift::ASTContext*, llvm::StringRef const&, swift::DeclKind, VisitNodeResult&, llvm::Optional<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >) + 301
13 com.apple.LLDB.framework 0x0000000110c5608c VisitNodeIdentifier(swift::ASTContext*, swift::Demangle::Node*, swift::Demangle::Node*, VisitNodeResult&) + 124
14 com.apple.LLDB.framework 0x0000000110c4ebf7 VisitNode(swift::ASTContext*, swift::Demangle::Node*, VisitNodeResult&) + 199
15 com.apple.LLDB.framework 0x0000000110c4eba0 VisitNode(swift::ASTContext*, swift::Demangle::Node*, VisitNodeResult&) + 112
16 com.apple.LLDB.framework 0x0000000110c4eba0 VisitNode(swift::ASTContext*, swift::Demangle::Node*, VisitNodeResult&) + 112
17 com.apple.LLDB.framework 0x0000000110c4eba0 VisitNode(swift::ASTContext*, swift::Demangle::Node*, VisitNodeResult&) + 112
18 com.apple.LLDB.framework 0x0000000110c5475c swift::ide::getTypeFromMangledSymbolname(swift::ASTContext&, llvm::StringRef, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) + 204
19 com.apple.LLDB.framework 0x000000011172ceda lldb_private::SwiftASTContext::GetTypeFromMangledTypename(char const*, lldb_private::Error&) + 532
20 com.apple.LLDB.framework 0x00000001114a5101 DWARFASTParserSwift::ParseTypeFromDWARF(lldb_private::SymbolContext const&, DWARFDIE const&, lldb_private::Log*, bool*) + 887
21 com.apple.LLDB.framework 0x00000001115c2623 SymbolFileDWARF::ParseType(lldb_private::SymbolContext const&, DWARFDIE const&, bool*) + 171
22 com.apple.LLDB.framework 0x00000001115bc33f SymbolFileDWARF::GetTypeForDIE(DWARFDIE const&, bool) + 369
23 com.apple.LLDB.framework 0x00000001115bbc6e SymbolFileDWARF::ResolveType(DWARFDIE const&, bool, bool) + 68
24 com.apple.LLDB.framework 0x00000001115bbbed SymbolFileDWARF::ResolveTypeUID(unsigned long long) + 45
25 com.apple.LLDB.framework 0x00000001116390d7 lldb_private::SymbolFileType::GetType() + 51
26 com.apple.LLDB.framework 0x000000011147be4f lldb_private::ValueObjectVariable::GetCompilerTypeImpl() + 21
27 com.apple.LLDB.framework 0x000000011146cf67 lldb_private::ValueObject::MaybeCalculateCompleteType() + 39
28 com.apple.LLDB.framework 0x00000001114712dd lldb_private::ValueObject::GetObjectRuntimeLanguage() + 33
29 com.apple.LLDB.framework 0x000000011147167b lldb_private::ValueObject::IsRuntimeSupportValue() + 73
30 com.apple.LLDB.framework 0x000000010eb3faec lldb::SBFrame::GetVariables(lldb::SBVariablesOptions const&) + 624
31 com.apple.LLDB.framework 0x000000010eb3fda4 lldb::SBFrame::GetVariables(bool, bool, bool, bool, lldb::DynamicValueType) + 208
32 lldb-rpc-server 0x000000010e8b0aef rpc_server::_ZN4lldb7SBFrame12GetVariablesEbbbbNS_16DynamicValueTypeE::HandleRPCCall(rpc_common::Connection&, rpc_common::RPCStream&, rpc_common::RPCStream&) + 219
33 lldb-rpc-server 0x000000010e87662a rpc_common::Connection::PrivateHandleRPCPacket(rpc_common::RPCPacket&, rpc_common::RPCPacket&, bool&) + 506
34 lldb-rpc-server 0x000000010e87730c rpc_common::Connection::HandleRPCPacket(rpc_common::RPCPacket&) + 62
35 lldb-rpc-server 0x000000010e87a862 Packets::ProcessPackets() + 254
36 lldb-rpc-server 0x000000010e87a68b Packets::ReadThread() + 187
37 lldb-rpc-server 0x000000010e87a5cb Packets::RunReadThread(void*) + 9
38 libsystem_pthread.dylib 0x00007fff70ea4661 _pthread_body + 340
39 libsystem_pthread.dylib 0x00007fff70ea450d _pthread_start + 377
40 libsystem_pthread.dylib 0x00007fff70ea3bf9 thread_start + 13
(the full output could be found here)
https://pastebin.com/18ZE08kv
Line 28 says:
error finding type for _T07Staging11AppDelegateCD
Does anybody know, what the error means?
Any help would be appreciated.
Regards
Just move your breakpoint by a line. Clean the project and try to run again, it should solve your problem.

App Crashes on ParallelRenderQueue thread with Exception Type: EXC_BAD_ACCESS (SIGSEGV) and Exception Subtype: KERN_INVALID_ADDRESS

I am facing a crash with the following log. Basically I am trying to add an Image to a web view through camera.
The flow is as follows:
1. I take a picture through camera using Image Picker controller, save it into PhotosAlbum and get the image data.
2. Then I upload that image to the server, get the related data to that image.
3. Then I call a JS function to insert the URL received of the image in the web view.
After repeating the steps 1-3 for a couple of times, I get a crash on this particular thread.

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000040
Triggered by Thread: 16
Thread 16 name: Dispatch queue: CA::CG::ParallelRenderQueue
Thread 16 Crashed:
0 AGXMetalG5 0x0000000107f2a3c4 0x107f20000 + 41924
1 AGXMetalG5 0x0000000107f689b0 0x107f20000 + 297392
2 AGXMetalG5 0x0000000107f694b8 0x107f20000 + 300216
3 AGXMetalG5 0x0000000107f2c308 0x107f20000 + 49928
4 QuartzCore 0x0000000189b34cdc CA::OGL::MetalContext::start_render_encoder(CA::OGL::Surface*) + 268
5 QuartzCore 0x0000000189a2b07c CA::OGL::Context::prepare_destination_() + 32
6 QuartzCore 0x0000000189b39920 CA::OGL::MetalContext::draw_elements(CA::OGL::PrimitiveMode, unsigned int, unsigned short const*, CA::OGL::Vertex const*, unsigned int, unsigned int, CA::OGL::ClipPlane const*) + 184
7 QuartzCore 0x0000000189a00ccc CA::OGL::Context::ClippedArray::next_rect(CA::Bounds&) + 340
8 QuartzCore 0x0000000189abd468 CA::OGL::emit_one_part_rect(CA::OGL::Context&, CA::OGL::RectState const&, float const*, float const*, unsigned int) + 800
9 QuartzCore 0x0000000189a2a3ec CA::OGL::fill_rect_tex(CA::OGL::Context&, CA::OGL::RectState const&, float const*) + 188
10 QuartzCore 0x0000000189a29fa0 CA::OGL::ContentsGeometry::fill_and_unbind(CA::OGL::Context&, CA::OGL::Image*, CA::OGL::TextureFilter, float) const + 976
11 QuartzCore 0x0000000189aed41c CA::CG::fill_image(CA::CG::Renderer&, CGImage*, CA::Rect const&, CA::Mat2<double> const&, bool, bool, CGInterpolationQuality, CA::Bounds const*) + 2200
12 QuartzCore 0x0000000189a02298 CA::CG::DrawImage::draw_image(CA::CG::Renderer&, bool) const + 100
13 QuartzCore 0x00000001899fe574 CA::CG::DrawOp::render(CA::CG::Renderer&) const + 1280
14 QuartzCore 0x0000000189af3b3c CA::CG::Queue::parallel_render_callback(void*) + 320
15 libdispatch.dylib 0x000000019a96d770 _dispatch_client_callout + 16
16 libdispatch.dylib 0x000000019a978cbc _dispatch_sync_f_invoke + 72
17 QuartzCore 0x00000001899fcbc4 CA::CG::Queue::render_callback(void*) + 176
18 libdispatch.dylib 0x000000019a96d770 _dispatch_client_callout + 16
19 libdispatch.dylib 0x000000019a97975c _dispatch_queue_drain + 864
20 libdispatch.dylib 0x000000019a971274 _dispatch_queue_invoke + 464
21 libdispatch.dylib 0x000000019a97b62c _dispatch_root_queue_drain + 728
22 libdispatch.dylib 0x000000019a97b34c _dispatch_worker_thread3 + 112
23 libsystem_pthread.dylib 0x000000019ab81478 _pthread_wqthread + 1092

Xcode crashes when I set a breakpoint in a completion callback

I get Xcode quit unexpectedly while using the SimplePlayer plug-in.
simpleplayer is the name of the app.
Xcode 6.2 only happens in simulator. IOS target 8.1 and above. App works normal without breakpoint.
This only happens when I set the breakpoint in the completion callback.
Time Awake Since Boot: 530 seconds
Crashed Thread: 21 <lldb.process.internal-state(pid=1263)>
Exception Type: EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes: 0x0000000000000032, 0x000000014057b3bc
kernel messages:
-1 sec CODE SIGNING: cs_invalid_page(0x14057b000): p=1151[Xcode] final status 0x3004200, denying page sending SIGKILL
-1 sec CODE SIGNING: process 1151[Xcode]: rejecting invalid page at address 0x14057b000 from offset 0x225000 in file "/Users/USER/Library/Developer/CoreSimulator/Devices/C7E8D457-BFAB-43DA-8B0C-D9010BBB1D88/data/Containers/Bundle/Application/77AB1811-69B6-4079-B874-8E20A7160283/SimplePlayer.app/SimplePlayer" (cs_mtime:1427477037.0 == mtime:1427477037.0) (signed:1 validated:1 tainted:1 wpmapped:0 slid:0)
Thread 21 Crashed:: <lldb.process.internal-state(pid=1263)>
0 com.apple.LLDB.framework 0x000000010f2961f4 lldb_private::DataExtractor::GetU32_unchecked(unsigned long long*) const + 14
1 com.apple.LLDB.framework 0x000000010f39af99 ObjectFileMachO::ParseSymtab() + 3603
2 com.apple.LLDB.framework 0x000000010f39a0f2 ObjectFileMachO::GetSymtab() + 158
3 com.apple.LLDB.framework 0x000000010f43f238 lldb_private::SymbolVendor::GetSymtab() + 64
4 com.apple.LLDB.framework 0x000000010f2da04f lldb_private::Module::ResolveSymbolContextForAddress(lldb_private::Address const&, unsigned int, lldb_private::SymbolContext&, bool) + 333
5 com.apple.LLDB.framework 0x000000010f287295 lldb_private::Address::CalculateSymbolContext(lldb_private::SymbolContext*, unsigned int) const + 157
6 com.apple.LLDB.framework 0x000000010f42dede lldb_private::CompileUnit::ResolveSymbolContext(lldb_private::FileSpec const&, unsigned int, bool, bool, unsigned int, lldb_private::SymbolContextList&) + 630
7 com.apple.LLDB.framework 0x000000010f23b32b lldb_private::BreakpointResolverFileLine::SearchCallback(lldb_private::SearchFilter&, lldb_private::SymbolContext&, lldb_private::Address*, bool) + 217
8 com.apple.LLDB.framework 0x000000010f2efc8b lldb_private::SearchFilter::DoModuleIteration(lldb_private::SymbolContext const&, lldb_private::Searcher&) + 129
9 com.apple.LLDB.framework 0x000000010f2f00dc lldb_private::SearchFilter::DoModuleIteration(std::__1::shared_ptr<lldb_private::Module> const&, lldb_private::Searcher&) + 86
10 com.apple.LLDB.framework 0x000000010f2effc7 lldb_private::SearchFilter::SearchInModuleList(lldb_private::Searcher&, lldb_private::ModuleList&) + 241
11 com.apple.LLDB.framework 0x000000010f23339e lldb_private::Breakpoint::ModulesChanged(lldb_private::ModuleList&, bool, bool) + 772
12 com.apple.LLDB.framework 0x000000010f235955 lldb_private::BreakpointList::UpdateBreakpoints(lldb_private::ModuleList&, bool, bool) + 77
13 com.apple.LLDB.framework 0x000000010f4798ab lldb_private::Target::ModulesDidLoad(lldb_private::ModuleList&) + 69
14 com.apple.LLDB.framework 0x000000010f4797d6 lldb_private::Target::ModuleAdded(lldb_private::ModuleList const&, std::__1::shared_ptr<lldb_private::Module> const&) + 444
15 com.apple.LLDB.framework 0x000000010f2ddfad lldb_private::ModuleList::AppendImpl(std::__1::shared_ptr<lldb_private::Module> const&, bool) + 135
16 com.apple.LLDB.framework 0x000000010f47909c lldb_private::Target::GetSharedModule(lldb_private::ModuleSpec const&, lldb_private::Error*) + 1576
17 com.apple.LLDB.framework 0x000000010f3883b3 DynamicLoaderMacOSXDYLD::FindTargetModuleForDYLDImageInfo(DynamicLoaderMacOSXDYLD::DYLDImageInfo&, bool, bool*) + 331
18 com.apple.LLDB.framework 0x000000010f38a28c DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(std::__1::vector<DynamicLoaderMacOSXDYLD::DYLDImageInfo, std::__1::allocator<DynamicLoaderMacOSXDYLD::DYLDImageInfo> >&, unsigned int, bool) + 256
19 com.apple.LLDB.framework 0x000000010f3898e5 DynamicLoaderMacOSXDYLD::AddModulesUsingImageInfosAddress(unsigned long long, unsigned int) + 153
20 com.apple.LLDB.framework 0x000000010f389744 DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(void*, lldb_private::StoppointCallbackContext*, unsigned long long, unsigned long long) + 528
21 com.apple.LLDB.framework 0x000000010f23a146 lldb_private::BreakpointOptions::InvokeCallback(lldb_private::StoppointCallbackContext*, unsigned long long, unsigned long long) + 48
22 com.apple.LLDB.framework 0x000000010f237462 lldb_private::BreakpointLocation::InvokeCallback(lldb_private::StoppointCallbackContext*) + 82
23 com.apple.LLDB.framework 0x000000010f237bc5 lldb_private::BreakpointLocation::ShouldStop(lldb_private::StoppointCallbackContext*) + 115
24 com.apple.LLDB.framework 0x000000010f238816 lldb_private::BreakpointLocationCollection::ShouldStop(lldb_private::StoppointCallbackContext*) + 76
25 com.apple.LLDB.framework 0x000000010f240a74 lldb_private::BreakpointSite::ShouldStop(lldb_private::StoppointCallbackContext*) + 48
26 com.apple.LLDB.framework 0x000000010f4739e4 lldb_private::StopInfoBreakpoint::ShouldStopSynchronous(lldb_private::Event*) + 232
27 com.apple.LLDB.framework 0x000000010f487a1c lldb_private::Thread::ShouldStop(lldb_private::Event*) + 650
28 com.apple.LLDB.framework 0x000000010f48d285 lldb_private::ThreadList::ShouldStop(lldb_private::Event*) + 483
29 com.apple.LLDB.framework 0x000000010f46286d lldb_private::Process::ShouldBroadcastEvent(lldb_private::Event*) + 379
30 com.apple.LLDB.framework 0x000000010f46065e lldb_private::Process::HandlePrivateEvent(std::__1::shared_ptr<lldb_private::Event>&) + 356
31 com.apple.LLDB.framework 0x000000010f46305b lldb_private::Process::RunPrivateStateThread() + 511
32 com.apple.LLDB.framework 0x000000010f462a61 lldb_private::Process::PrivateStateThread(void*) + 9
33 libsystem_pthread.dylib 0x00007fff8cedc268 _pthread_body + 131
34 libsystem_pthread.dylib 0x00007fff8cedc1e5 _pthread_start + 176
35 libsystem_pthread.dylib 0x00007fff8ceda41d thread_start + 13

my app crash in IMGSGX543GLDriver

my app crash in IMGSGX543GLDriver ,the most difficult is there are not any code of my app in the crash log and i cannot reproduce it .This issue cost me several days and I still have no idea. Any ideas you guys provide, I will try. Thank you for your help.
Thread 12 name: Dispatch queue: CA::CG::Queue
Thread 12 Crashed:
0 IMGSGX543GLDriver 0x31cb4ff0 glrRetainVendCtxPipeProg + 0
1 IMGSGX543GLDriver 0x31caf8d8 gpusLoadCurrentPipelinePrograms + 1664
2 IMGSGX543GLDriver 0x31cb948c gldUpdateDispatch + 396
3 GLEngine 0x34184a0a gleDoDrawDispatchCoreES2 + 562
4 GLEngine 0x3412ef72 glDrawElements_IMM_ES2Exec + 190
5 QuartzCore 0x331bffc4 CA::OGL::GLContext::draw_elements(CA::OGL::PrimitiveMode, unsigned int, unsigned short const*, CA::OGL::Vertex const*, unsigned int, unsigned int, CA::OGL::ClipPlane const*) + 272
6 QuartzCore 0x331bfe7c CA::OGL::Context::array_flush() + 48
7 QuartzCore 0x331ef8ae CA::OGL::emit_combine_(CA::OGL::Context&, CA::OGL::TextureFunction, CA::OGL::Surface*, int, CA::OGL::Surface*, int, CA::OGL::Surface*, int, CA::Shape const*, CA::Vec4<float> const&) + 1114
8 QuartzCore 0x331ef444 CA::OGL::emit_combine(CA::OGL::Context&, CA::OGL::TextureFunction, CA::OGL::Surface*, int, CA::OGL::Surface*, int, CA::OGL::Surface*, int, CA::Shape const*, CA::Vec4<float> const&) + 112
9 QuartzCore 0x331e3560 CA::CG::DrawOp::render(CA::CG::Renderer&) const + 1940
10 QuartzCore 0x331e1854 CA::CG::Queue::render_callback(void*) + 116
11 libdispatch.dylib 0x346e4d08 _dispatch_queue_drain + 268
12 libdispatch.dylib 0x346e4b6e _dispatch_queue_invoke$VARIANT$mp + 34
13 libdispatch.dylib 0x346e57e0 _dispatch_worker_thread2 + 204
14 libsystem_c.dylib 0x32f67df4 _pthread_wqthread + 288
15 libsystem_c.dylib 0x32f67cc8 start_wqthread + 0

Resources