+ do not throw exception from inside signal handler to get useful stack trace for segmentation faults
This commit is contained in:
parent
7c789a1bf7
commit
fa4f8b0735
|
@ -939,30 +939,34 @@ void segmentation_fault_handler(int sig)
|
|||
switch (sig) {
|
||||
case SIGSEGV:
|
||||
std::cerr << "Illegal storage access..." << std::endl;
|
||||
#if !defined(_DEBUG)
|
||||
throw Base::Exception("Illegal storage access! Please save your work under a new file name and restart the application!");
|
||||
#endif
|
||||
break;
|
||||
case SIGABRT:
|
||||
std::cerr << "Abnormal program termination..." << std::endl;
|
||||
#if !defined(_DEBUG)
|
||||
throw Base::Exception("Break signal occoured");
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
std::cerr << "Unknown error occurred..." << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void my_terminate_handler()
|
||||
{
|
||||
std::cerr << "Terminating..." << std::endl;
|
||||
|
||||
}
|
||||
|
||||
void unexpection_error_handler()
|
||||
{
|
||||
std::cerr << "Unexpected error occurred..." << std::endl;
|
||||
// try to throw to give the user evantually a change to save
|
||||
#if !defined(_DEBUG)
|
||||
throw Base::Exception("Unexpected error occurred! Please save your work under a new file name and restart the application!");
|
||||
#endif
|
||||
|
||||
terminate();
|
||||
}
|
||||
|
|
|
@ -116,9 +116,9 @@ void PartExport initPart()
|
|||
// if we have mysterious crashes
|
||||
// The argument must be 'Standard_False' to avoid FPE caused by
|
||||
// Python's cmath module.
|
||||
//#if defined(FC_OS_LINUX)
|
||||
#if !defined(_DEBUG)
|
||||
OSD::SetSignal(Standard_False);
|
||||
//#endif
|
||||
#endif
|
||||
|
||||
PyObject* partModule = Py_InitModule3("Part", Part_methods, module_part_doc); /* mod name, table ptr */
|
||||
Base::Console().Log("Loading Part module... done\n");
|
||||
|
|
Loading…
Reference in New Issue
Block a user