[Bug 279203] logger: Forking many logger executables at once renders machine unresponsive

2024-05-22 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279203

Michael Gmelin  changed:

   What|Removed |Added

  Flags||mfc-stable13?,
   ||needs_errata?

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


[Bug 279203] logger: Forking many logger executables at once renders machine unresponsive

2024-05-22 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279203

--- Comment #2 from Michael Gmelin  ---
Cherry-picking this commit fixes the issue for me:

commit 7a70f17ac4bd64dc1a5020f963ba4380cf37b7e5
Author: Konstantin Belousov 
Date:   Fri Jul 7 20:19:33 2023 +0300

killpg(): more carefully avoid LoR

otherwise we could end up with the livelock.  When pg_killsx trylock
failed, ensure that we do wait for lock availability before retry.

Reported and tested by: pho
Sponsored by:   The FreeBSD Foundation
MFC after:  1 week

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


[Bug 279203] logger: Forking many logger executables at once renders machine unresponsive

2024-05-22 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279203

Michael Gmelin  changed:

   What|Removed |Added

 CC||k...@freebsd.org

--- Comment #1 from Michael Gmelin  ---
This only seems to affect 13.3 and 13-STABLE after
https://cgit.freebsd.org/src/commit/?h=stable/13=2b0cd3b552942c642a84f8e224b989c02d97125d
("killpg(2): close a race with fork(2), part1").

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


[Bug 279203] logger: Forking many logger executables at once renders machine unresponsive

2024-05-21 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279203

Bug ID: 279203
   Summary: logger: Forking many logger executables at once
renders machine unresponsive
   Product: Base System
   Version: 13.3-RELEASE
  Hardware: Any
OS: Any
Status: New
  Severity: Affects Some People
  Priority: ---
 Component: bin
  Assignee: b...@freebsd.org
  Reporter: gre...@freebsd.org
CC: r...@freebsd.org

Forking logger many times like this:

#!/bin/sh
for id in $(jot 100); do
  logger -p local2.info -t pot "wledkjweldjwldjkwedj" &
done

sends the machine into some race condition, causing loads of 300-500. I can
reproduce it on multicore machines (including within bhyve), not on single
core. Load is mostly caused by system calls. When knowing pids, it's sometimes
possible to recover the host by killing all logger processes (killall won't
work though, as the machine is too loaded for that).

I could not reproduce this on 13.2 (at least not as easily). When building
logger without capsicum, this doesn't happen, but that could be a red herring.

Happens on 13.3 as well as 13.3p2.

This is causing quite some headache.  We put logger under a lock to reduce
concurrency, which made things better, but we still see the general situation
(either other things call logger or, more likely, this is just a symptom of a
bigger underlying issue).

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