NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/52796: repeated modload panics netbsd-7



On Sat, 9 Dec 2017, Valery Ushakov wrote:

>  The "symbol redefined" error messages you see on NetBSD-8 are
>  actually a result of the fix for this PR!

I suspected as much, but there's the second (first) part to this
problem too.

On NetBSD-6 modload name and modload path behave the same:

  nb6# modload nand
  modload: File exists
  nb6# modload /stand/i386/6.1/modules/nand/nand.kmod
  modload: File exists

On 7 and later modload name fails with EEXIST right away without
actually trying to load the module.  But modload path does try to load
the module (which causes bad things on 7 and is caught by the kernel
linker on 8).  Shouldn't modload path detect EEXIST without trying to
load the module too, like it did on 6?

Unfortunately, the kobj magic (in src/sys/kern/subr_kobj.c) that handles symbol relocation runs as soon as the module file is read into memory, and that is where the linkset information (required to obtain the name and other stuff for the modinfo_t structure) gets identified. It would require some surgery on the kobj stuff to separate section processing from symbol/relocation processing.

I'm not quite sure how/why this part worked on netbsd-6


+------------------+--------------------------+----------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:          |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org |
+------------------+--------------------------+----------------------------+


Home | Main Index | Thread Index | Old Index