[Bug 260126] syslog(3) spins the CPU with 4180 byte messages

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 29 Nov 2021 21:40:33 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260126

            Bug ID: 260126
           Summary: syslog(3) spins the CPU with 4180 byte messages
           Product: Base System
           Version: 13.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: asomers@FreeBSD.org

After commit 2886c93d1bca231260ebc01d4205743ca781f3c7 , it is possible for
syslog(3) to spin the CPU without making any progress, because send() returns
ENOBUFS for messages over about 4180 bytes.  dtrace shows that allthough the
sockbuf size is set to 8192 bytes, it's sb_hiwat value is only 4096 at the time
of the bug.  I don't yet know why.

The bug can be produced by installing rsyslogd from ports and running the
following command.  I have not yet been able to reproduce it using syslogd.

daemon -f -s notice -l user  jot -s "" -r -p 0 5000 0 9

-- 
You are receiving this mail because:
You are the assignee for the bug.