How to defect crash on MacOS? Is there call stack?
-
I run my application with running mode, it reported crash.
But there is no future information to defect?
Is there some information stored the call stack information.When I used debug mode, the application seems running ok.
Here is some output information:
debug [2021-07-02 11:30:01] ../Text2Cap/Schedule/timerutils.cpp:77 HandleTimeout enter timeout processing function.
debug [2021-07-02 11:30:01] ../Text2Cap/Schedule/timerutils.cpp:128 Stop timer(type=1)
11:30:01: The process was ended forcefully.
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. -
I run my application with running mode, it reported crash.
But there is no future information to defect?
Is there some information stored the call stack information.When I used debug mode, the application seems running ok.
Here is some output information:
debug [2021-07-02 11:30:01] ../Text2Cap/Schedule/timerutils.cpp:77 HandleTimeout enter timeout processing function.
debug [2021-07-02 11:30:01] ../Text2Cap/Schedule/timerutils.cpp:128 Stop timer(type=1)
11:30:01: The process was ended forcefully.
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.@angelyouyou
Hi,
I had a similar issue on Linux.
I managed the signals to try to detect my crash.
I stored the output of the handler function in the file.
I enable caching of the signals only when I need it ( it is under define that enables catching)I did this:
In my main.cppint main( ... )
{
....
signal( SIGFPE, handler );
signal( SIGSEGV, handler );
signal( SIGILL, handler );
signal( SIGABRT, handler );
signal( SIGKILL, handler );
signal( SIGSTOP, handler );
signal( SIGSYS, handler );...}
#include "signal.h"
#include "execinfo.h"
void handler(int a)
{
void *array[128];
char **string;
int size, i;switch( a ) { case SIGFPE: case SIGSEGV: case SIGILL: case SIGABRT: case SIGKILL: case SIGSTOP: case SIGSYS: qDebug() << "****** FATAL ERROR: Signal type" << a ; size = backtrace(array, 128); string = backtrace_symbols(array, size); if (string != NULL ) { for ( int i = 0; i < size; i++ ) qDebug() << string[i] ; } abort(); break; default: qDebug() << "Signal" << a << "- FATAL ERROR"; break; }}
-
Use can try this one. It's good for me
https://github.com/asmaloney/asmCrashReport -
Hi,
macOS usually shows you a crash diagnostic when an application crashes.
If you have a crash only in release mode, it's usually related to an uninitialized pointer.
-
Hi,
macOS usually shows you a crash diagnostic when an application crashes.
If you have a crash only in release mode, it's usually related to an uninitialized pointer.
@SGaist If this is the case, run cppcheck. It has the following features:
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 dataActually it is a good habit to run cppcheck regularly on the apps.
Get cppcheck installed on Mac using Brew
Open Terminal using Spotlight search by pressing <command+space> . Type terminal and hit Enter key. Install cppcheck using brew. brew install cppcheck.