gRPC asynchronous service deadlocks/stuck forever - grpc

I implemented a multi-thread asynchronous service based on https://github.com/grpc/grpc/blob/master/examples/cpp/helloworld/greeter_async_client2.cc . I have 64 threads doing some execution and then contact the remote server in asynchronous manner. However, when I ran my code, usually it will stuck on pthread_join of some threads, and sometimes both of my node can successfully do pthread_join on all my worker threads and some times only one node can do that. I later ran info thread at the point of stuck and there is the result I get from it.
* 1 Thread 0x7ffff7fe2100 (LWP 10567) "rundb" 0x00007ffff64f4d2d in __GI___pthread_timedjoin_ex (threadid=140732532782848, thread_return=0x0, abstime=0x0,
block=<optimized out>) at pthread_join_common.c:89
2 Thread 0x7ffff55ff700 (LWP 10568) "rundb" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7ffff4134118)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
3 Thread 0x7ffff4dfe700 (LWP 10569) "rundb" 0x00007ffff621cbb7 in epoll_wait (epfd=25, events=0x7ffff3c446b0, maxevents=100, timeout=-1)
at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
4 Thread 0x7ffff3bff700 (LWP 10570) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff4108064)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
5 Thread 0x7ffff33fe700 (LWP 10571) "resolver-execut" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff410b860)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
6 Thread 0x7ffff17ff700 (LWP 10572) "grpc_global_tim" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0xd5a668 <g_cv_wait+40>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
7 Thread 0x7ffff07fd700 (LWP 10574) "grpc_health_che" 0x00007ffff64f99f3 in---Type <return> to continue, or q <return> to quit---ret
futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff07fb1e8)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
8 Thread 0x7ffff0ffe700 (LWP 10573) "grpc_health_che" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff0ffc1e8)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
9 Thread 0x7fffef7fb700 (LWP 10575) "grpcpp_sync_ser" 0x00007ffff64f9ed9 in futex_reltimed_wait_cancelable (private=<optimized out>,
reltime=0x7fffef7f8f60, expected=0, futex_word=0x7fffef7f90d8)
at ../sysdeps/unix/sysv/linux/futex-internal.h:142
27 Thread 0x7fffcdbff700 (LWP 10594) "grpc_global_tim" 0x00007ffff64f9ed9 in futex_reltimed_wait_cancelable (private=<optimized out>,
reltime=0x7fffcdbfd2d0, expected=0, futex_word=0xd5a668 <g_cv_wait+40>)
at ../sysdeps/unix/sysv/linux/futex-internal.h:142
41 Thread 0x7ffed89ff700 (LWP 10608) "rundb" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7ffed89fcfb0)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
81 Thread 0x7ffec49d7700 (LWP 10648) "rundb" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7ffec49d4fb0)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
83 Thread 0x7ffec39d5700 (LWP 10650) "rundb" 0x00007ffff621cbb7 in epoll_wait (epfd=3, events=0x7ffff404c2b0, maxevents=100, timeout=-1)
---Type <return> to continue, or q <return> to quit---ret
at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
91 Thread 0x7ffebf9cd700 (LWP 10658) "rundb" 0x0000000000429e7f in LogManager::run (this=0x7ffff5a3a1e0) at storage/log.cpp:79
152 Thread 0x7ffeb81fd700 (LWP 10719) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff410810c)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
545 Thread 0x7ffeb9fff700 (LWP 11112) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff41081b0)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
682 Thread 0x7fffefffc700 (LWP 11249) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff4108258)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
1397 Thread 0x7fffccbff700 (LWP 11964) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff4108300)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
3470 Thread 0x7ffeb89fe700 (LWP 14041) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff41083a8)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
---Type <return> to continue, or q <return> to quit---re
4766 Thread 0x7ffeb91ff700 (LWP 15337) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff4108450)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
7122 Thread 0x7ffe9f8ff700 (LWP 17693) "default-executo" 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>, expected=0,
futex_word=0x7ffff41084f8)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
7132 Thread 0x7ffeacdff700 (LWP 17703) "grpcpp_sync_ser" 0x00007ffff64f9ed9 in futex_reltimed_wait_cancelable (private=<optimized out>,
reltime=0x7ffeacdfce90, expected=0, futex_word=0x7ffeacdfd050)
at ../sysdeps/unix/sysv/linux/futex-internal.h:142
7135 Thread 0x7ffe651ff700 (LWP 17706) "grpcpp_sync_ser" 0x00007ffff621cbb7 in epoll_wait (epfd=14, events=0x7ffedb88a0b0, maxevents=100, timeout=9992)
at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
I compared it with the results of successfully joined program and I found the major issues are 41, 81 and 83. Then I did thread 41, thread 81 and thread 83 and I get the followings.
thread 41
#0 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>,
expected=0, futex_word=0x7ffed89fcfb0)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1 __pthread_cond_wait_common (abstime=0x0, mutex=0x7ffff404c278,
cond=0x7ffed89fcf88) at pthread_cond_wait.c:502
#2 __pthread_cond_wait (cond=0x7ffed89fcf88, mutex=0x7ffff404c278)
at pthread_cond_wait.c:655
#3 0x000000000072f05a in gpr_cv_wait ()
#4 0x00000000006a12b0 in begin_worker ()
#5 0x00000000006a1757 in pollset_work ()
#6 0x000000000067dd5a in pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#7 0x00000000005219ea in grpc_pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#8 0x000000000054fa23 in cq_next(grpc_completion_queue*, gpr_timespec, void*)
()
#9 0x000000000054ff18 in grpc_completion_queue_next ()
#10 0x0000000000470676 in grpc_impl::CompletionQueue::AsyncNextInternal(void**, bool*, gpr_timespec) ()
#11 0x00000000004434f3 in grpc_impl::CompletionQueue::Next (
this=0x7ffebe0370c0, tag=0x7ffed89fd2d8, ok=0x7ffed89fd2d3)
at /local/include/grpcpp/impl/codegen/completion_queue_impl.h:179
#12 0x0000000000443152 in Sundial_Async_Client::contactRemoteDone (
---Type <return> to continue, or q <return> to quit---ret
this=0x7ffff5a08240, cq=0x7ffebe0370c0, txn=0x7ffebe00a380, node_id=1,
response=0x0, count=1) at grpc/grpc_async_client.cpp:70
#13 0x000000000043b2dc in TxnManager::process_2pc_phase2 (this=0x7ffebe00a380,
rc=ABORT, cq=0x7ffebe0370c0) at system/txn.cpp:462
#14 0x000000000043a38c in TxnManager::start (this=0x7ffebe00a380)
at system/txn.cpp:166
#15 0x000000000043f8c2 in WorkerThread::run (this=0x7fffdb133440)
at system/worker_thread.cpp:92
#16 0x0000000000441ff9 in start_thread (thread=0x7fffdb133440)
at system/main.cpp:204
#17 0x00007ffff64f36db in start_thread (arg=0x7ffed89ff700)
at pthread_create.c:463
#18 0x00007ffff621c88f in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
thread 81
#0 0x00007ffff64f99f3 in futex_wait_cancelable (private=<optimized out>,
expected=0, futex_word=0x7ffec49d4fb0)
at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1 __pthread_cond_wait_common (abstime=0x0, mutex=0x7ffff404c278,
cond=0x7ffec49d4f88) at pthread_cond_wait.c:502
#2 __pthread_cond_wait (cond=0x7ffec49d4f88, mutex=0x7ffff404c278)
at pthread_cond_wait.c:655
#3 0x000000000072f05a in gpr_cv_wait ()
#4 0x00000000006a12b0 in begin_worker ()
#5 0x00000000006a1757 in pollset_work ()
#6 0x000000000067dd5a in pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#7 0x00000000005219ea in grpc_pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#8 0x000000000054fa23 in cq_next(grpc_completion_queue*, gpr_timespec, void*)
()
#9 0x000000000054ff18 in grpc_completion_queue_next ()
#10 0x0000000000470676 in grpc_impl::CompletionQueue::AsyncNextInternal(void**, bool*, gpr_timespec) ()
#11 0x00000000004434f3 in grpc_impl::CompletionQueue::Next (
this=0x7ffebb632000, tag=0x7ffec49d52d8, ok=0x7ffec49d52d3)
at /local/include/grpcpp/impl/codegen/completion_queue_impl.h:179
#12 0x0000000000443152 in Sundial_Async_Client::contactRemoteDone (
---Type <return> to continue, or q <return> to quit---ret
this=0x7ffff5a08240, cq=0x7ffebb632000, txn=0x7ffebb608000, node_id=1,
response=0x0, count=1) at grpc/grpc_async_client.cpp:70
#13 0x000000000043b2dc in TxnManager::process_2pc_phase2 (this=0x7ffebb608000,
rc=ABORT, cq=0x7ffebb632000) at system/txn.cpp:462
#14 0x000000000043a38c in TxnManager::start (this=0x7ffebb608000)
at system/txn.cpp:166
#15 0x000000000043f8c2 in WorkerThread::run (this=0x7fffdb133e40)
at system/worker_thread.cpp:92
#16 0x0000000000441ff9 in start_thread (thread=0x7fffdb133e40)
at system/main.cpp:204
#17 0x00007ffff64f36db in start_thread (arg=0x7ffec49d7700)
at pthread_create.c:463
#18 0x00007ffff621c88f in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
thread 83
#0 0x00007ffff621cbb7 in epoll_wait (epfd=3, events=0x7ffff404c2b0,
maxevents=100, timeout=-1) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
#1 0x00000000006a0c7e in pollable_epoll(pollable*, long) ()
#2 0x00000000006a17c5 in pollset_work ()
#3 0x000000000067dd5a in pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#4 0x00000000005219ea in grpc_pollset_work(grpc_pollset*, grpc_pollset_worker**, long) ()
#5 0x000000000054fa23 in cq_next(grpc_completion_queue*, gpr_timespec, void*)
()
#6 0x000000000054ff18 in grpc_completion_queue_next ()
#7 0x0000000000470676 in grpc_impl::CompletionQueue::AsyncNextInternal(void**, bool*, gpr_timespec) ()
#8 0x00000000004434f3 in grpc_impl::CompletionQueue::Next (
this=0x7ffebbe000c0, tag=0x7ffec39d32d8, ok=0x7ffec39d32d3)
at /local/include/grpcpp/impl/codegen/completion_queue_impl.h:179
#9 0x0000000000443152 in Sundial_Async_Client::contactRemoteDone (
this=0x7ffff5a08240, cq=0x7ffebbe000c0, txn=0x7ffebbe037e0, node_id=1,
response=0x0, count=1) at grpc/grpc_async_client.cpp:70
#10 0x000000000043b2dc in TxnManager::process_2pc_phase2 (this=0x7ffebbe037e0,
rc=ABORT, cq=0x7ffebbe000c0) at system/txn.cpp:462
#11 0x000000000043a38c in TxnManager::start (this=0x7ffebbe037e0)
at system/txn.cpp:166
---Type <return> to continue, or q <return> to quit---ret
#12 0x000000000043f8c2 in WorkerThread::run (this=0x7fffdb133ec0)
at system/worker_thread.cpp:92
#13 0x0000000000441ff9 in start_thread (thread=0x7fffdb133ec0)
at system/main.cpp:204
#14 0x00007ffff64f36db in start_thread (arg=0x7ffec39d5700)
at pthread_create.c:463
#15 0x00007ffff621c88f in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
It seems like occassionally the asynchronous client will get stuck at cq->Next(&got_tag, &ok), and I ran this execution over 10,000 times so now I suspect the RPC was lost during the contact. Therefore the server never processes it and the rpc was never returned back. I'm thinking about if I need to find a way to have guaranteed delivery. The follows are my send request function and check response function. I'm wondering if I can get any helps of what to do at this stuck poin.
Status Sundial_Async_Client:: contactRemote(CompletionQueue* cq, TxnManager * txn,uint64_t node_id,SundialRequest& request, SundialResponse** response){
// Call object to store rpc data
AsyncClientCall* call = new AsyncClientCall;
// stub_->PrepareAsyncSayHello() creates an RPC object, returning
// an instance to store in "call" but does not actually start the RPC
// Because we are using the asynchronous API, we need to hold on to
// the "call" instance in order to get updates on the ongoing RPC.
call->response_reader =
stub_->PrepareAsynccontactRemote(&call->context, request, cq);
// StartCall initiates the RPC call
call->response_reader->StartCall();
call->reply=*response;
// Request that, upon completion of the RPC, "reply" be updated with the
// server's response; "status" with the indication of whether the operation
// was successful. Tag the request with the memory address of the call object.
call->response_reader->Finish(call->reply, &call->status, (void*)call);
return Status::OK;
}
Status Sundial_Async_Client::contactRemoteDone(CompletionQueue* cq, TxnManager * txn,uint64_t node_id, SundialResponse* response, int count){
void* got_tag;
bool ok = false;
int local_count=0;
// Block until the next result is available in the completion queue "cq".
while (cq->Next(&got_tag, &ok)) {
local_count++;
// The tag in this example is the memory location of the call object
AsyncClientCall* call = static_cast<AsyncClientCall*>(got_tag);
// Verify that the request was completed successfully. Note that "ok"
// corresponds solely to the request for updates introduced by Finish().
GPR_ASSERT(ok);
// Once we're complete, deallocate the call object.
//doing the cleaning
glob_stats->_stats[GET_THD_ID]->_resp_msg_count[ call->reply->response_type() ] ++;
glob_stats->_stats[GET_THD_ID]->_resp_msg_size[ call->reply->response_type() ] += call->reply->SpaceUsedLong();
delete call;
if(local_count==count){
break;
}
}
//txn->rpc_semaphore->decr();
return Status::OK;
}

