9#ifndef WITH_PYTHON_MODULE
15# if defined(__linux__) && defined(__GNUC__)
22# if (defined(__APPLE__) && (defined(__i386__) || defined(__x86_64__)))
24# include <xmmintrin.h>
40# include BLI_SYSTEM_PID_H
60# if defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
64static void sig_handle_fpe(
int )
66 fprintf(stderr,
"debug: SIGFPE trapped\n");
79 printf(
"\nBlender killed\n");
82 printf(
"\nSent an internal break event. Press ^C again to kill Blender\n");
97 printf(
"Writing: %s\n", filepath);
121 "Unable to save '%s': %s , falling back to console\n",
123 errno ? strerror(errno) :
"Unknown error opening file");
132 fputs(
"\n# backtrace\n", fp);
150 signal(signum, SIG_DFL);
152 kill(getpid(), signum);
154 TerminateProcess(GetCurrentProcess(), signum);
160 auto crash_func = [&]() {
169 static std::once_flag crash_func_once;
170 std::call_once(crash_func_once, crash_func);
173extern LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo)
177 if (ExceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_STACK_OVERFLOW) {
179 CHAR modulename[MAX_PATH];
180 LPVOID address = ExceptionInfo->ExceptionRecord->ExceptionAddress;
181 fprintf(stderr,
"Error : EXCEPTION_STACK_OVERFLOW\n");
182 fprintf(stderr,
"Address : 0x%p\n", address);
183 if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, LPCSTR(address), &
mod)) {
184 if (GetModuleFileName(
mod, modulename, MAX_PATH)) {
185 fprintf(stderr,
"Module : %s\n", modulename);
192 auto crash_func = [&]() {
220 static std::once_flag crash_func_once;
221 std::call_once(crash_func_once, crash_func);
224 return EXCEPTION_EXECUTE_HANDLER;
238 SetUnhandledExceptionFilter(windows_exception_handler);
247 SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT | SEM_NOGPFAULTERRORBOX |
248 SEM_NOOPENFILEERRORBOX);
268# if defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
271 signal(SIGFPE, sig_handle_fpe);
273# if defined(__linux__) && defined(__GNUC__) && defined(HAVE_FEENABLEEXCEPT)
274 feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
276# if defined(OSX_SSE_FPE)
279 _MM_SET_EXCEPTION_MASK(_MM_MASK_MASK &
280 ~(_MM_MASK_OVERFLOW | _MM_MASK_INVALID | _MM_MASK_DIV_ZERO));
282# if defined(_WIN32) && defined(_MSC_VER)
284 _controlfp_s(
nullptr, 0, _MCW_EM);
286 _controlfp_s(
nullptr, _EM_DENORMAL | _EM_UNDERFLOW | _EM_INEXACT, _MCW_EM);
File and directory operations.
#define SNPRINTF(dst, format,...)
Compatibility-like things for windows.
#define BLEND_VERSION_ARG
#define BLEND_VERSION_FMT
VecBase< float, D > constexpr mod(VecOp< float, D >, VecOp< float, D >) RET
constexpr toml::spec version
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void BKE_tempdir_session_purge()
void BLI_windows_exception_print_message(const void *os_info)
static void crashlog_file_generate(const char *filepath, const void *os_info)
void BPY_python_backtrace(FILE *fp)
FILE * BLI_fopen(const char *filepath, const char *mode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void main_signal_setup(void)
void BLI_system_backtrace_with_os_info(FILE *fp, const void *os_info)
const char * GPU_platform_gpu_name()
ApplicationState app_state
void main_signal_setup_background(void)
static void sig_handle_blender_esc(int sig)
void BLI_windows_exception_show_dialog(const char *filepath_crashlog, const char *filepath_relaunch, const char *gpu_name, const char *build_version)
void main_signal_setup_fpe(void)
static void sig_handle_abort(int)
static void sig_cleanup_and_terminate(int signum)
const char * BKE_blender_version_string()
bool BKE_report_write_file_fp(FILE *fp, ReportList *reports, const char *header)
static void sig_handle_crash_fn(int signum)
void BKE_blender_globals_crash_path_get(char *filepath)
struct blender::ApplicationState::@015013240256342036154333030232065173037361052222 signal