Bug 250921 - [nfs] linker_load_file: /boot/kernel/nfslockd.ko - unsupported file type
Summary: [nfs] linker_load_file: /boot/kernel/nfslockd.ko - unsupported file type
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.2-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-07 11:31 UTC by Alexander Kuznetsov
Modified: 2020-11-17 04:59 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kuznetsov 2020-11-07 11:31:13 UTC
Hi,

After I've upgraded my server to 12.2-Release from 12.1-Release, I'm getting an error while loading nfsd:

link_elf_obj: symbol xdr_free undefined
linker_load_file: /boot/kernel/nfslockd.ko - unsupported file type
KLD nfsd.ko: depends on nfslockd - not available or version mismatch

It seems that a bug from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=249378 still in 12.2 Release.
Comment 1 nork 2020-11-11 09:18:57 UTC
Hi, me too.
I saw PR#249378, and tested following patch, so fix!

Index: sys/kgssapi/gss_impl.c
===================================================================
--- sys/kgssapi/gss_impl.c      (revision 367582)
+++ sys/kgssapi/gss_impl.c      (working copy)
@@ -342,5 +342,6 @@
        NULL,
 };
 DECLARE_MODULE(kgssapi, kgssapi_mod, SI_SUB_VFS, SI_ORDER_ANY);
+MODULE_DEPEND(kgssapi, xdr, 1, 1, 1);
 MODULE_DEPEND(kgssapi, krpc, 1, 1, 1);
 MODULE_VERSION(kgssapi, 1);
Index: sys/nlm/nlm_prot_impl.c
===================================================================
--- sys/nlm/nlm_prot_impl.c     (revision 367582)
+++ sys/nlm/nlm_prot_impl.c     (working copy)
@@ -2417,6 +2417,7 @@
 DECLARE_MODULE(nfslockd, nfslockd_mod, SI_SUB_VFS, SI_ORDER_ANY);

 /* So that loader and kldload(2) can find us, wherever we are.. */
+MODULE_DEPEND(nfslockd, xdr, 1, 1, 1);
 MODULE_DEPEND(nfslockd, krpc, 1, 1, 1);
 MODULE_DEPEND(nfslockd, nfslock, 1, 1, 1);
 MODULE_VERSION(nfslockd, 1);
Comment 2 Mark Johnston freebsd_committer 2020-11-12 20:10:21 UTC
I believe xdr.ko can be loaded explicitly as a workaround.

*** This bug has been marked as a duplicate of bug 249378 ***
Comment 3 Dan Lukes 2020-11-13 06:38:34 UTC
Sorry, but this bug is NOT duplicate of bug 249378.
249378 is related to 12.1 ONLY.
This bug is related to 12.2-RELEASE which is still broken and (already closed) 249378 is not going to solve it..
Comment 4 Mark Johnston freebsd_committer 2020-11-13 15:53:21 UTC
(In reply to Dan Lukes from comment #3)
It is the same root cause.  The problem was fixed in stable/12, but not before the 12.2 branch was frozen, so unfortunately it is expected that the problem is still in 12.2.
Comment 5 Dan Lukes 2020-11-13 17:10:18 UTC
I fully understand the matter. You closed this PR while the bug 249378 is (and remain) closed as well. As a result of your influence, all reports related to the bug are closed while issue is still unsolved. No committer can see there's a bug to patch. I'm just surprised how the solution will happen.
Comment 6 Mark Johnston freebsd_committer 2020-11-13 17:26:06 UTC
(In reply to Dan Lukes from comment #5)
Committers are generally not in a position to fix bugs in an existing release.  Binary patches are issued by secteam, usually only for severe problems without a workaround.  I can work on getting an EN patch released for this bug since it quite low-risk, but that's not going to happen by virtue of keeping a PR open.
Comment 7 Alexander Kuznetsov 2020-11-14 14:17:39 UTC
(In reply to Mark Johnston from comment #2)
Hi,

I've checked, it doesn't work.

# kldload xdr
kldload: can't load xdr: module already loaded or in kernel
# kldload nfsd
kldload: an error occurred while loading module nfsd. Please check dmesg(8) for more details.
# dmesg | tail
link_elf_obj: symbol xdr_free undefined
linker_load_file: /boot/kernel/nfslockd.ko - unsupported file type
KLD nfsd.ko: depends on nfslockd - not available or version mismatch
linker_load_file: /boot/kernel/nfsd.ko - unsupported file type

And also I agree, it is not a duplicate bug. In my opinion, base functionality in release branch should work "out of the box", without any patching or tricks.
Comment 8 Mark Johnston freebsd_committer 2020-11-16 17:41:04 UTC
(In reply to Alexander Kuznetsov from comment #7)
The kernel shipped with the amd64 12.2 binary release has this stuff (nfslockd and nfsd) compiled in.  To hit the bug you must be compiling your own kernel.  Is that right?  For this scenario we generally do not merge bug fixes to release branches.

Since the workaround I proposed apparently does not work, I'm willing to spend some time to get approval to merge the fix to release/12.2.
Comment 9 Alexander Kuznetsov 2020-11-17 04:59:39 UTC
(In reply to Mark Johnston from comment #8)
Yes, you are right. I use my own kernel on various servers and load required modules on demand.

> Since the workaround I proposed apparently does not work, I'm willing to spend some time to get approval to merge the fix to release/12.2.

That would be great. Thank you!