[boost-python]Python callback called from C++ thread is crashing - boost-python

I have a C++ class to which a python class object is passed as an argument.
My c++ code is calling a python function using the stored python object of that class. The python function returns a python dictionary to my C++ function. C++ function further extract values from that python dictionary for further use.
A code snippet is like the below:
C++ Code snippet:
enter code here
class Wrapper
{
private:
boost::python::object pyObj;
public:
Wrapper(boost::python::object pyObj):pyObj(pyObj)
{
}
~Wrapper()
{
}
// Executed in thread and calls python callback
void getPythonDict()
{
PyGILState_STATE state = PyGILState_Ensure();
boost::python::object pathInfoDict = this->pyObj.attr("getPathDict")(jobid, (uint_t)iostatus);
bool_t status = boost::python::extract<bool_t>(pathInfoDict["status"]);
PyGILState_Release(state);
}
};
class Core
{
public:
Core(){}
~Core(){}
void callCPlusPlusFunction(boost::python::object &pyObj)
{
Wrapper *ptr = new Wrapper(pyObj);
// launch the getPythonDict function in thread and return back to python function
// boost::thread is used for launching thread
}
};
Python Code snippet:
class PyCallback:
def __init__(self):
pass
def getPathDict(self, jobid, iostatus):
pyDict = {}
pyDict ['status'] = True
return pyDict
from libCore import Core <------C++ library exposed as python module
class PyManager:
def __init__(self):
self.pyCallback = PyCallback()
self.cObj = Core() <---------------Object of C++ "class Core"
def gateWayToCPlusPlusCall(self):
self.cObj.callCPlusPlusFunction(self.pyCallback)
I am using boost::python::object in C++ to store the python object.
After my c++ method calls the python function, the python callback is crashing sometimes.
Below is the analysis of the core file.
<enter code here>
#0 0x0000003e52a80036 in PyObject_Malloc () from /usr/lib64/libpython2.6.so.1.0
#1 0x0000003e52a87a4a in PyString_FromStringAndSize () from /usr/lib64/libpython2.6.so.1.0
#2 0x0000003e52aee0e8 in ?? () from /usr/lib64/libpython2.6.so.1.0
#3 0x0000003e52aee613 in ?? () from /usr/lib64/libpython2.6.so.1.0
#4 0x0000003e52aee722 in ?? () from /usr/lib64/libpython2.6.so.1.0
#5 0x0000003e52aeeaff in Py_BuildValue () from /usr/lib64/libpython2.6.so.1.0
#6 0x0000003e52ae6a51 in ?? () from /usr/lib64/libpython2.6.so.1.0
#7 0x0000003e52ad5916 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#8 0x0000003e52ad6b8f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#9 0x0000003e52ad6b8f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#10 0x0000003e52ad7657 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0
#11 0x0000003e52ad5aa4 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#12 0x0000003e52ad7657 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0
#13 0x0000003e52ad5aa4 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#14 0x0000003e52ad6b8f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#15 0x0000003e52ad6b8f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#16 0x0000003e52ad6b8f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#17 0x0000003e52ad7657 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0
#18 0x0000003e52ad5aa4 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#19 0x0000003e52ad7657 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0
#20 0x0000003e52ad5aa4 in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#21 0x0000003e52ad6b8f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#22 0x0000003e52ad6b8f in PyEval_EvalFrameEx () from /usr/lib64/libpython2.6.so.1.0
#23 0x0000003e52ad7657 in PyEval_EvalCodeEx () from /usr/lib64/libpython2.6.so.1.0
#24 0x0000003e52a6acb0 in ?? () from /usr/lib64/libpython2.6.so.1.0
#25 0x0000003e52a43c63 in PyObject_Call () from /usr/lib64/libpython2.6.so.1.0
#26 0x0000003e52a566af in ?? () from /usr/lib64/libpython2.6.so.1.0
#27 0x0000003e52a43c63 in PyObject_Call () from /usr/lib64/libpython2.6.so.1.0
#28 0x0000003e52acfc93 in PyEval_CallObjectWithKeywords () from /usr/lib64/libpython2.6.so.1.0
#29 0x0000003e52aee98a in PyEval_CallFunction () from /usr/lib64/libpython2.6.so.1.0
#30 0x00007f2a84665123 in boost::python::call<boost::python::api::object, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int> (callable=0x24c55a0, a0=<value optimized out>, a1=<value optimized out>)
at /usr/include/boost141/boost/python/call.hpp:66
#31 0x00007f2a84663885 in operator()<ddsCore::jobid_t, ddsCore::uint_t> (this=0x7f2a5049c2a0, pathInfo=..., jobid=...,
iostatus=ddsCore::IO_STATE_SUCCESS) at /usr/include/boost141/boost/python/object_call.hpp:19
#32 ddsCore::multiPath::PathManagerWrapper::getPathInformation (this=0x7f2a5049c2a0, pathInfo=..., jobid=...,
iostatus=ddsCore::IO_STATE_SUCCESS) at src/ddsCore/src/pathManagerWrapper.cpp:21
#33 0x00007f2a8465e6f9 in ddsCore::multiPath::PathFailoverHandler::pathFailoverSubroutine (this=0x7f2a506474b0, pathInfo=..., jobid=...,
iostatus=ddsCore::IO_STATE_SUCCESS) at src/ddsCore/src/pathFailoverInterface.cpp:50
#34 0x00007f2a8465fca7 in ddsCore::multiPath::PathFailoverManager::executePathFailoverHandler (this=0x7f2a5048f260)
at src/ddsCore/src/pathFailoverManager.cpp:86
#35 0x00007f2a84624d93 in ddsCore::ioLayerUnit::AsynchronousReaderInterface::requestResubmitter (this=0x7f2a5043e8a0)
at src/ddsCore/src/ioWorkers.cpp:524
#36 0x00007f2a8466259a in operator() (this=<value optimized out>) at /usr/include/boost141/boost/function/function_template.hpp:1013
#37 boost::detail::thread_data<boost::function<void()> >::run(void) (this=<value optimized out>)
at /usr/include/boost141/boost/thread/detail/thread.hpp:56
#38 0x00007f2a83e55d10 in thread_proxy () from /usr/lib64/libboost_thread- mt.so.1.41.0
#39 0x0000003e51a079d1 in start_thread () from /lib64/libpthread.so.0
#40 0x0000003e512e88fd in clone () from /lib64/libc.so.6
(gdb) frame 0
#0 PyObject_Malloc (nbytes=42) at Objects/obmalloc.c:780
780 if ((pool->freeblock = *(block **)bp) != NULL) {
(gdb) l
775 * Pick up the head block of its free list.
776 */
777 ++pool->ref.count;
778 bp = pool->freeblock;
779 assert(bp != NULL);
780 if ((pool->freeblock = *(block **)bp) != NULL) { <------- crash happened at this point
781 UNLOCK();
782 return (void *)bp;
783 }
784 /*
(gdb) print pool
$3 = (poolp) 0x7f2a58121000
(gdb) print pool->freeblock
$4 = (block *) 0x0
$4 = (block *) 0x0
(gdb) print pool->ref
$5 = {_padding = 0x54 <Address 0x54 out of bounds>, count = 84}
(gdb) print pool->ref.count
$6 = 84
(gdb) print pool->freeblock
$7 = (block *) 0x0 <----------------- Why this pointer is NULL, this is suspicious ????
(gdb) print *pool
$8 = {ref = {_padding = 0x54 <Address 0x54 out of bounds>, count = 84}, freeblock = 0x0, nextpool = 0x7f2a54031000, prevpool =
0x7f2a54031000, arenaindex = 18, szidx = 5, nextoffset = 4080, maxnextoffset = 4048}
Since the python callback is called from a non-python thread so i have ensured PyGILState_STATE as well.
Can any one please help me in this issue !!!!

Related

How to fix MySQL Workbench 8 crashing on Ubuntu 18.10

Recently I started experiencing issues with MySQL Workbench 8 in which actions cause it to crash after the initial load. Initial load works fine and I configure a connection. I then close workbench, re-open, and try to connect and it crashes. At this point I can also open it for a few seconds (without doing anything) and it will crash.
A few observations:
This doesn't seem to happen if it loads without any connections.
This happens consistently after I load it a second time.
Even if ~./mysql is deleted (and therefore any connections), it will still crash, even on trying to hit "Help" or "Add Connection"
Versions:
Pop! OS 18.10
MySQL Workbench 8.0.15
I've tried:
installing from MySQL site with .deb
installing from apt
uninstalling and purging all references to MySQL
installing previous versions of workbench
This is the output of gdb
<pre>(mysql-workbench-bin:3163): Gtk-<font color="#FFCE51"><b>WARNING</b></font> **: <font color="#3465A4">13:50:01.393</font>: drawing failure for widget &apos;gtkmm__GtkEntry&apos;: out of memory
(mysql-workbench-bin:3163): Gtk-<font color="#FFCE51"><b>WARNING</b></font> **: <font color="#3465A4">13:50:01.393</font>: drawing failure for widget &apos;gtkmm__GtkBox&apos;: out of memory
(mysql-workbench-bin:3163): Gtk-<font color="#FFCE51"><b>WARNING</b></font> **: <font color="#3465A4">13:50:01.393</font>: drawing failure for widget &apos;gtkmm__GtkFixed&apos;: out of memory
(mysql-workbench-bin:3163): glibmm-<font color="#F15D22"><b>ERROR</b></font> **: <font color="#3465A4">13:50:01.393</font>:
unhandled exception (type std::exception) in signal handler:
what: std::bad_alloc
Thread 1 "mysql-workbench" received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff61d59f5 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
(gdb) bt
#0 0x00007ffff61d59f5 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#1 0x00007ffff61d6a9d in g_log_default_handler () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff61d6cef in g_logv () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff61d6edf in g_log () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007ffff536ce2f in Glib::exception_handlers_invoke() () from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
#5 0x00007ffff5deca71 in ?? () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#6 0x00007ffff68dbf9b in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#7 0x00007ffff688767f in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#8 0x00007ffff62afb6d in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#9 0x00007ffff62c23ee in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x00007ffff62caf43 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#11 0x00007ffff62cbecf in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#12 0x00007ffff6894142 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#13 0x00007ffff667e9fa in gtk_container_propagate_draw () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#14 0x00007ffff667eacd in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#15 0x00007ffff6630d94 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#16 0x00007ffff6683b5d in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#17 0x00007ffff6688832 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#18 0x00007ffff6633621 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#19 0x00007ffff5dec68e in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#20 0x00007ffff68dbf9b in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#21 0x00007ffff688767f in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#22 0x00007ffff62afa81 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x00007ffff62c2124 in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x00007ffff62caf43 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007ffff62cbecf in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x00007ffff6894142 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#27 0x00007ffff667e9fa in gtk_container_propagate_draw () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#28 0x00007ffff667eacd in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#29 0x00007ffff679d9f6 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#30 0x00007ffff6885180 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#31 0x00007ffff6683b5d in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#32 0x00007ffff6688832 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#33 0x00007ffff6885e8d in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#34 0x00007ffff6893fe4 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#35 0x00007ffff667e9fa in gtk_container_propagate_draw () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#36 0x00007ffff667eacd in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#37 0x00007ffff67cba6b in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#38 0x00007ffff6683b5d in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#39 0x00007ffff6688832 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#40 0x00007ffff67c9dc1 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#41 0x00007ffff5dec68e in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#42 0x00007ffff6893fe4 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#43 0x00007ffff667e9fa in gtk_container_propagate_draw () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#44 0x00007ffff667eacd in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#45 0x00007ffff6630d94 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
--Type <RET> for more, q to quit, c to continue without paging--c
#46 0x00007ffff6683b5d in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#47 0x00007ffff6688832 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#48 0x00007ffff6633621 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#49 0x00007ffff5dec68e in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#50 0x00007ffff68dbf9b in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#51 0x00007ffff688767f in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#52 0x00007ffff62afb6d in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#53 0x00007ffff62c2124 in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#54 0x00007ffff62caf43 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#55 0x00007ffff62cbecf in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#56 0x00007ffff6894142 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#57 0x00007ffff667e9fa in gtk_container_propagate_draw () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#58 0x00007ffff667eacd in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#59 0x00007ffff6630d94 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#60 0x00007ffff6683b5d in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#61 0x00007ffff6688832 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#62 0x00007ffff6633621 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#63 0x00007ffff5dec68e in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#64 0x00007ffff6893fe4 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#65 0x00007ffff667e9fa in gtk_container_propagate_draw () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#66 0x00007ffff676db7a in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#67 0x00007ffff6683b5d in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#68 0x00007ffff6688832 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#69 0x00007ffff6634d9c in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#70 0x00007ffff6688832 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#71 0x00007ffff677039c in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#72 0x00007ffff5de126c in Gtk::Widget::on_draw(Cairo::RefPtr<Cairo::Context> const&) () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#73 0x00007ffff5dec72f in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#74 0x00007ffff6893fe4 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#75 0x00007ffff667e9fa in gtk_container_propagate_draw () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#76 0x00007ffff667eacd in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#77 0x00007ffff6630d94 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#78 0x00007ffff6683b5d in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#79 0x00007ffff6688832 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#80 0x00007ffff6633621 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#81 0x00007ffff5de126c in Gtk::Widget::on_draw(Cairo::RefPtr<Cairo::Context> const&) () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#82 0x00007ffff5dec72f in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#83 0x00007ffff6893fe4 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#84 0x00007ffff667e9fa in gtk_container_propagate_draw () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#85 0x00007ffff667eacd in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#86 0x00007ffff68a27b2 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#87 0x00007ffff5de126c in Gtk::Widget::on_draw(Cairo::RefPtr<Cairo::Context> const&) () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#88 0x00007ffff5dec72f in Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#89 0x00007ffff6893fe4 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#90 0x00007ffff689d008 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#91 0x00007ffff674bc09 in gtk_main_do_event () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#92 0x00007ffff644b445 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#93 0x00007ffff645b996 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#94 0x00007ffff645cb06 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#95 0x00007ffff645ccc4 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#96 0x00007ffff62afb6d in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#97 0x00007ffff62c28f3 in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#98 0x00007ffff62cb882 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#99 0x00007ffff62cbecf in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#100 0x00007ffff6454a6d in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#101 0x00007ffff643fbf8 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#102 0x00007ffff61d0573 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#103 0x00007ffff61cfae8 in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#104 0x00007ffff61cfed8 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#105 0x00007ffff61d01d2 in g_main_loop_run () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#106 0x00007ffff4ff1e9c in runtime::loop::run() () from /usr/lib/mysql-workbench/liblinux_utilities.so.8.0.15
#107 0x00007ffff51cef35 in mforms::gtk::UtilitiesImpl::run_cancelable_wait_message(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void ()> const&, std::function<bool ()> const&) () from /usr/lib/mysql-workbench/libmforms.so.8.0.15
#108 0x00007ffff52181e4 in mforms::Utilities::run_cancelable_task(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<void* ()> const&, std::function<bool ()> const&, void*&) () from /usr/lib/mysql-workbench/libmforms.so.8.0.15
#109 0x00007ffff78747f5 in wb::WBContextSQLIDE::create_connected_editor(grt::Ref<db_mgmt_Connection> const&) () from /usr/lib/mysql-workbench/libwbprivate.so.8.0.15
#110 0x00007ffff79d1e39 in wb::WBContext::add_new_query_window(grt::Ref<db_mgmt_Connection> const&, bool) () from /usr/lib/mysql-workbench/libwbprivate.so.8.0.15
#111 0x00007ffff79ab549 in wb::WBContextUI::handle_home_action(mforms::HomeScreenAction, base::any const&) () from /usr/lib/mysql-workbench/libwbprivate.so.8.0.15
#112 0x00007ffff524a8d7 in mforms::HomeScreen::trigger_callback(mforms::HomeScreenAction, base::any const&) () from /usr/lib/mysql-workbench/libmforms.so.8.0.15
#113 0x00007ffff5257bc1 in mforms::ConnectionEntry::activate() () from /usr/lib/mysql-workbench/libmforms.so.8.0.15
#114 0x00007ffff5251462 in mforms::ConnectionsSection::mouse_click(mforms::MouseButton, int, int) () from /usr/lib/mysql-workbench/libmforms.so.8.0.15
#115 0x00007ffff518ac49 in mforms::gtk::DrawBoxImpl::mouse_button_event(_GdkEventButton*, mforms::DrawBox*) () from /usr/lib/mysql-workbench/libmforms.so.8.0.15
#116 0x00007ffff5de3d6b in ?? () from /usr/lib/x86_64-linux-gnu/libgtkmm-3.0.so.1
#117 0x00007ffff68dbf9b in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#118 0x00007ffff62afb6d in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#119 0x00007ffff62c23ee in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#120 0x00007ffff62caf43 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#121 0x00007ffff62cbecf in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#122 0x00007ffff6889b74 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#123 0x00007ffff6749c56 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#124 0x00007ffff674bd73 in gtk_main_do_event () from /usr/lib/x86_64-linux-gnu/libgtk-3.so.0
#125 0x00007ffff644b445 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#126 0x00007ffff647c012 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
#127 0x00007ffff61cfc3e in g_main_context_dispatch () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#128 0x00007ffff61cfed8 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#129 0x00007ffff61cff6c in g_main_context_iteration () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#130 0x00007ffff288213d in g_application_run () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#131 0x00005555555de346 in main ()
</pre>
It turns out that while my issue was very similar, once I installed MySQL 8, I had to run sudo mysql_upgrade to make sure everything was upgraded. After that and after re-creating the connection, MySQL Workbench worked for me and didn't crash.
I'm not sure if it is the same issue you had or not or even how much it has to do with anything other than dumb luck. BUT...I removed all of the files in ~./mysql/workbench/cache/ but still failed to stay open. And then removed connection_id from ~/.mysql/workbench/sql_history/.
I was able to load after doing this.

Centos 7 OpenCL Segfaul

I am trying to install the AMD opencl runtime and libraries on a Centos 7, 64 bit. The machine is in a server room, and i am sshing in. I had to install the xserver before the rpm would would. I have the same problem when i use the guide to install via an rpm which is to avoid the xserver being present.
I got to the point where i can compile the opencl application which generates a binary without errors. However, when i try and run it it segfaults. I get the same problem with the clinfo binary which ships with the AMD sdk. I include what i can get from gdb from clinfo below:
Starting program: /opt/AMDAPPSDK-3.0/bin/x86_64/clinfo
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff0d0070c in llvm::cl::ParseCommandLineOptions(int, char const* const*, char const*) () from /usr/lib64/libamdocl12cl64.so
Missing separate debuginfos, use: debuginfo-install glibc-2.17-106.el7_2.8.x86_64 libX11-1.6.3-2.el7.x86_64 libXau-1.0.8-2.1.el7.x86_64 libXext-1.3.3-3.el7.x86_64 libXinerama-1.1.3-2.1.el7.x86_64 libgcc-4.8.5-4.el7.x86_64 libstdc++-4.8.5-4.el7.x86_64 libxcb-1.11-4.el7.x86_64 mesa-libGL-10.6.5-3.20150824.el7.x86_64
(gdb) bt
#0 0x00007ffff0d0070c in llvm::cl::ParseCommandLineOptions(int, char const* const*, char const*) () from /usr/lib64/libamdocl12cl64.so
#1 0x00007fffefdf7a8b in OCLLinkPhase(_acl_loader_data_0_8**, _acl_llvm_module_0_8**, unsigned int, _acl_llvm_module_0_8***, _acl_llvm_context_0_8**, _acl_error_enum_0_8*)
() from /usr/lib64/libamdocl12cl64.so
#2 0x00007fffefdf47bf in if_aclCompile(_acl_compiler_rec_0_8_1*, _acl_bif_rec_0_8_1*, char const*, _acl_type_enum_0_8, _acl_type_enum_0_8, void (*)(char const*, unsigned long)) () from /usr/lib64/libamdocl12cl64.so
#3 0x00007ffff3f2c789 in aclCompile () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#4 0x00007ffff362ef95 in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#5 0x00007ffff36532ac in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#6 0x00007ffff35fceff in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#7 0x00007ffff360cff0 in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#8 0x00007ffff35f9d1b in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#9 0x00007ffff363793c in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#10 0x00007ffff36396a8 in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#11 0x00007ffff3639846 in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#12 0x00007ffff35f7dd0 in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#13 0x00007ffff3611ce7 in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#14 0x00007ffff35e29e3 in clIcdGetPlatformIDsKHR () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so
#15 0x00007ffff74c86ee in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so.1
#16 0x00007ffff74ca537 in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so.1
#17 0x00007ffff70a0bb0 in pthread_once () from /usr/lib64/libpthread.so.0
#18 0x00007ffff74ca5c7 in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so.1
#19 0x00007ffff74c8685 in ?? () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so.1
#20 0x00007ffff74c8c81 in clGetPlatformIDs () from /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so.1
#21 0x000000000040f4c7 in ?? ()
#22 0x0000000000407bb2 in ?? ()
#23 0x00007ffff6cf3b15 in __libc_start_main () from /usr/lib64/libc.so.6
#24 0x000000000040e5f1 in ?? ()
Any and all help appreciated!

Getting SEGV / core dumped when running Perl debugger

When I try to run the Perl debugger I'm getting a SEGV error:
Signal SEGV at /opt/csw/lib/perl/csw/Term/ReadLine/Gnu.pm line 240.
Term::ReadLine::Gnu::new("Term::ReadLine", "perldb", GLOB(0x81c1168), GLOB(0x81873a0)) called at /opt/csw/share/perl/5.10.1/perl5db.pl line 6073
DB::setterm called at /opt/csw/share/perl/5.10.1/perl5db.pl line 2237
DB::DB called at -e line 1
Abort (core dumped)
The errors takes place with any Perl code and I think is due to the debugger using Term::ReadLine::Gnu::new.
Using gdb to get the stack trace, I get the following:
Core was generated by `/opt/csw/bin/perl -de$a++'.
Program terminated with signal 6, Aborted.
#0 0xfeaabbc5 in kill () from /lib/libc.so.1
(gdb) bt
#0 0xfeaabbc5 in kill () from /lib/libc.so.1
#1 0xfef0c748 in Perl_apply () from /opt/csw/lib/i386/libperl.so
#2 0xfeeff1ee in Perl_pp_chown () from /opt/csw/lib/i386/libperl.so
#3 0xfeeb6721 in Perl_runops_standard () from /opt/csw/lib/i386/libperl.so
#4 0xfee570da in Perl_call_sv () from /opt/csw/lib/i386/libperl.so
#5 0xfeeac2c8 in Perl_sighandler () from /opt/csw/lib/i386/libperl.so
#6 0xfeea8173 in Perl_csighandler () from /opt/csw/lib/i386/libperl.so
#7 0xfeaa8ecf in __sighndlr () from /lib/libc.so.1
#8 0xfea9eb8f in call_user_handler () from /lib/libc.so.1
#9 <signal handler called>
#10 0xfe82b828 in baudrate () from /lib/libcurses.so.1
#11 0xfe7ede48 in _nc_setupterm () from /opt/csw/lib/libncurses.so.5
#12 0xfe7ee010 in tgetent () from /opt/csw/lib/libncurses.so.5
#13 0xfe88659a in _rl_init_terminal_io () from /opt/csw/lib/i386/libreadline.so.6
#14 0xfe86eb32 in readline_initialize_everything () from /opt/csw/lib/i386/libreadline.so.6
#15 0xfe86ea22 in rl_initialize () from /opt/csw/lib/i386/libreadline.so.6
#16 0xfe8d6e1d in XS_Term__ReadLine__Gnu__XS_rl_initialize () from /opt/csw/lib/perl/csw/auto/Term/ReadLine/Gnu/Gnu.so
#17 0xfeebe7ee in Perl_pp_entersub () from /opt/csw/lib/i386/libperl.so
#18 0xfeeb6721 in Perl_runops_standard () from /opt/csw/lib/i386/libperl.so
#19 0xfee568f1 in S_run_body () from /opt/csw/lib/i386/libperl.so
#20 0xfee56813 in perl_run () from /opt/csw/lib/i386/libperl.so
#21 0x08050b48 in main ()
I would greatly appreciate any help/clues.
Thanks!

Debug Perl Segmentation Fault

I'm using AcePerl to download data from the wormbase.org database.
When I download certain database objects I get (after a certain number of objects) a segmentation fault. This behaviour is reproducible.
I had a look at the core dump and where prints a huge stack of function calls:
#0 0xb763c0ac in ?? () from /lib/i386-linux-gnu/libc.so.6
#1 0xb763eddc in malloc () from /lib/i386-linux-gnu/libc.so.6
#2 0x080c07ca in Perl_safesysmalloc ()
#3 0x080f3a02 in Perl_sv_grow ()
#4 0x080ebe38 in Perl_sv_setsv_flags ()
#5 0x080ecb76 in Perl_newSVsv ()
#6 0x0811516f in Perl_save_item ()
#7 0x080c7dd8 in Perl_get_db_sub ()
#8 0x080e7a4c in Perl_pp_entersub ()
#9 0x08075570 in Perl_call_sv ()
#10 0x080edd25 in Perl_sv_clear ()
#11 0x080ee3eb in Perl_sv_free2 ()
#12 0x080d79ec in Perl_hv_free_ent ()
#13 0x080d7c8c in ?? ()
#14 0x080db6ff in Perl_hv_undef_flags ()
#15 0x080edf72 in Perl_sv_clear ()
#16 0x080ee3eb in Perl_sv_free2 ()
#17 0x080d79ec in Perl_hv_free_ent ()
#18 0x080d7c8c in ?? ()
#19 0x080db6ff in Perl_hv_undef_flags ()
#20 0x080edf72 in Perl_sv_clear ()
#21 0x080ee3eb in Perl_sv_free2 ()
#22 0x080d79ec in Perl_hv_free_ent ()
#23 0x080d7c8c in ?? ()
#24 0x080db6ff in Perl_hv_undef_flags ()
#25 0x080edf72 in Perl_sv_clear ()
#26 0x080ee3eb in Perl_sv_free2 ()
#27 0x080d79ec in Perl_hv_free_ent ()
#28 0x080d7c8c in ?? ()
#29 0x080db6ff in Perl_hv_undef_flags ()
#30 0x080edf72 in Perl_sv_clear ()
#31 0x080ee3eb in Perl_sv_free2 ()
#32 0x080d79ec in Perl_hv_free_ent ()
#33 0x080d7c8c in ?? ()
#34 0x080db6ff in Perl_hv_undef_flags ()
#35 0x080edf72 in Perl_sv_clear ()
#36 0x080ee3eb in Perl_sv_free2 ()
#37 0x080d79ec in Perl_hv_free_ent ()
#38 0x080d7c8c in ?? ()
#39 0x080db6ff in Perl_hv_undef_flags ()
#40 0x080edf72 in Perl_sv_clear ()
#41 0x080ee3eb in Perl_sv_free2 ()
#42 0x080d79ec in Perl_hv_free_ent ()
#43 0x080d7c8c in ?? ()
#44 0x080db6ff in Perl_hv_undef_flags ()
#45 0x080edf72 in Perl_sv_clear ()
#46 0x080ee3eb in Perl_sv_free2 ()
#47 0x080d79ec in Perl_hv_free_ent ()
#48 0x080d7c8c in ?? ()
#49 0x080db6ff in Perl_hv_undef_flags ()
#50 0x080edf72 in Perl_sv_clear ()
#51 0x080ee3eb in Perl_sv_free2 ()
#52 0x080d79ec in Perl_hv_free_ent ()
#53 0x080d7c8c in ?? ()
...
These function calls are repeated thousands of time.
I also called perl -d:Trace myscript.pl > log but the logfile is about 3 GB large.
Is there a more convenient way to debug this script?
EDIT:
My script: http://paste.ubuntu.com/5564630/ .
My schema file: http://paste.ubuntu.com/5564631/ . It determines which data to download.
The seg fault is raised after ~2300 go_terms.
Install Devel::Trace.
Run your perl script with tracing enabled:
perl -d:Trace myscript.pl >trace 2>&1
Tail the file to see which Perl lines are executed leading up to the segmentation fault.

Please help debug a crash on UILabel (evict_glyph_entry_from_cache)

I am facing a weird crash in "UILabel".The crash is initiated from drawRect of UILabel or CCLabelTTF). (I've already spent much time Googling this problem.) What could be causing th following code to crash?
I am using XCode SDK 4.0 and/or 4.1, cocos2d version 0.99.4, 0.99.5
CODE:
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(200,100,185,110)];
[label setTextAlignment:UITextAlignmentLeft];
[label setFont:[UIFont fontWithName:#"Marker Felt" size:14]];
[label setLineBreakMode:UILineBreakModeWordWrap];
[label setAdjustsFontSizeToFitWidth:YES];
[label setNumberOfLines:50];
label.text = message;
[label setBackgroundColor:[UIColor clearColor]];
[label setTextColor:[UIColor colorWithRed:0 green:81.0/255 blue:100.0/255 alpha:1]];
[self addSubview:label];
[label release]; label = nil;
CRASH:
Assertion failed: (cache->size >= g->size), function evict_glyph_entry_from_cache, file Fonts/CGFontCache.c, line 836.
Program received signal: “SIGABRT”.
#0 0x316b698c in __kill ()
#1 0x316b6982 in kill ()
#2 0x316b6974 in raise ()
#3 0x316cb620 in abort ()
#4 0x316b8f16 in __assert_rtn ()
#5 0x30f10d9e in evict_glyph_entry_from_cache ()
#6 0x30ed54e8 in expire_glyphs_nl ()
#7 0x30ed5494 in CGFontCacheUnlock ()
#8 0x30ed5008 in CGGlyphLockUnlock ()
#9 0x31e3a5e4 in ripc_RenderGlyphs ()
#10 0x31e42a66 in ripc_DrawGlyphs ()
#11 0x30ed0714 in CGContextDelegateDrawGlyphs ()
#12 0x30ed06c8 in draw_glyphs ()
#13 0x30ed025a in CGContextShowGlyphsWithAdvances ()
#14 0x311381f0 in WebCore::Font::drawGlyphs ()
#15 0x31137e42 in WebCore::Font::drawGlyphBuffer ()
#16 0x31137c76 in WebCore::Font::drawSimpleText ()
#17 0x31137ad2 in WebCore::Font::drawText ()
#18 0x31137a5e in drawAtPoint ()
#19 0x3117fdd4 in -[NSString(WebStringDrawing) _web_drawInRect:withFont:ellipsis:alignment:lineSpacing:includeEmoji:measureOnly:] ()
#20 0x31180c50 in -[NSString(WebStringDrawing) _web_drawInRect:withFont:ellipsis:alignment:lineSpacing:includeEmoji:] ()
#21 0x325ca46c in -[NSString(UIStringDrawing) drawInRect:withFont:lineBreakMode:alignment:lineSpacing:includeEmoji:] ()
#22 0x325ca40a in -[NSString(UIStringDrawing) drawInRect:withFont:lineBreakMode:alignment:lineSpacing:] ()
#23 0x325cb414 in -[UILabel _drawTextInRect:baselineCalculationOnly:] ()
#24 0x325cadf2 in -[UILabel drawTextInRect:] ()
#25 0x325cadaa in -[UILabel drawRect:] ()
#26 0x325c98e8 in -[UIView(CALayerDelegate) drawLayer:inContext:] ()
#27 0x30c6b308 in -[CALayer drawInContext:] ()
#28 0x30c6b190 in backing_callback ()
#29 0x30c6acb6 in CABackingStoreUpdate ()
#30 0x30c6a47e in -[CALayer _display] ()
#31 0x30c6a1ce in -[CALayer display] ()
#32 0x30c6a14a in CALayerDisplayIfNeeded ()
#33 0x30c6994a in CA::Context::commit_transaction ()
#34 0x30c696a8 in CA::Transaction::commit ()
#35 0x30c6f030 in CA::Transaction::observer_callback ()
#36 0x33519b56 in __CFRunLoopDoObservers ()
#37 0x33560a38 in CFRunLoopRunSpecific ()
#38 0x3356035c in CFRunLoopRunInMode ()
#39 0x30248b32 in GSEventRunModal ()
#40 0x30248bde in GSEventRun ()
#41 0x3259776e in -[UIApplication _run] ()
#42 0x32596472 in UIApplicationMain ()
#43 0x0000288e in main (argc=1, argv=0x2ffff618) at /Users/ahsan/Public/Drop Box/today1/main.m:13
I believe the font name is #"MarkerFelt-Thin". Try that.
Edit: There is also a #"MarkerFelt-Wide".
It is crashing because you need to enter the correct font name, or else UIKit will try to load non-existent fonts. So, you should check your font name. Try using #"MarkerFelt" (no space instead of #"Marker Felt", with the space).
If you are not sure of what the value should be, there are several apps on the app store that can get the list of currently available fonts for you. You can also use this code snippet to log the font names to the console:
// Get all the fonts on the system
NSArray *familyNames = [UIFont familyNames];
for( NSString *familyName in familyNames ){
printf( "Family: %s \n", [familyName UTF8String] );
NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];
for( NSString *fontName in fontNames ){
printf( "\tFont: %s \n", [fontName UTF8String] );
}
}
EDIT:
You can also have a look at this post and see if it helps you.
One thing worth mentioning is that the application does heavy processing
This is also my observation! Heavy load crashes my app. At this moment I believe that this problem is the framework bug and should be reported. https://bugreport.apple.com
My crash comes when updating CCLabelTTF (Cocos2D 0.99.5)
Assertion failed: (cache->size >= g->size), function evict_glyph_entry_from_cache, file Fonts/CGFontCache.c, line 836.
Program received signal: “SIGABRT”.
This is the trace:
#0 0x304a0b2c in __kill ()
#1 0x304a0b20 in kill ()
#2 0x304a0b14 in raise ()
#3 0x304b7e3a in abort ()
#4 0x304a42f2 in __assert_rtn ()
#5 0x30f33648 in evict_glyph_entry_from_cache ()
#6 0x30ee5fc0 in expire_glyphs_nl ()
#7 0x30ee5f50 in CGFontCacheUnlock ()
#8 0x30ee5868 in CGGlyphLockUnlock ()
#9 0x33191ce0 in ripc_RenderGlyphs ()
#10 0x3319c9e0 in ripc_DrawGlyphs ()
#11 0x30edf7b0 in draw_glyphs ()
#12 0x30edf25c in CGContextShowGlyphsWithAdvances ()
#13 0x3109e010 in WebCore::Font::drawGlyphs ()
#14 0x3109dabc in WebCore::Font::drawGlyphBuffer ()
#15 0x3109d76c in WebCore::Font::drawSimpleText ()
#16 0x3109d5c8 in WebCore::Font::drawText ()
#17 0x3109d504 in drawAtPoint ()
#18 0x31101bd4 in -[NSString(WebStringDrawing) _web_drawInRect:withFont:ellipsis:alignment:lineSpacing:includeEmoji:measureOnly:] ()
#19 0x31103a78 in -[NSString(WebStringDrawing) _web_drawInRect:withFont:ellipsis:alignment:lineSpacing:includeEmoji:] ()
#20 0x331fcb60 in -[NSString(UIStringDrawing) drawInRect:withFont:lineBreakMode:alignment:lineSpacing:includeEmoji:] ()
#21 0x332f5184 in -[NSString(UIStringDrawing) drawInRect:withFont:lineBreakMode:alignment:] ()
#22 0x002f04a4 in -[CCTexture2D(Text) initWithString:dimensions:alignment:font:] (self=0x64e240, _cmd=0x455973, string=0x677040, dimensions={width = 28, height = 24}, alignment=UITextAlignmentCenter, uifont=0x649690) at /Users/SG/Documents/code/AlgWin/libs/cocos2d/CCTexture2D.m:405
#23 0x002f07a4 in -[CCTexture2D(Text) initWithString:fontName:fontSize:] (self=0x64e240, _cmd=0x44d3f4, string=0x677040, name=0x668990, size=20) at /Users/SG/Documents/code/AlgWin/libs/cocos2d/CCTexture2D.m:505
#24 0x002a8988 in -[CCLabelTTF setString:] (self=0x649490, _cmd=0x33f490cc, str=0x677040) at /Users/SG/Documents/code/AlgWin/libs/cocos2d/CCLabelTTF.m:91
Observe that 22 lines are identical to yours.
I will try to come with the code to reproduce the crash. Maybe just an infinite loop will be enough.