Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Mar 2026 08:57:21 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 293382] Dead lock and kernel crash around closefp_impl
Message-ID:  <bug-293382-227-MF1VDQBBeL@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-293382-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=293382

--- Comment #12 from Paul <devgs@ukr.net> ---
Hi mark, thanks!

It very well might be the case that some FD is being simultaneously registered
in kqueue and closed. I wouldn't go as far as to say it's the user-space
application bug. After all, EBADF is a pretty legitimate error and a condition.
We use asio library, and multiple threads. It may, indeed not have the
`close()` serialized with a kqueue requests to the kernel. And I still hold my
belief that they are right, as I can't remember reading anywhere about close +
kqueue being concurrently forbidden: after all, kernel must *always* play on
defensive and never trust or give tools to user-space, that can cause panic or
crash.

Please, ignore my rabble above. We unmeasurably appreciate your efforts and
help!

We are going to take your patch into testing now.

----

As a side note, just a bit of concern: this patch seems to only 'refresh the
state' on certain condition and not use an actual lock. Would it not be
susceptible to ABA still and just reduce the likelihood of a race, not
eliminating it entirely?

-- 
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-293382-227-MF1VDQBBeL>