Date: Thu, 21 Jan 2021 21:37:36 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 218598] pwait deadlocks on its own pid Message-ID: <bug-218598-227-jP4MOgDOsO@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-218598-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | previous in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218598 --- Comment #5 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5bdce6ff546e00673f9f515d2165d02901e858aa commit 5bdce6ff546e00673f9f515d2165d02901e858aa Author: Alexander V. Chernikov <melifaro@FreeBSD.org> AuthorDate: 2021-01-21 21:26:15 +0000 Commit: Alexander V. Chernikov <melifaro@FreeBSD.org> CommitDate: 2021-01-21 21:36:37 +0000 Remove deadlock in rc caused by pwait waiting for itself. The following situation can trigger the deadlock: 1) Long time ago a_service was started through rc.d 2) We want to restart a_service and issue service a_service restart 3) rc.subr reads current process PID (via file or process), sends TERM signal and runs pwait with PID harvested 4) a_service process dies very quickly so it's PID becomes available. It is possible that while original process was running, PID counter overflowed and pwait got assigned a_service's PID. This patch ignores pid(s) to wait that are equal to pwait PID. Reported by: Dan McGregor, Boris Lytochkin Submitted by: Boris Lytochkin <lytboris at gmail.com> Reviewed By: 0mp MFC after: 2 weeks PR: 218598 Differential Revision: https://reviews.freebsd.org/D28240 bin/pwait/pwait.1 | 6 +++++- bin/pwait/pwait.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-218598-227-jP4MOgDOsO>
