Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Feb 2013 04:37:23 GMT
From:      Garrett Cooper <yaneurabeya@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/175793: modfind(2) doesn't understand modules with underscores
Message-ID:  <201302030437.r134bNMR046994@red.freebsd.org>
Resent-Message-ID: <201302030440.r134e0Xv004408@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         175793
>Category:       bin
>Synopsis:       modfind(2) doesn't understand modules with underscores
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 03 04:40:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Garrett Cooper
>Release:        9.1-STABLE
>Organization:
EMC Isilon
>Environment:
FreeBSD bayonetta.local 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0 r+39e5635: Tue Dec 11 08:55:27 PST 2012     gcooper@bayonetta.local:/usr/obj/scratch/git/github/yaneurabeya-freebsd-stable-9/sys/BAYONETTA  amd64
>Description:
Tried to use kldstat -m to determine whether or not a networking module is loaded, and FWIW it appears to not work as expected:

$ kldstat 
Id Refs Address            Size     Name
 1   30 0xffffffff80200000 91e2d8   kernel
 2    1 0xffffffff80b1f000 264378   zfs.ko
 3    5 0xffffffff80d84000 25e38    krpc.ko
 4    2 0xffffffff80daa000 60d8     opensolaris.ko
 5    1 0xffffffff80e12000 7afb     aio.ko
 6    1 0xffffffff80e1a000 a5bf     if_re.ko
 7    1 0xffffffff80e25000 303fd    nfsd.ko
 8    1 0xffffffff80e56000 110b8    nfscommon.ko
 9    2 0xffffffff80e68000 3ff      nfssvc.ko
10    2 0xffffffff80e69000 faf      nfslock.ko
11    1 0xffffffff80e6a000 e235     nfslockd.ko
12    1 0xffffffff80e79000 2860a    kqemu.ko
$ kldstat -m if_re
kldstat: can't find module if_re: No such file or directory
$ kldstat -m kqemu
Id  Refs Name
198    1 kqemu
$ kldstat -m re   
kldstat: can't find module re: No such file or directory

Not sure why, but this code in kern_module appears to be broken, or just doesn't represent data consistent to expectations from the printouts provided by kldstat:

>From kern_module.c:

217 module_t
218 module_lookupbyname(const char *name)
219 {
220         module_t mod;
221         int err;
222 
223         MOD_LOCK_ASSERT;
224 
225         TAILQ_FOREACH(mod, &modules, link) {
226                 err = strcmp(mod->name, name);
227                 if (err == 0)
228                         return (mod);
229         }
230         return (NULL);
231 }

>From if_re.c:

 337 DRIVER_MODULE(re, pci, re_driver, re_devclass, 0, 0);

I've seen similar issues with bge(4) on a work machine, so I don't think it's isolated to re(4)...
>How-To-Repeat:
kldstat -m if_<foo>
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302030437.r134bNMR046994>