Summary: | emulators/virtualbox-ose: rc script vboxnet hangs FreeBSD | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | O. Hartmann <ohartmann> | ||||
Component: | Individual Port(s) | Assignee: | Virtualbox Team (Nobody) <vbox> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | grahamperrin, junchoon, madpilot, xxjack12xx | ||||
Priority: | --- | Flags: | madpilot:
maintainer-feedback+
madpilot: merge-quarterly+ |
||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
O. Hartmann
2021-06-09 17:23:41 UTC
Hi, I'm observing the same. If you interrupt the loading and then launch it again it works fine afterwards. I wrote to the mailing lists about this: https://lists.freebsd.org/archives/freebsd-emulation/2021-June/000004.html Unluckily I got no reply. I also have no clue what could be causing this. Maybe a kernel bisect could help identify what change causes this. I'm unable to perform this at present. just a thought, as I have not enough time to bisect, but maybe (For stable/13) git 620a48f64d08 (For main) git e266a0f7f001 broke this. In /usr/local/etc/rc.d/vboxnet function vboxnet_start(), components in vboxnet_modules="vboxdrv vboxnetflt:ng_vboxnetflt vboxnetadp" are expanded to (for vboxdrv) _k= vboxdrv _m= vboxdrv (for vboxnetflt:ng_vboxnetflt) _k= vboxnetflt _m= ng_vboxnetflt (for vboxnetadp) _k= vboxnetadp _m= vboxnetadp and only `kldstat -m ng_vboxnetflt` fails even if vboxnetflt.ko is loaded. As there's no ng_vboxnetflt.ko, I suspect vboxnetflt.ko makes simultaneous multiple kldload syscall (not dug into sources, so just a thought) and hit by the commit. (In reply to Tomoaki AOKI from comment #2) Thankss, good finding I think you're on to something. While the ng_ prefix is due to the ko file having a name but registering with another (it actually is a netgraph node after all). It does perform a kern_kldload() call in it's own module handler. I'm not a netgraph expert and this requires some studying. Looks like that kern_kldload call needs to be removed in some way. (relevant file in virtualbox distribution is "src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c") After some studying, they are using kern_kldload() insside their own module to depend on ng_ether, because that node used to miss versioning and could not be properly depended upon. This has been fixed a long time ago though, in base 39b553cea050ec So I guess the correct solution is to use a proper dependency, which is what I'm testing. Created attachment 225737 [details] kldload patch I created review D30722 with the patch. It works fine for me, but I'd rather have some testing feedback before committing. Could you test it and report back? I'm also attaching the patch here. BTW this should also be merged to the quarterly branch, so I'm marking the bug report as such. Also slightly earlier bug 256501 … (In reply to Guido Falsi from comment #5) Thanks! This fixed the issue on base stable/13 ca81bcbbf118 for me. Not tested for other branch, as I have vbox installed only on stable/13. BTW, actually, I applied slightly fixed (just to be applicable) patch on D30722. It specified new file name conversion for original, too. Patch here looks OK. (In reply to Graham Perrin from comment #7) It would be better marked as a duplicate of this. It has no patch or workaround until now. *** Bug 256501 has been marked as a duplicate of this bug. *** (In reply to Tomoaki AOKI from comment #9) It's actually the same patch, generated from the same git branch, only this is generated with `git patch >file` and the other one was generated by arc, don't know if the two things handle renames differently. Anyway yes, what I put in the review better represents what I'm actually doing. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=082999790a64a5e64a3faa133e8d2d06bf2aff61 commit 082999790a64a5e64a3faa133e8d2d06bf2aff61 Author: Guido Falsi <madpilot@FreeBSD.org> AuthorDate: 2021-06-14 18:47:06 +0000 Commit: Guido Falsi <madpilot@FreeBSD.org> CommitDate: 2021-06-14 18:55:28 +0000 emulators/virtualbox-ose-kmod: Fix hang at module loading time After src commit e266a0f7f001 a module is not allowed to call kern_kldload while being loaded. The virtualbox module is doing exactly this though. virutalbox used to do this because the ng_ether netgraph node did not provide version information in the past and there was no way to properly depend on it. ng_ether has gained versioning information in base r238844 more than ten years ago, so we can now unconditionally properly depend on it, since this revision is now included in all supported FreeBSD versions. Thanks to Tomoaki AOKI for identifying the base commuit exposing the issue. PR: 256505 Tested by: Tomoaki AOKI <junchoon@dec.sakura.ne.jp> MFH: 2021Q2 Differential Revision: https://reviews.freebsd.org/D30722 emulators/virtualbox-ose-kmod/Makefile | 1 + ...rivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c} | 59 ++++++++++++++-------- 2 files changed, 39 insertions(+), 21 deletions(-) A commit in branch 2021Q2 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=758e045e3a8137842c72d35514c76b6d7f31c06b commit 758e045e3a8137842c72d35514c76b6d7f31c06b Author: Guido Falsi <madpilot@FreeBSD.org> AuthorDate: 2021-06-14 18:47:06 +0000 Commit: Guido Falsi <madpilot@FreeBSD.org> CommitDate: 2021-06-14 18:57:31 +0000 emulators/virtualbox-ose-kmod: Fix hang at module loading time After src commit e266a0f7f001 a module is not allowed to call kern_kldload while being loaded. The virtualbox module is doing exactly this though. virutalbox used to do this because the ng_ether netgraph node did not provide version information in the past and there was no way to properly depend on it. ng_ether has gained versioning information in base r238844 more than ten years ago, so we can now unconditionally properly depend on it, since this revision is now included in all supported FreeBSD versions. Thanks to Tomoaki AOKI for identifying the base commuit exposing the issue. PR: 256505 Tested by: Tomoaki AOKI <junchoon@dec.sakura.ne.jp> MFH: 2021Q2 Differential Revision: https://reviews.freebsd.org/D30722 (cherry picked from commit 082999790a64a5e64a3faa133e8d2d06bf2aff61) ...rivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c} | 59 ++++++++++++++-------- 1 file changed, 38 insertions(+), 21 deletions(-) Patch committed and merged to quarterly. Thanks for help and testing! A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=354344ce8af17e5b6d85109120af5c6584ae642c commit 354344ce8af17e5b6d85109120af5c6584ae642c Author: Guido Falsi <madpilot@FreeBSD.org> AuthorDate: 2021-06-14 19:59:05 +0000 Commit: Guido Falsi <madpilot@FreeBSD.org> CommitDate: 2021-06-14 20:02:23 +0000 emulators/virtualbox-ose-kmod-legacy: Fix hang at module loading time After src commit e266a0f7f001 a module is not allowed to call kern_kldload while being loaded. The virtualbox module is doing exactly this though. virutalbox used to do this because the ng_ether netgraph node did not provide version information in the past and there was no way to properly depend on it. ng_ether has gained versioning information in base r238844 more than ten years ago, so we can now unconditionally properly depend on it, since this revision is now included in all supported FreeBSD versions. Thanks to Tomoaki AOKI for identifying the base commuit exposing the issue. Backport fix to legacy port. WHile here also merge a double patch for the smae file. PR: 256505 MFH: 2021Q2 emulators/virtualbox-ose-kmod-legacy/Makefile | 2 +- ...-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c (gone) | 273 ------------------- ...Drivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c | 292 ++++++++++++++++++++- 3 files changed, 289 insertions(+), 278 deletions(-) A commit in branch 2021Q2 references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=68c14fd975f54e546c2bfbe4adc79126be268efe commit 68c14fd975f54e546c2bfbe4adc79126be268efe Author: Guido Falsi <madpilot@FreeBSD.org> AuthorDate: 2021-06-14 19:59:05 +0000 Commit: Guido Falsi <madpilot@FreeBSD.org> CommitDate: 2021-06-14 20:05:17 +0000 emulators/virtualbox-ose-kmod-legacy: Fix hang at module loading time After src commit e266a0f7f001 a module is not allowed to call kern_kldload while being loaded. The virtualbox module is doing exactly this though. virutalbox used to do this because the ng_ether netgraph node did not provide version information in the past and there was no way to properly depend on it. ng_ether has gained versioning information in base r238844 more than ten years ago, so we can now unconditionally properly depend on it, since this revision is now included in all supported FreeBSD versions. Thanks to Tomoaki AOKI for identifying the base commuit exposing the issue. Backport fix to legacy port. WHile here also merge a double patch for the smae file. PR: 256505 MFH: 2021Q2 (cherry picked from commit 354344ce8af17e5b6d85109120af5c6584ae642c) emulators/virtualbox-ose-kmod-legacy/Makefile | 2 +- ...-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c (gone) | 273 ------------------- ...Drivers_VBoxNetFlt_freebsd_VBoxNetFlt-freebsd.c | 292 ++++++++++++++++++++- 3 files changed, 289 insertions(+), 278 deletions(-) |