-
Notifications
You must be signed in to change notification settings - Fork 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
iotlab-m3: thread tests failing #10800
Comments
Ah... it only reverted it for the SPI... |
argh |
I have to look at other concerned ST boards |
Ok, the problem is not only affecting the iotlab-m3 board but also all STM32 based boards that I have tested until now (nucleo-091rc, b-l072zlrwan1, b-l475e-iot01a). The problems comes from multiple threads trying to print nearly at the same time. A potential solution (discussed offline with @cladmi) would be to use some kind of atomic stdio functions: if a thread is already writing to UART, no other should be able to print until the first one is done. I'm not sure if this won't break the DMA feature itself but with minimal changes, it will fix the tests. The proposed solution should be discussed further, but it may take some time, I propose to revert the use of DMA at board level. |
So the I have two ideas to implement this with functions
|
I did not listed it in the first place, as I thought it was not thread related and that it was another issue, but In that case, as there is another thread printing, I think that having a |
I believe printf/puts thread-safety should be fixed by #8619 I don't have hardware at the moment, so I can't test. I guess disabling DMA is a first step to get the stability back. |
Maybe that was also the problem with #10761? |
This improves the situation but
This kind of is what is done in #10803: the feature is not pulled automatically by the board. It's just that DMA with SPI is not tested automatically. |
To be pedantic about words. I would say that I would use more say not "atomic" as it is more the fact that even if you printed the first characters of the string, somebody else can print before you finish printing your string. What is not thread safe is our tests implementation as they do not take this possible de-scheduling into account. And even with a |
The issue was fixed during 2019.01 through #10803 The tests tread safety is another issue than this one. |
Analysis
The threads are using
printf
to show threads activity, however, a thread could be de-scheduled in the middle of printf. It did not really happen before but always happens when using the DMA.Description
I found out that the thread related tests are all failing on
BOARD=iotlab-m3
:I bisected with
to get to the commit commit 0b6bccb as breaking the thread tests for iotlab-m3.
Steps to reproduce the issue
Run the test
Or one of the listed ones before. The test should succeed but fails.
Versions
I tested with the current master b6eb12c and bisected to 0b6bccb.
I was building using the docker container integration with:
And also with ubuntu bionic:
The text was updated successfully, but these errors were encountered: