-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add instruction to suppress SIGUSR1 in Posix with LLDB debugger #1245
Conversation
|
* 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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still does not work for me. I had to set both PASS
and STOP
to false. NOTIFY
had no effect for me
process handle SIGUSR1 -p false -s false
> echo 'process handle SIGUSR1 -n true -p true -s false' > ~/.lldbinit
> lldb build/freertos_posix_example
NAME PASS STOP NOTIFY
=========== ======= ======= =======
SIGUSR1 true false true
(lldb) target create "build/freertos_posix_example"
Current executable set to '/Users/johnboiles/Developer/repos/FreeRTOS/freertos-pr1224/build/freertos_posix_example' (arm64).
(lldb) pro la
Process 92245 launched: '/Users/johnboiles/Developer/repos/FreeRTOS/freertos-pr1224/build/freertos_posix_example' (arm64)
Starting FreeRTOS scheduler
FreeRTOS scheduler started
Task Done, ending scheduler
Process 92245 stopped and restarted: thread 1 received signal: SIGUSR1
Process 92245 exited with status = 30 (0x0000001e) Terminated due to signal 30
(lldb) ^D
> echo 'process handle SIGUSR1 -p false -s false' > ~/.lldbinit
> lldb build/freertos_posix_example
NAME PASS STOP NOTIFY
=========== ======= ======= =======
SIGUSR1 false false not set
(lldb) target create "build/freertos_posix_example"
Current executable set to '/Users/johnboiles/Developer/repos/FreeRTOS/freertos-pr1224/build/freertos_posix_example' (arm64).
(lldb) pro la
Process 24334 launched: '/Users/johnboiles/Developer/repos/FreeRTOS/freertos-pr1224/build/freertos_posix_example' (arm64)
Starting FreeRTOS scheduler
FreeRTOS scheduler started
Task Done, ending scheduler
Process 24334 stopped and restarted: thread 1 received signal: SIGUSR1
FreeRTOS scheduler exited
Process 24334 exited with status = 0 (0x00000000)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, yes. That seems right! Will update that, thank you.
Add instruction to suppress SIGUSR1 in Posix with LLDB debugger (macOS)
Description
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 xPortStartSchedulerThanks to: @johnboiles for pointing it out in 1224
Test Steps
Tested with this example:
Before the fix:
After the fix:
Checklist:
Related Issue
#1224
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.