Summary: | kqueue support code of netmap causes panic | ||
---|---|---|---|
Product: | Base System | Reporter: | Tiwei Bie <btw> |
Component: | kern | Assignee: | David Bright <dab> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | btw, dab, jhb, kib, luigi, mmacy |
Priority: | --- | Keywords: | crash |
Version: | 11.2-RELEASE | Flags: | dab:
mfc-stable12+
dab: mfc-stable11+ dab: mfc-stable10- |
Hardware: | Any | ||
OS: | Any | ||
See Also: | https://github.com/luigirizzo/netmap/issues/521 |
Description
Tiwei Bie
2016-01-09 04:30:45 UTC
I don't know enough to verify as a real bug, adding some folks who might have a grasp of what's going on here. (In reply to Sean Bruno from comment #1) I think replacing 1 with 0 in the sys/dev/netmap/netmap_freebsd.c:netmap_kqfilter(), the call to knlist_add() would fix the issue at hand. But the panic probably means that netmap authors never ever run the code with INVARIANTS and WITNESS. Also, there are other comments in the netmap_freebsd.c, esp. about 'not even munmap() on close()' which are, together with conslusions made, at least strange. Logged as netmap issue #521: https://github.com/luigirizzo/netmap/issues/521 (In reply to Konstantin Belousov from comment #2) I've verified that the change suggested by kib@ does, indeed, avoid the panic. I've submitted a pull request upstream to make that change. I don't know if we want a local fix in the meantime or not. Adding mmacy@ for an opinion as the commit log indicates he has been syncing with upstream recently. This bug has been fixed in upstream (netmap PR #520). (In reply to David Bright from comment #5) This fix was (accidentally) committed in base r337812 and incorporated into the upcoming 12.0-RELEASE; I just noticed that now when I went to MFC that commit to stable/11. Noting the commit now, considerably after the fact. Also, flagging this as MFC-ed to stable/12 as it actually was committed before 12.0-RELEASE. A commit references this bug: Author: dab Date: Fri Nov 30 02:06:32 UTC 2018 New revision: 341275 URL: https://svnweb.freebsd.org/changeset/base/341275 Log: MFC r337812,r337814,r337820,r341068: Fix several memory leaks (r337812 & r337814). The libkqueue tests have several places that leak memory by using an idiom like: puts(kevent_to_str(kevp)); Rework to save the pointer returned from kevent_to_str() and then free() it after it has been used. r337812 also fixed a bug in the netmap kevent code. The inclusion of that fix was an oversight that I didn't notice until this MFC. Reference the code review and PR here in the MFC for completeness. r337820 & r341068 were white-space only changes as a follow-up to r337812 & r337814: After r337820, which "corrected" some spaces-instead-of-tab whitespace issues in the libkqueue tests, jmg@ pointed out that these files were originally space-based, not tab-spaced, and so the correction should have been to get rid of the tabs that had been introduced in previous changes, not the spaces. This change does that. This is a whitespace only change; no functional change is intended. PR: 206053 Differential Revision: https://reviews.freebsd.org/D16531 Sponsored by: Dell EMC Isilon Changes: _U stable/11/ stable/11/sys/dev/netmap/netmap_freebsd.c stable/11/tests/sys/kqueue/libkqueue/common.h stable/11/tests/sys/kqueue/libkqueue/main.c stable/11/tests/sys/kqueue/libkqueue/proc.c stable/11/tests/sys/kqueue/libkqueue/signal.c stable/11/tests/sys/kqueue/libkqueue/timer.c stable/11/tests/sys/kqueue/libkqueue/user.c stable/11/tests/sys/kqueue/libkqueue/vnode.c I'm going to close this as fixed in 11 & 12. I don't intend to try to MFC to 10. |