I think this is more likely a logical issue. Are you sure you send out the request every time before you check the response?

Related

Crash in sqlite3 while do the sqlite3_prepare_v2

I'm getting following crash issue on QNX and it's hard to reproduce and cannot reproduce on Window platform.
*Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x79a7da20 in pcache1EnforceMaxPage () from libClient.so
[Current thread is 35 (pid 1601600 tid 35)]
(gdb) bt
#0 0x79a7da20 in pcache1EnforceMaxPage () from libClient.so
#1 0x79a7e2a0 in sqlite3PagerSetCachesize () from libClient.so
#2 0x79a7ee9c in sqlite3BtreeSetCacheSize () from libClient.so
#3 0x79ade4b0 in sqlite3InitOne () from libClient.so
#4 0x79ade80c in sqlite3Init () from libClient.so
#5 0x79adebb0 in sqlite3ReadSchema () from libClient.so
#6 0x79adf2a4 in sqlite3LocateTable () from libClient.so
#7 0x79adfa98 in selectExpander () from libClient.so
#8 0x79a8065c in sqlite3WalkSelect () from libClient.so
#9 0x79a8b5e0 in sqlite3SelectPrep () from libClient.so
#10 0x79ac6f84 in sqlite3Select () from libClient.so
#11 0x79ad8704 in sqlite3Parser () from libClient.so
#12 0x79adaa40 in sqlite3RunParser () from libClient.so
#13 0x79adc574 in sqlite3Prepare () from libClient.so
#14 0x79adc934 in sqlite3LockAndPrepare () from libClient.so
#15 0x79adcbcc in sqlite3_prepare_v2 () from libClient.so*

