v01d commented on issue #3157: URL: https://github.com/apache/incubator-nuttx/issues/3157#issuecomment-806018331
> Oh, there is another issue. I followed the code, specifically for the case that buffering is enabled. > > Regarding Thread A - Thread B > Buffering here is broken. Although each thread is using its own buffer, flushing of the buffer is not guaranteed to happen atomically. If the channel does not support a `write` function, the logger falls back to `putc` which again produces bad output. (If it does support `write`, it is up to the channel driver to do it correctly). > I was able to verify this experimentally, having garbled logging even with buffering enabled. I think putc is supported to print messages during boot, but I'm not sure. > Regarding Thread - IRQ > As I see it now, there shouldn't be an issue here. > Can you reproduce your issue with `CONFIG_SYSLOG_BUFFER` enabled? Ah, I didn't realize there are two options: INTBUFFER and BUFFER. I only had the former. It appears it depends on SYSLOG_WRITE which is selected by other options. Still, I'm thinking that for RAMLOG output we shouldn't need further buffering. Maybe the locking should be inside RAMLOG in this case, and that should be enough. For other syslog channels, syslog buffering should be used. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org