-
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
POSIX Simulator: Clear SIGRESUME (SIGUSR1) when exiting xPortStartScheduler #1224
base: main
Are you sure you want to change the base?
Conversation
I'll undo this change in my local fork of FreeRTOS and see if I still have issues. It might be that this was solved by #1223 |
I still have this issue, though I don't fully understand why |
85c76ce
to
94263d2
Compare
Quality Gate passedIssues Measures |
As you already mentioned, this seems like a hack. Do I need a mac to repro it or is it reproducible on Linux? |
@aggarg I haven't gotten to trying on Linux yet but I can give it a shot. I'm reproducing in macOS with LLDB. I wonder if LLDB could be triggering this strange behavior somehow. |
Can you try running without the debugger? |
I tried to reproduce the issue on Ubuntu 20.04 , but running it with or without the debugger, the issue is not reproduced. Code used
Results after running without debugger
Results after running with debugger
I also tried your change in
Result on Ubuntu:
|
Clear
SIGRESUME
(SIGUSR1
) when exiting xPortStartSchedulerDescription
When attempting to stop the scheduler via
vTaskEndScheduler
, an unhandledSIGUSR1
(akaSIGRESUME
) happens when restoring the scheduler thread's signals withpthread_sigmask
. This crashes the program.I'm not sure why this is happening since
sigwait
is supposed to consume the pending signals. It's possible there's something platform-specific about this. I'm testing on macOS. If the behavior is different on other platforms however, it probably can't hurt to double check. What's particularly interesting is if I modify this code like this:I then get this:
Which means
sigwait
the first time is returning an invalid signal0
but also a return code suggesting that it succeeded! Strange!Test Steps
Testing with this example (full code: freertos-pr1224.zip ):
Without this fix, I see in
lldb
:Checklist: