-
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
[BUG] Deadlock when ending task scheduler on POSIX #1217
Comments
Hello @denravonska, |
Tried it with this script: #!/bin/bash
counter=0
while true; do
echo -n "$counter "
./test.out
let counter++
done Hung on run:
|
Adding the config we're using if it helps. |
I tried to build with the config and got a build error:
I can define the value but wanted to know what do you have for it? |
Can you actually provide the whole application and email me at rawalexe@amazon.com |
That's really weird. We don't define I have sent you a binary built with the following: gcc -static -o freeze -O2 -g -ggdb \
-I ../third-party/freertos/config \
-I $FREERTOS_ROOT/include \
-I $FREERTOS_ROOT/portable/ThirdParty/GCC/Posix \
src/main.cpp \
$FREERTOS_ROOT/*.c \
$FREERTOS_ROOT/portable/ThirdParty/GCC/Posix/port.c \
$FREERTOS_ROOT/portable/ThirdParty/GCC/Posix/utils/wait_for_event.c \
$FREERTOS_ROOT/portable/MemMang/heap_4.c where |
I did some more testing with the config from #include <FreeRTOS.h>
#include <task.h>
#include <stdio.h>
void vApplicationStackOverflowHook( TaskHandle_t xTask, char *pcTaskName)
{
printf("OVERFLOW!\n");
}
void Task(void *)
{
vTaskEndScheduler();
vTaskDelete(nullptr);
}
int main(int argc, char ** argv)
{
xTaskCreate(Task, "MainTask", 256, nullptr, 4, nullptr);
vTaskStartScheduler();
printf("Done\n");
return 0;
} Edit: I've also switched laptops and I get it on Arch in addition to Ubuntu. |
The document that you emailed me isn't the correct one, can you send me a valid zip or tar file |
I'm not sure what you mean. It's a minimal binary that has the deadlock issue. If you need the source code rather than the binary it's in the post above. |
Describe the bug
We have a unit test runner that spawns a FreeRTOS task that runs our test suite and then calls
vTaskEndScheduler
to allow the main function to exit. This works most of the time but we noticed that there's an occasional deadlock.Target
Host
To Reproduce
Example code:
Running this in a loop helps triggering the issue. For me it triggers faster if I switch to another terminal:
Looking at the threads we can see that the main task is stuck trying to take a mutex:
What's interesting is, if I interpret this correctly, that the mutex owner no longer exists:
The text was updated successfully, but these errors were encountered: