https://github.com/labath commented:
Yeah, I'm afraid this isn't the right way to use the MainLoop with signals. `AddPendingCallback` is not signal-safe. You need to actually let the main loop handle the signals (MainLoopPosix::RegisterSignal), as it knows how to do that safely. The function is not available on windows, so you'd need to `#ifdef` it, but that should be fine because the current code is conditionalized anyway. The main exception to that is `SIGINT`, which is currently used on windows, although I'm not sure it actually works (I have a feeling that ^C just terminated my lldb process). For now, I think you could leave that alone, as I think it's not something that's needed for the status line code. The right way to fix that would probably be to add some generic MainLoop function, which maps to SIGINT on posix and `SetConsoleCtrlHandler` on windows. With this setup, I also think the main loop doesn't have to be a global. I think it should be possible to declare it in the main function and then let it clean up after itself before `main` returns. https://github.com/llvm/llvm-project/pull/134956 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits