diff --git a/src/main.cpp b/src/main.cpp index fc4fdc16..87a0f95a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,9 +29,10 @@ using namespace rack; static void fatalSignalHandler(int sig) { // Only catch one signal static bool caught = false; - if (caught) - exit(1); + bool localCaught = caught; caught = true; + if (localCaught) + exit(1); FATAL("Fatal signal %d. Stack trace:\n%s", sig, system::getStackTrace().c_str()); @@ -81,11 +82,14 @@ int main(int argc, char *argv[]) { asset::init(devMode); logger::init(devMode); // We can now install a signal handler and log the output + // Mac has its own decent crash handler +#if defined ARCH_LIN || defined ARCH_WIN signal(SIGABRT, fatalSignalHandler); signal(SIGFPE, fatalSignalHandler); signal(SIGILL, fatalSignalHandler); signal(SIGSEGV, fatalSignalHandler); signal(SIGTERM, fatalSignalHandler); +#endif // Log environment INFO("%s v%s", app::APP_NAME, app::APP_VERSION); diff --git a/src/system.cpp b/src/system.cpp index 33874382..ac17317e 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -123,7 +123,7 @@ std::string getStackTrace() { stackLen = backtrace(stack, stackLen); char **strings = backtrace_symbols(stack, stackLen); - for (int i = 0; i < stackLen; i++) { + for (int i = 1; i < stackLen; i++) { s += string::f("%d: %s\n", stackLen - i - 1, strings[i]); } free(strings); @@ -136,7 +136,7 @@ std::string getStackTrace() { symbol->MaxNameLen = 255; symbol->SizeOfStruct = sizeof(SYMBOL_INFO); - for (int i = 0; i < stackLen; i++) { + for (int i = 1; i < stackLen; i++) { SymFromAddr(process, (DWORD64) stack[i], 0, symbol); s += string::f("%d: %s 0x%0x\n", stackLen - i - 1, symbol->Name, symbol->Address); } diff --git a/src/window.cpp b/src/window.cpp index b0fa7d9c..c92b6f3f 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -200,7 +200,7 @@ Window::Window() { glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); #endif glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_TRUE); - glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); + // glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); // Create window win = glfwCreateWindow(800, 600, "", NULL, NULL); @@ -362,6 +362,7 @@ void Window::run() { glfwGetWindowSize(win, &winWidth, &winHeight); windowRatio = (float)fbWidth / winWidth; + DEBUG("%f %f", pixelRatio, windowRatio); // Resize scene APP->event->rootWidget->box.size = math::Vec(fbWidth, fbHeight).div(pixelRatio);