<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to defect crash on MacOS? Is there call stack?]]></title><description><![CDATA[<p dir="auto">I run my application with running mode, it reported crash.<br />
But there is no future information to defect?<br />
Is there some information stored the call stack information.</p>
<p dir="auto"><strong>When I used debug mode, the application seems running ok.</strong></p>
<p dir="auto">Here is some output information:</p>
<p dir="auto">debug [2021-07-02 11:30:01] ../Text2Cap/Schedule/timerutils.cpp:77 HandleTimeout enter timeout processing function.</p>
<p dir="auto">debug [2021-07-02 11:30:01] ../Text2Cap/Schedule/timerutils.cpp:128 Stop timer(type=1)<br />
11:30:01: The process was ended forcefully.<br />
11:30:01: /Users/Constantine/Documents/Work/Archive/KM/Code/Text2Cap/build-Text2Cap-Desktop_Qt_6_1_1_clang_64bit-Debug/Text2Cap.app/Contents/MacOS/Text2Cap crashed.</p>
]]></description><link>https://forum.qt.io/topic/128112/how-to-defect-crash-on-macos-is-there-call-stack</link><generator>RSS for Node</generator><lastBuildDate>Tue, 29 Sep 2026 02:59:52 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/128112.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 02 Jul 2021 03:34:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to defect crash on MacOS? Is there call stack? on Fri, 02 Jul 2021 19:18:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sgaist">@<bdi>SGaist</bdi></a> If this is the case, run cppcheck.  It has the following features:</p>
<pre><code>Dead pointers
Division by zero
Integer overflows
Invalid bit shift operands
Invalid conversions
Invalid usage of STL
Memory management
Null pointer dereferences
Out of bounds checking
Uninitialized variables
Writing const data
</code></pre>
<p dir="auto">Actually it is a good habit to run cppcheck regularly on the apps.</p>
<p dir="auto">Get cppcheck installed on Mac using Brew</p>
<pre><code>Open Terminal using Spotlight search by pressing &lt;command+space&gt; . Type terminal and hit Enter key.
Install cppcheck using brew. brew install cppcheck.
</code></pre>
]]></description><link>https://forum.qt.io/post/668649</link><guid isPermaLink="true">https://forum.qt.io/post/668649</guid><dc:creator><![CDATA[JoeCFD]]></dc:creator><pubDate>Fri, 02 Jul 2021 19:18:32 GMT</pubDate></item><item><title><![CDATA[Reply to How to defect crash on MacOS? Is there call stack? on Fri, 02 Jul 2021 18:39:56 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">macOS usually shows you a crash diagnostic when an application crashes.</p>
<p dir="auto">If you have a crash only in release mode, it's usually related to an uninitialized pointer.</p>
]]></description><link>https://forum.qt.io/post/668641</link><guid isPermaLink="true">https://forum.qt.io/post/668641</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 02 Jul 2021 18:39:56 GMT</pubDate></item><item><title><![CDATA[Reply to How to defect crash on MacOS? Is there call stack? on Fri, 02 Jul 2021 09:09:49 GMT]]></title><description><![CDATA[<p dir="auto">Use can try this one. It's good for me<br />
<a href="https://github.com/asmaloney/asmCrashReport" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/asmaloney/asmCrashReport</a></p>
]]></description><link>https://forum.qt.io/post/668526</link><guid isPermaLink="true">https://forum.qt.io/post/668526</guid><dc:creator><![CDATA[anh_ph]]></dc:creator><pubDate>Fri, 02 Jul 2021 09:09:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to defect crash on MacOS? Is there call stack? on Fri, 02 Jul 2021 06:43:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/angelyouyou">@<bdi>angelyouyou</bdi></a><br />
Hi,<br />
I had a similar issue on Linux.<br />
I managed the signals to try to detect my crash.<br />
I stored the output of the handler function in the file.<br />
I enable caching of the signals only when I need it ( it is under define that enables catching)</p>
<p dir="auto">I did this:<br />
In my main.cpp</p>
<p dir="auto">int main( ... )<br />
{<br />
....<br />
signal( SIGFPE, handler );<br />
signal( SIGSEGV, handler );<br />
signal( SIGILL,  handler );<br />
signal( SIGABRT,  handler );<br />
signal( SIGKILL,  handler );<br />
signal( SIGSTOP, handler );<br />
signal( SIGSYS, handler );</p>
<pre><code>...
</code></pre>
<p dir="auto">}</p>
<p dir="auto">#include "signal.h"<br />
#include "execinfo.h"<br />
void handler(int a)<br />
{<br />
void *array[128];<br />
char **string;<br />
int size, i;</p>
<pre><code>switch( a )
{
case SIGFPE:
case SIGSEGV:
case SIGILL:
case SIGABRT:
case SIGKILL:
case SIGSTOP:
case SIGSYS:
    qDebug() &lt;&lt; "****** FATAL ERROR: Signal type" &lt;&lt; a ;
    size = backtrace(array, 128);
    string = backtrace_symbols(array, size);
    if (string != NULL )
    {
        for ( int i = 0; i &lt; size; i++ )
            qDebug() &lt;&lt; string[i] ;
    }
    abort();
    break;

default:
    qDebug() &lt;&lt; "Signal" &lt;&lt; a &lt;&lt; "- FATAL ERROR";
    break;
}
</code></pre>
<p dir="auto">}</p>
]]></description><link>https://forum.qt.io/post/668474</link><guid isPermaLink="true">https://forum.qt.io/post/668474</guid><dc:creator><![CDATA[CP71]]></dc:creator><pubDate>Fri, 02 Jul 2021 06:43:55 GMT</pubDate></item></channel></rss>