Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Dec 2024 04:27:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        fs@FreeBSD.org
Subject:   [Bug 267028] kernel panics when booting with both (zfs,ko or vboxnetflt,ko or acpi_wmi.ko) and amdgpu.ko
Message-ID:  <bug-267028-3630-HuvQPpLd1c@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-267028-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-267028-3630@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267028

--- Comment #297 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to Mark Millard from comment #294)

Updated patch that does some checking of the
stages between which the odd value shows up:

# git -C /usr/alt-src diff sys/kern/kern_linker.c
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c
index 5271d002fba4..2f94d2cca356 100644
--- a/sys/kern/kern_linker.c
+++ b/sys/kern/kern_linker.c
@@ -1475,6 +1475,18 @@ sys_kldsym(struct thread *td, struct kldsym_args *ua=
p)
        return (error);
 }

+#define MODLIST_NEWMOD_HIST_SLOTS 256
+static char const* modlist_newmod_lookup_name=3D         NULL;=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20
   // NULL: No problem found.
+static int         modlist_newmod_hist_pos=3D=20=20=20=20=20=20=20=20=20=
=20=20
MODLIST_NEWMOD_HIST_SLOTS; // First use will wrap to 0 first.
+static int         modlist_newmod_tqe_next_changed_at=3D
MODLIST_NEWMOD_HIST_SLOTS; // I.E.: No such found.
+static modlist_t   modlist_newmod_tqe_next_newvalue=3D   NULL;=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20
   // NULL: No such found.
+static struct modlist_newmod_hist_type {
+       modlist_t     modAddr;
+       linker_file_t containerAddr;
+       char const*   modnameAddr;
+       int           version;
+} modlist_newmod_hist[MODLIST_NEWMOD_HIST_SLOTS];
+
 /*
  * Preloaded module support
  */
@@ -1484,6 +1496,17 @@ modlist_lookup(const char *name, int ver)
 {
        modlist_t mod;

+       int modlist_newmod_rescan_start_at =3D 0;
+       if (16 <=3D modlist_newmod_hist_pos) modlist_newmod_rescan_start_at=
=3D
modlist_newmod_hist_pos-16;
+       for (int scan_pos=3D modlist_newmod_rescan_start_at;
scan_pos<modlist_newmod_hist_pos; ++scan_pos)
+               if(modlist_newmod_hist[scan_pos].modAddr->link.tqe_next !=3D
modlist_newmod_hist[scan_pos+1].modAddr)
+               {
+                       modlist_newmod_lookup_name=3D         name;
+                       modlist_newmod_tqe_next_changed_at=3D scan_pos;
+                       modlist_newmod_tqe_next_newvalue=3D=20=20
modlist_newmod_hist[scan_pos].modAddr->link.tqe_next;
+                       panic("modlist_lookup: a prior tqe_next changed!");
+               }
+
        TAILQ_FOREACH(mod, &found_modules, link) {
                if (strcmp(mod->name, name) =3D=3D 0 &&
                    (ver =3D=3D 0 || mod->version =3D=3D ver))
@@ -1521,8 +1544,21 @@ modlist_newmodule(const char *modname, int version,
linker_file_t container)
        modlist_t mod;

        mod =3D malloc(sizeof(struct modlist), M_LINKER, M_NOWAIT | M_ZERO);
+
+       ++modlist_newmod_hist_pos;
+       if (MODLIST_NEWMOD_HIST_SLOTS<=3Dmodlist_newmod_hist_pos)
modlist_newmod_hist_pos=3D 0;
+#undef MODLIST_NEWMOD_HIST_SLOTS
+       modlist_newmod_hist[modlist_newmod_hist_pos].modAddr=3D       mod;
+       modlist_newmod_hist[modlist_newmod_hist_pos].containerAddr=3D conta=
iner;
+       modlist_newmod_hist[modlist_newmod_hist_pos].modnameAddr=3D   modna=
me;
+       modlist_newmod_hist[modlist_newmod_hist_pos].version=3D       versi=
on;
+
        if (mod =3D=3D NULL)
                panic("no memory for module list");
+
+       if (mod < (modlist_t)0xfffff80000000100)
+               panic("modlist_newmodule: mod <
(modlist_t)PHYS_TO_DMAP(0x100)");
+
        mod->container =3D container;
        mod->name =3D modname;
        mod->version =3D version;

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-267028-3630-HuvQPpLd1c>