Just a code less than 'Hello world' of QML causes a segmentation fault with cygwin

I am trying to use QML with cygwin.
I prepared this very simple code, simple.qml.
import QtQuick 2.0
Rectangle { }
Then, qmlscene-qt5 simple.qml causes segmentation fault. How can I avoid segfaluts?
Software versions are shown below:
Windows: both 8.1 64bit and 10 64bit cause segfault
cygwin: 2.5.0-1 x86
xorg-server: 1.18.2-1
LibQt5Core5, qt5-declarative-tools and etc.: 5.5.1-1
Incidentally, this code does not cause segfault.
import QtQuick 2.0
import QtQuick.Window 2.0
import QtQuick.Controls 1.0
Window{
title: 'window'
Label{
// text: 'hello, world!'
// If I uncomment the above line, a segfault emerges.
}
}
Thank you for reading this question.
FYI, a gdb log is shown below. I execute gdb /usr/bin/qmlscene-qt5 and examine where after segfaulted.
#0 0xfd6411db in ?? ()
#1 0x444f41b6 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#2 0x444f465a in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#3 0x4441426d in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#4 0x44414ac0 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#5 0x4440bd7d in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#6 0x4440c247 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#7 0x44527ca5 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#8 0x442578c6 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#9 0x44228415 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#10 0x44228941 in gallium_dri!__driDriverGetExtensions_swrast ()
from C:/cygwin/lib/dri/swrast_dri.so
#11 0x6727f40f in QOpenGLFunctions::glDrawElements (indices=<optimized out>,
type=5123, count=<optimized out>, mode=<optimized out>,
this=<optimized out>) at /usr/include/qt5/QtGui/qopenglfunctions.h:727
#12 QSGBatchRenderer::Renderer::renderMergedBatch (this=this#entry=0x8041e638,
batch=<optimized out>)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2299
#13 0x672811a7 in QSGBatchRenderer::Renderer::renderMergedBatch (
batch=<optimized out>, this=0x8041e638)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2512
#14 QSGBatchRenderer::Renderer::renderBatches (this=this#entry=0x8041e638)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2493
#15 0x67286f3f in QSGBatchRenderer::Renderer::render (this=0x8041e638)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp:2681
#16 0x6728fc33 in QSGRenderer::renderScene (this=this#entry=0x8041e638,
bindable=...)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgrenderer.cpp:208
#17 0x67290657 in QSGRenderer::renderScene (this=0x8041e638, fboId=0)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/coreapi/qsgrenderer.cpp:168
#18 0x6729fc84 in QSGRenderContext::renderNextFrame (this=0x802763f0,
renderer=0x8041e638, fboId=0)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/qsgcontext.cpp:558
#19 0x672e6d30 in QQuickWindowPrivate::renderSceneGraph (
this=this#entry=0x80275ff0, size=...)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/items/qquickwindow.cpp:383
#20 0x672b80a5 in QSGGuiThreadRenderLoop::renderWindow (
this=this#entry=0x8027e1e8, window=0x80275fd8)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/qsgrenderloop.cpp:378
#21 0x672b9c9f in QSGGuiThreadRenderLoop::exposureChanged (this=0x8027e1e8,
window=0x80275fd8)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/scenegraph/qsgrenderloop.cpp:422
#22 0x67cba4f9 in QWindow::event (this=0x80275fd8, ev=0x28c834)
at /usr/src/debug/qt5-base-5.5.1-1/src/gui/kernel/qwindow.cpp:2053
#23 0x672f40ce in QQuickWindow::event (this=0x80275fd8, e=0x28c834)
at /usr/src/debug/qt5-declarative-5.5.1-1/src/quick/items/qquickwindow.cpp:1413
#24 0x6471b4a1 in QApplicationPrivate::notify_helper (
this=this#entry=0x80060500, receiver=receiver#entry=0x80275fd8,
e=e#entry=0x28c834)
at /usr/src/debug/qt5-base-5.5.1-1/src/widgets/kernel/qapplication.cpp:3716
#25 0x647207dc in QApplication::notify (this=0x28cba4, receiver=0x80275fd8,
e=0x28c834)
at /usr/src/debug/qt5-base-5.5.1-1/src/widgets/kernel/qapplication.cpp:3499
#26 0x68d90d62 in QCoreApplication::notifyInternal (this=0x28cba4,
receiver=0x80275fd8, event=0x28c834)
at /usr/src/debug/qt5-base-5.5.1-1/src/corelib/kernel/qcoreapplication.cpp:965
#27 0x67cb3377 in QCoreApplication::sendSpontaneousEvent (event=0x28c834,
receiver=0x80275fd8)
at /usr/src/debug/qt5-base-5.5.1-1/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:227
#28 QGuiApplicationPrivate::processExposeEvent (e=e#entry=0x802fdef0)
at /usr/src/debug/qt5-base-5.5.1-1/src/gui/kernel/qguiapplication.cpp:2648
#29 0x67cb41b8 in QGuiApplicationPrivate::processWindowSystemEvent (
e=e#entry=0x802fdef0)
at /usr/src/debug/qt5-base-5.5.1-1/src/gui/kernel/qguiapplication.cpp:1643
#30 0x67c9b020 in QWindowSystemInterface::sendWindowSystemEvents (flags=...)
at /usr/src/debug/qt5-base-5.5.1-1/src/gui/kernel/qwindowsysteminterface.cpp:625
#31 0x64654546 in userEventSourceDispatch (source=0x800a4ea0)
at /usr/src/debug/qt5-base-5.5.1-1/src/platformsupport/eventdispatchers/qeventdispatcher_glib.cpp:70
#32 0x55ff0173 in g_main_context_dispatch () from /usr/bin/cygglib-2.0-0.dll
#33 0x55ff03da in g_main_context_dispatch () from /usr/bin/cygglib-2.0-0.dll
#34 0x55ff047a in g_main_context_iteration () from /usr/bin/cygglib-2.0-0.dll
#35 0x68dd3b12 in QEventDispatcherGlib::processEvents (this=0x80060710,
flags=...)
at /usr/src/debug/qt5-base-5.5.1-1/src/corelib/kernel/qeventdispatcher_glib.cpp:418
#36 0x68d8fd3f in QEventLoop::processEvents (flags=..., this=0x28caac)
at /usr/src/debug/qt5-base-5.5.1-1/src/corelib/kernel/qeventloop.cpp:128
#37 QEventLoop::exec (this=this#entry=0x28caac, flags=flags#entry=...)
at /usr/src/debug/qt5-base-5.5.1-1/src/corelib/kernel/qeventloop.cpp:204
#38 0x68d96a43 in QCoreApplication::exec ()
at /usr/src/debug/qt5-base-5.5.1-1/src/corelib/kernel/qcoreapplication.cpp:1229
#39 0x00404157 in main (argc=2, argv=0x28cc5c)
at /usr/src/debug/qt5-declarative-5.5.1-1/tools/qmlscene/main.cpp:598
Try reverting dri-drivers to version 11.0.9-1
There is a similar issue on 32bit.
https://cygwin.com/ml/cygwin/2016-04/msg00254.html

