[riot-notifications] [RIOT-OS/RIOT] Making the newlib thread-safe (#4488)
notifications at github.com
Sun Jan 10 18:01:54 CET 2021
> Wait, neither `printf` nor `thread_create` should call `malloc` - is this a different bug?
> Please confirm if this is still an issue.
Kind of. But not in RIOT. After lot's of debugging I found out that many of the freezes I experienced were not RIOT related. The integrated USB-to-TTL STLink converter of the Nucleo I use has some bug with macOS. It can happen that the UART PC -> Nucleo direction freezes until re-plugging the USB. Sending is impossible then.
I don't understand why this happens - but it happened much more often when using `printf` or `std` functions using malloc / creating temporary objects on the heap. At first I thought the freeze or crash was in the OS and due to malloc. This bug is also very strange because I'v never experienced it with other devices before and the serial drivers are very stable with all other devices I use no matter if FTDI, CP1202 or others.
Regarding this issue I think this bug is fixed for malloc at least. I didn't have any issues so far anymore, but didn't use it much. I focussed on using a STL implementation not relying on malloc. https://www.etlcpp.com is very interesting.
But I am not sure whether the whole newlib is alread-safe or there are other functions still missing from #4529 / #8619.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications