From 51a1598e4e0281de8b8d54467747af460478eadc Mon Sep 17 00:00:00 2001 From: Bhoomika R S Date: Wed, 12 Feb 2025 14:57:03 +0530 Subject: [PATCH] Add instruction to suppress SIGUSR1 in Posix with LLDB debugger (#1245) While using the macOS default LLDB debugger, a call to vTaskEndScheduler results in an unhandled SIGUSR1 (aka SIGRESUME) when restoring the scheduler thread's signals with pthread_sigmask. This crashes the program. Added instructions in portable/ThirdParty/GCC/Posix/port.c to suppress SIGUSR1 to prevent LLDB debugger interference when exiting xPortStartScheduler Thanks to: @johnboiles for pointing it out in #1224 --- portable/ThirdParty/GCC/Posix/port.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/portable/ThirdParty/GCC/Posix/port.c b/portable/ThirdParty/GCC/Posix/port.c index 5dc7f45f8..ff386ac9f 100644 --- a/portable/ThirdParty/GCC/Posix/port.c +++ b/portable/ThirdParty/GCC/Posix/port.c @@ -48,6 +48,11 @@ * stdio (printf() and friends) should be called from a single task * only or serialized with a FreeRTOS primitive such as a binary * semaphore or mutex. +* +* Note: When using LLDB (the default debugger on macOS) with this port, +* suppress SIGUSR1 to prevent debugger interference. This can be +* done by adding the following line to ~/.lldbinit: +* `process handle SIGUSR1 -n true -p true -s false` *----------------------------------------------------------*/ #ifdef __linux__ #define _GNU_SOURCE