nginx: worker process: malloc(): memory corruption: 0x0000000000ee8c00

pstack
pstack 27339
#0 0x00000037c600cd2b in pthread_once () from /lib64/libpthread.so.0
#1 0x00000037c5cfe954 in backtrace () from /lib64/libc.so.6
#2 0x00000037c5c7054b in __libc_message () from /lib64/libc.so.6
#3 0x00000037c5c75e66 in malloc_printerr () from /lib64/libc.so.6
#4 0x00000037c5c79904 in _int_malloc () from /lib64/libc.so.6
#5 0x00000037c5c7a6b1 in malloc () from /lib64/libc.so.6
#6 0x00000037c580cc5d in _dl_map_object_deps () from /lib64/ld-linux-x86-64.so.2
#7 0x00000037c5812b62 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
#8 0x00000037c580e266 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#9 0x00000037c58125aa in _dl_open () from /lib64/ld-linux-x86-64.so.2
#10 0x00000037c5d26b20 in do_dlopen () from /lib64/libc.so.6
#11 0x00000037c580e266 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
#12 0x00000037c5d26c77 in __libc_dlopen_mode () from /lib64/libc.so.6
#13 0x00000037c5cfe825 in init () from /lib64/libc.so.6
#14 0x00000037c600cd33 in pthread_once () from /lib64/libpthread.so.0
#15 0x00000037c5cfe954 in backtrace () from /lib64/libc.so.6
#16 0x00000037c5c7054b in __libc_message () from /lib64/libc.so.6
#17 0x00000037c5c75e66 in malloc_printerr () from /lib64/libc.so.6
#18 0x00000037c5c79904 in _int_malloc () from /lib64/libc.so.6
#19 0x00000037c5c7a6b1 in malloc () from /lib64/libc.so.6
#20 0x0000000000457e1a in ngx_alloc ()
#21 0x0000000000443d92 in ngx_palloc_large ()
#22 0x0000000000443e95 in ngx_palloc ()
#23 0x00000000004456ec in ngx_create_temp_buf ()
#24 0x000000000049f79b in ajp_msg_create_buffer ()
#25 0x00000000004a22de in ngx_http_ajp_create_request ()
#26 0x0000000000479593 in ngx_http_upstream_init_request ()
#27 0x0000000000479955 in ngx_http_upstream_init ()
#28 0x00000000004712f8 in ngx_http_read_client_request_body ()
#29 0x00000000004a1a6f in ngx_http_ajp_handler ()
#30 0x000000000046725d in ngx_http_core_content_phase ()
#31 0x0000000000462a23 in ngx_http_core_run_phases ()
#32 0x00000000004a6ac4 in npc_sendRequest ()
#33 0x000000000045cc9f in ngx_epoll_process_events ()
#34 0x0000000000455c83 in ngx_process_events_and_timers ()
#35 0x000000000045b684 in ngx_worker_process_cycle ()
#36 0x0000000000459e55 in ngx_spawn_process ()
#37 0x000000000045bfe9 in ngx_master_process_cycle ()
#38 0x000000000044318d in main ()
error log
*** glibc detected *** nginx: worker process: malloc(): memory corruption: 0x0000000000ee8c00 ***
*** glibc detected *** nginx: worker process: malloc(): memory corruption: 0x0000000000ee8c00 ***
var /proc/pid/stack
[<ffffffff810a9a49>] futex_wait_queue_me+0xb9/0xf0
[<ffffffff810aab58>] futex_wait+0x1f8/0x380
[<ffffffff810ac2c1>] do_futex+0x121/0xb60
[<ffffffff810acd7b>] sys_futex+0x7b/0x170
[<ffffffff8100b072>] system_call_fastpath+0x16/0x1b
[<ffffffffffffffff>] 0xffffffffffffffff
When I got the error, nginx process hanged.
because of the malloc error process, all proceses hang Sometimes.
In error log, there are no backtrace.
So, I guess there is a dead lock between malloc and backtrace(or printerr).
I used 'accept_mutex off' option, and it just reduced the error. (It's not a perfect solution)
I'm using nginx-0.8.54.

Asterisk segfault error 4 in libsqlite3.so.0.8.6

I use Asterisk 11.3.0 and every 3-4 days im geting this in dmesg :
asterisk[24467]: segfault at 18 ip 00007f7e5c49ba3f sp 00007f7e035fb500 error 4 in libsqlite3.so.0.8.6[7f7e5c46b000+8c000]
after that asterisk crashes and i need to restart it.
I used gdb to find solution in core file and it shows me this :
*#0 __ao2_callback (c=0x0, arg=0x7fbfaf050290, flags=OBJ_POINTER) at astobj2.c:1190
#1 __ao2_find (c=0x0, arg=0x7fbfaf050290, flags=OBJ_POINTER) at astobj2.c:1221
#2 0x00000000004d7f2b in find_interface (format1=<value optimized out>, format2=0x7fbf70935c28) at format.c:107
#3 format_cmp_helper (format1=<value optimized out>, format2=0x7fbf70935c28) at format.c:314
#4 0x00000000004da242 in cmp_cb (obj=<value optimized out>, arg=<value optimized out>, flags=<value optimized out>) at format_cap.c:56
#5 0x0000000000447652 in internal_ao2_callback (c=0x7fbf7124bf58, flags=OBJ_POINTER, cb_fn=<value optimized out>, arg=0x7fbf7124944c, data=0x0, type=DEFAULT, tag=0x0, file=0x0, line=0,
func=0x0) at astobj2.c:1085
#6 0x00000000004480aa in __ao2_callback (c=<value optimized out>, arg=<value optimized out>, flags=<value optimized out>) at astobj2.c:1190
#7 __ao2_find (c=<value optimized out>, arg=<value optimized out>, flags=<value optimized out>) at astobj2.c:1221
#8 0x00000000004da166 in ast_format_cap_iscompatible (cap=<value optimized out>, format=<value optimized out>) at format_cap.c:318
#9 0x00007fbfd8b86fd7 in sip_rtp_read (ast=0x7fbf70da2288) at chan_sip.c:8344
#10 sip_read (ast=0x7fbf70da2288) at chan_sip.c:8389
#11 0x0000000000484c78 in __ast_read (chan=0x7fbf70da2288, dropaudio=0) at channel.c:4010
#12 0x00007fbfcbdf6fde in wait_for_answer (qe=0x7fbfaf053320, outgoing=0x7fbf2c540930, to=0x7fbfaf0531d8, digit=0x7fbfaf0531df "", prebusies=<value optimized out>, caller_disconnect=0,
forwardsallowed=1) at app_queue.c:4527
#13 0x00007fbfcbdf844a in try_calling (qe=0x7fbfaf053320, opts=..., opt_args=0x7fbfaf054520, announceoverride=<value optimized out>, url=0x7fbfaf0532a8 "", tries=<value optimized out>,
noption=0x7fbf2ca7d3e0, agi=0x7fbf71249448 "\002", macro=0x7fc01526fbd0 "AWAVAUE1\355ATUH\211\375S\211\313H\203\354(\350\035\324\377\377\003\230p\002",
gosub=0x7fc0199a6619 "H\211\320H\203\304\bH=\001\360\377\377s\001\303H\213\rp\031+", ringing=0) at app_queue.c:5379
#14 0x00007fbfcbdfc53b in queue_exec (chan=0x7fbf70da2288, data=<value optimized out>) at app_queue.c:7108
#15 0x000000000051bca4 in pbx_exec (c=0x7fbf70da2288, app=0x2921650, data=0x7fbfaf056680 "stp,tTc,,,1500") at pbx.c:1589
#16 0x0000000000526434 in pbx_extension_helper (c=0x7fbf70da2288, con=0x0, context=<value optimized out>, exten=<value optimized out>, priority=6, label=0x0,
callerid=0x7fbf71499690 "4959479643", action=E_SPAWN, found=0x7fbfaf058cfc, combined_find_spawn=1) at pbx.c:4665
#17 0x000000000052d3f5 in ast_spawn_extension (c=0x7fbf70da2288, args=0x0) at pbx.c:5781
#18 __ast_pbx_run (c=0x7fbf70da2288, args=0x0) at pbx.c:6256
#19 0x000000000052eb7b in pbx_thread (data=<value optimized out>) at pbx.c:6586
#20 0x000000000056ec5b in dummy_start (data=<value optimized out>) at utils.c:1091
#21 0x00007fc0183ea851 in start_thread () from /lib64/libpthread.so.0
#22 0x00007fc0199b390d in clone () from /lib64/libc.so.6*
thread apply all bt show this :
Thread 153 (Thread 0x7fd27e25d700 (LWP 23043)):
0 0x00007fd2f360a253 in poll () from /lib64/libc.so.6
1 0x00000000004820d1 in ast_waitfor_nandfds (c=0x7fd27e2571b8, n=1, fds=0x30b4e, nfds=1417518661, exception=0x0, outfd=0x7fd27e2571e4, ms=0x2e6c656e6e616863) at channel.c:3254
2 0x00000000004860a2 in ast_waitfordigit_full (c=0x7fd25491aea8, timeout_ms=1000, cmdfd=-1, audiofd=-1) at channel.c:3622
3 0x00007fd2a5a47415 in wait_our_turn (chan=0x7fd25491aea8, data=<value optimized out>) at app_queue.c:4755
4 queue_exec (chan=0x7fd25491aea8, data=<value optimized out>) at app_queue.c:7055
5 0x000000000051bca4 in pbx_exec (c=0x7fd25491aea8, app=0x361d720, data=0x7fd27e25a680 "ao,tTc,,,1200") at pbx.c:1589
6 0x0000000000526434 in pbx_extension_helper (c=0x7fd25491aea8, con=0x0, context=<value optimized out>, exten=<value optimized out>, priority=19, label=0x0,
callerid=0x7fd25404ad50 "9166506959", action=E_SPAWN, found=0x7fd27e25ccfc, combined_find_spawn=1) at pbx.c:4665
7 0x000000000052d3f5 in ast_spawn_extension (c=0x7fd25491aea8, args=0x0) at pbx.c:5781
8 __ast_pbx_run (c=0x7fd25491aea8, args=0x0) at pbx.c:6256
9 0x000000000052eb7b in pbx_thread (data=<value optimized out>) at pbx.c:6586
10 0x000000000056ec5b in dummy_start (data=<value optimized out>) at utils.c:1091
11 0x00007fd2f204a851 in start_thread () from /lib64/libpthread.so.0
12 0x00007fd2f361390d in clone () from /lib64/libc.so.6
Thread 152 (Thread 0x7fd27d2dd700 (LWP 23075)):
0 0x00007fd2f204e7bb in pthread_cond_timedwait##GLIBC_2.3.2 () from /lib64/libpthread.so.0
1 0x0000000000448be0 in ast_audiohook_trigger_wait (audiohook=0x7fd1d80ddb10) at audiohook.c:939
2 0x00007fd2b46b8388 in mixmonitor_thread (obj=0x7fd1d80ddb10) at app_mixmonitor.c:635
3 0x000000000056ec5b in dummy_start (data=<value optimized out>) at utils.c:1091
4 0x00007fd2f204a851 in start_thread () from /lib64/libpthread.so.0
5 0x00007fd2f361390d in clone () from /lib64/libc.so.6
Thread 151 (Thread 0x7fd27d3d5700 (LWP 24008)):
0 0x00007fd2f2051054 in __lll_lock_wait () from /lib64/libpthread.so.0
1 0x00007fd2f204c3a3 in _L_lock_892 () from /lib64/libpthread.so.0
2 0x00007fd2f204c287 in pthread_mutex_lock () from /lib64/libpthread.so.0
3 0x0000000000447b5d in internal_ao2_callback (c=0x213ec18, flags=OBJ_NODATA, cb_fn=<value optimized out>, arg=0x7fd27d3d42c0, data=0x0, type=DEFAULT, tag=0x0, file=0x0, line=0, func=0x0)
at astobj2.c:1071
4 0x0000000000447d21 in __ao2_callback (c=<value optimized out>, flags=<value optimized out>, cb_fn=<value optimized out>, arg=<value optimized out>) at astobj2.c:1190
5 0x00007fd2b27c7cf1 in sip_show_channels (e=<value optimized out>, cmd=<value optimized out>, a=<value optimized out>) at chan_sip.c:20737
6 0x00000000004938c7 in ast_cli_command_full (uid=0, gid=0, fd=551, s=0x7fd27d3d4650 "sip show channels") at cli.c:2560
7 0x0000000000493afc in ast_cli_command_multiple_full (uid=0, gid=0, fd=551, size=18, s=0x7fd27d3d4abf "sip show channels") at cli.c:2583
8 0x0000000000440259 in netconsole (vconsole=0x8401f8) at asterisk.c:1336
9 0x000000000056ec5b in dummy_start (data=<value optimized out>) at utils.c:1091
10 0x00007fd2f204a851 in start_thread () from /lib64/libpthread.so.0
11 0x00007fd2f361390d in clone () from /lib64/libc.so.6
Thread 150 (Thread 0x7fd29d486700 (LWP 13766)):
0 0x00007fd2f360a253 in poll () from /lib64/libc.so.6
1 0x00000000004820d1 in ast_waitfor_nandfds (c=0x7fd29d47de00, n=2, fds=0x0, nfds=0, exception=0x0, outfd=0x0, ms=0x2e6c656e6e616863) at channel.c:3254
2 0x0000000000489428 in ast_waitfor_n (c0=0x7fd25435cdd8, c1=0x7fd1d847d498, config=0x7fd29d480060, fo=0x7fd29d47e298, rc=0x7fd29d47e290) at channel.c:3535
3 ast_generic_bridge (c0=0x7fd25435cdd8, c1=0x7fd1d847d498, config=0x7fd29d480060, fo=0x7fd29d47e298, rc=0x7fd29d47e290) at channel.c:7540
4 ast_channel_bridge (c0=0x7fd25435cdd8, c1=0x7fd1d847d498, config=0x7fd29d480060, fo=0x7fd29d47e298, rc=0x7fd29d47e290) at channel.c:8018
5 0x00000000004c3466 in ast_bridge_call (chan=0x7fd25435cdd8, peer=0x7fd1d847d498, config=0x7fd29d480060) at features.c:4464
6 0x00007fd2a5a44ddb in try_calling (qe=0x7fd29d480320, opts=..., opt_args=0x7fd29d481520, announceoverride=<value optimized out>, url=0x0, tries=<value optimized out>,
noption=0x2e6c656e6e616863, agi=<value optimized out>, macro=<value optimized out>, gosub=<value optimized out>, ringing=1702125924) at app_queue.c:5874
7 0x00007fd2a5a4753b in queue_exec (chan=0x7fd25435cdd8, data=<value optimized out>) at app_queue.c:7108
8 0x000000000051bca4 in pbx_exec (c=0x7fd25435cdd8, app=0x361d720, data=0x7fd29d483680 "stp,tTc") at pbx.c:1589
9 0x0000000000526434 in pbx_extension_helper (c=0x7fd25435cdd8, con=0x0, context=<value optimized out>, exten=<value optimized out>, priority=7, label=0x0,
Can you guys help me to solve this problem ?
Will appreciate any help.
current asterisk 11.x version is 11.14.You are using very old version and ask someone debug it? please change to current asterisk and libsqlite version, update your glibc,other system lib after that check if issue exist. 99% chance you will never spot it after that.

Bad access error from within CoreData with sqlite persistent store during RESTKit mapping operation

I have a really nasty issue thats causing me to tear my hair out. A bad access error is occurring deep within core data - In terms of visible code I've narrowed it down to a RESTKit one-to-one relationship mapping operation.
I'm using sqlite as the persistent store. This issue does not occur if I use an in-memory etc and only happens on app restart on a non-empty sqlite.
Here is the stack trace from the NSManagedObjectContextQueue:
#0 0x03b0380a in semaphore_wait_trap ()
#1 0x03699cde in _dispatch_thread_semaphore_wait ()
#2 0x03697516 in _dispatch_barrier_sync_f_slow ()
#3 0x03697413 in dispatch_barrier_sync_f ()
#4 0x010562a2 in _perform ()
#5 0x01056ebe in -[NSManagedObjectContext(_NestedContextSupport) newValueForRelationship:forObjectWithID:withContext:error:] ()
#6 0x0105f1c4 in -[NSFaultHandler retainedFulfillAggregateFaultForObject:andRelationship:withContext:] ()
#7 0x0105eb97 in -[_NSFaultingMutableSet willRead] ()
#8 0x0105c204 in -[_NSFaultingMutableSet containsObject:] ()
#9 0x0104ec9e in -[NSManagedObject(_NSInternalMethods) _includeObject:intoPropertyWithKey:andIndex:] ()
#10 0x0104eae4 in -[NSManagedObject(_NSInternalMethods) _maintainInverseRelationship:forProperty:oldDestination:newDestination:] ()
#11 0x0104e332 in -[NSManagedObject(_NSInternalMethods) _didChangeValue:forRelationship:named:withInverse:] ()
#12 0x0104df88 in -[NSManagedObjectContext observeValueForKeyPath:ofObject:change:context:] ()
#13 0x02ce48c7 in NSKeyValueNotifyObserver ()
#14 0x02ce6206 in NSKeyValueDidChange ()
#15 0x02ca28dd in -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] ()
#16 0x01030825 in _PF_ManagedObject_DidChangeValueForKeyIndex ()
#17 0x0102fcad in _sharedIMPL_setvfk_core ()
#18 0x010614a6 in -[NSManagedObject(_PFDynamicAccessorsAndPropertySupport) _setGenericValue:forKey:withIndex:flags:] ()
#19 0x0104fb99 in _PF_Handler_Public_SetProperty ()
#20 0x0104fb23 in -[NSManagedObject setValue:forKey:] ()
#21 0x02d2470a in -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] ()
#22 0x002e7cc1 in -[RKMappingOperation mapOneToOneRelationshipWithValue:mapping:] at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/ObjectMapping/RKMappingOperation.m:608
#23 0x002eb688 in -[RKMappingOperation applyRelationshipMappings] at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/ObjectMapping/RKMappingOperation.m:801
#24 0x002ed9d0 in -[RKMappingOperation main] at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/ObjectMapping/RKMappingOperation.m:899
#25 0x02d6a829 in -[__NSOperationInternal _start:] ()
#26 0x02ce7558 in -[NSOperation start] ()
#27 0x002dc1b5 in -[RKMapperOperation mapRepresentation:toObject:atKeyPath:usingMapping:metadata:] at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/ObjectMapping/RKMapperOperation.m:242
#28 0x002db7dc in __63-[RKMapperOperation mapRepresentations:atKeyPath:usingMapping:]_block_invoke at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/ObjectMapping/RKMapperOperation.m:214
#29 0x0330c5eb in __NSArrayEnumerate ()
#30 0x0330c196 in -[NSArray enumerateObjectsWithOptions:usingBlock:] ()
#31 0x0330c0a5 in -[NSArray enumerateObjectsUsingBlock:] ()
#32 0x002db48c in -[RKMapperOperation mapRepresentations:atKeyPath:usingMapping:] at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/ObjectMapping/RKMapperOperation.m:211
#33 0x002dd410 in -[RKMapperOperation mapRepresentationOrRepresentations:atKeyPath:usingMapping:] at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/ObjectMapping/RKMapperOperation.m:299
#34 0x002dde72 in -[RKMapperOperation mapSourceRepresentationWithMappingsDictionary:] at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/ObjectMapping/RKMapperOperation.m:347
#35 0x002de83b in -[RKMapperOperation main] at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/ObjectMapping/RKMapperOperation.m:386
#36 0x02d6a829 in -[__NSOperationInternal _start:] ()
#37 0x02ce7558 in -[NSOperation start] ()
#38 0x003385b7 in __73-[RKManagedObjectResponseMapperOperation performMappingWithObject:error:]_block_invoke at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/Network/RKResponseMapperOperation.m:472
#39 0x01055fef in developerSubmittedBlockToNSManagedObjectContextPerform ()
#40 0x036aa4b0 in _dispatch_client_callout ()
#41 0x03697778 in _dispatch_barrier_sync_f_invoke ()
#42 0x03697422 in dispatch_barrier_sync_f ()
#43 0x01055f1f in -[NSManagedObjectContext performBlockAndWait:] ()
#44 0x00336da1 in -[RKManagedObjectResponseMapperOperation performMappingWithObject:error:] at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/Network/RKResponseMapperOperation.m:427
#45 0x00334723 in -[RKResponseMapperOperation main] at /Users/mtford/Playground/xxx/xxx/Pods/RestKit/Code/Network/RKResponseMapperOperation.m:337
#46 0x02d6a829 in -[__NSOperationInternal _start:] ()
#47 0x02ce7558 in -[NSOperation start] ()
#48 0x02d6caf4 in __NSOQSchedule_f ()
#49 0x036aa4b0 in _dispatch_client_callout ()
#50 0x0369807f in _dispatch_queue_drain ()
#51 0x03697e7a in _dispatch_queue_invoke ()
#52 0x03698e1f in _dispatch_root_queue_drain ()
#53 0x03699137 in _dispatch_worker_thread2 ()
#54 0x039c2e72 in _pthread_wqthread ()
And here is the stack trace from the main thread where the bad access occur:
#0 0x01005502 in _nameForEntityDescription () // Bad access here
#1 0x010054c7 in -[NSSQLCore entityForFetchRequest:] ()
#2 0x01005595 in -[NSSQLAdapter _newSelectStatementWithFetchRequest:ignoreInheritance:] ()
#3 0x010604a4 in -[NSSQLCore newFetchedPKsForSourceID:andRelationship:] ()
#4 0x0105f7b6 in -[NSSQLCore newValueForRelationship:forObjectWithID:withContext:error:] ()
#5 0x0105f44e in -[NSPersistentStoreCoordinator(_NSInternalMethods) newValueForRelationship:forObjectWithID:withContext:error:] ()
#6 0x010d4e90 in __107-[NSManagedObjectContext(_NestedContextSupport) newValueForRelationship:forObjectWithID:withContext:error:]_block_invoke ()
#7 0x01056321 in internalBlockToNSManagedObjectContextPerform ()
#8 0x036aa4b0 in _dispatch_client_callout ()
#9 0x03697778 in _dispatch_barrier_sync_f_invoke ()
#10 0x03697422 in dispatch_barrier_sync_f ()
#11 0x010562a2 in _perform ()
#12 0x01056ebe in -[NSManagedObjectContext(_NestedContextSupport) newValueForRelationship:forObjectWithID:withContext:error:] ()
#13 0x010d4e90 in __107-[NSManagedObjectContext(_NestedContextSupport) newValueForRelationship:forObjectWithID:withContext:error:]_block_invoke ()
#14 0x01056321 in internalBlockToNSManagedObjectContextPerform ()
#15 0x03699440 in _dispatch_barrier_sync_f_slow_invoke ()
#16 0x036aa4b0 in _dispatch_client_callout ()
#17 0x0369875e in _dispatch_main_queue_callback_4CF ()
#18 0x03377a5e in __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ ()
#19 0x032b86bb in __CFRunLoopRun ()
#20 0x032b7ac3 in CFRunLoopRunSpecific ()
#21 0x032b78db in CFRunLoopRunInMode ()
#22 0x0413b9e2 in GSEventRunModal ()
#23 0x0413b809 in GSEventRun ()
#24 0x01b68d3b in UIApplicationMain ()
#25 0x0002a76d in main at /Users/mtford/Playground/xxx/xxx/xxx/main.m:18
I realise I haven't provided much context in terms of mappings+code etc, but does anyone have any ideas based on the symbols involved in the stack trace what the issue may be here?
Cheers.
So, it turns out i'd accidentally ticked transient on one of my relationships at some point... what a nightmare :)

Resources