-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[BUG] Multiple syslog channels issue #19173
Copy link
Copy link
Open
Labels
Arch: allIssues that apply to all architecturesIssues that apply to all architecturesArea: OS ComponentsOS Components issuesOS Components issuesOS: BSDIssues related to *BSD OSes (building system, etc)Issues related to *BSD OSes (building system, etc)OS: LinuxIssues related to Linux (building system, etc)Issues related to Linux (building system, etc)OS: MacIssues related to MacOS (building system, etc)Issues related to MacOS (building system, etc)OS: OtherIssues related to other OS (not Linux, Mac or Win)Issues related to other OS (not Linux, Mac or Win)OS: WindowsIssues related to Windows (building system, etc)Issues related to Windows (building system, etc)Type: BugSomething isn't workingSomething isn't working
Metadata
Metadata
Assignees
Labels
Arch: allIssues that apply to all architecturesIssues that apply to all architecturesArea: OS ComponentsOS Components issuesOS Components issuesOS: BSDIssues related to *BSD OSes (building system, etc)Issues related to *BSD OSes (building system, etc)OS: LinuxIssues related to Linux (building system, etc)Issues related to Linux (building system, etc)OS: MacIssues related to MacOS (building system, etc)Issues related to MacOS (building system, etc)OS: OtherIssues related to other OS (not Linux, Mac or Win)Issues related to other OS (not Linux, Mac or Win)OS: WindowsIssues related to Windows (building system, etc)Issues related to Windows (building system, etc)Type: BugSomething isn't workingSomething isn't working
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description / Steps to reproduce the issue
Issue reported by Martin Krasula, forwarding to Github.
Description
When using multiple channels for syslog output (for example, combining the NSH console, USB CDCACM, and/or logging to
a file stored in NOR flash memory), an infinite loop (cyclical syslog output) can occur.
This issue happens because the functions
syslograwstream_addstringandsyslograwstream_addchardo not check and handle the return value ofsyslograwstream_flush.The
syslograwstream_flushfunction can return a negativeerrnopropagated fromsyslog_write->syslog_write_foreach->write.This typically happens if a write operation to the syslog file fails, or when the USB CDCACM interface for syslog is disconnected.
Affected files
libs/libc/stream/lib_syslograwstream.cdrivers/syslog/syslog_write.cPossible Solution
The solution would be to properly handle the return value from
syslograwstream_flushto prevent the infinite loop when a errno occurs.Please see the attached patch for more details.
On which OS does this issue occur?
[OS: Other], [OS: Linux], [OS: Windows], [OS: Mac], [OS: BSD]
What is the version of your OS?
NuttX
NuttX Version
master
Issue Architecture
[Arch: all]
Issue Area
[Area: OS Components]
Host information
No response
Verification