NetBSD Problem Report #50357

From paul@whooppee.com  Thu Oct 22 13:47:48 2015
Return-Path: <paul@whooppee.com>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id CC2FEA6531
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 22 Oct 2015 13:47:47 +0000 (UTC)
Message-Id: <20151022134746.7FC986FCC5@vps1.whooppee.com>
Date: Thu, 22 Oct 2015 21:47:46 +0800 (PHT)
From: paul@whooppee.com
Reply-To: paul@whooppee.com
To: gnats-bugs@gnats.NetBSD.org
Subject: warning message from anita
X-Send-Pr-Version: 3.95

>Number:         50357
>Category:       install
>Synopsis:       Erroneous attempt to load booted file-system's module
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pgoyette
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 22 13:50:00 +0000 2015
>Closed-Date:    Sun Jul 10 09:45:16 +0000 2016
>Last-Modified:  Sun Jul 10 09:45:16 +0000 2016
>Originator:     Paul Goyette
>Release:        NetBSD 7.99.21
>Organization:
+------------------+--------------------------+-------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org  |
+------------------+--------------------------+-------------------------+
>Environment:


NetBSD pokey.whooppee.com 7.99.21 NetBSD 7.99.21 (POKEY 2015-10-22 01:12:06) #6: Thu Oct 22 21:03:41 PHT 2015  paul@pokey.whooppee.com:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/POKEY amd64
Architecture: x86_64
Machine: amd64
>Description:
I executed the following command

       # anita --workdir ./work --disk-size 8G --memory-size 256M \
       --sets kern-GENERIC,modules,base,comp,etc,misc,text,games,tests \
       install /build/netbsd-local/release/amd64/

It appeared to successfully populate the work/download directory OK,
and proceeded to run makefs.

But when it tries to boot, it fails to load cd9660.kmod
[...]
      Loading /stand/amd64/7.99.21/modules/cd9660/cd9660.kmod
      WARNING: 1 module failed to load


>How-To-Repeat:
see above
>Fix:
	unknown

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->gson
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Thu, 22 Oct 2015 18:58:09 +0000
Responsible-Changed-Why:
Over to maintainer.


From: Andreas Gustafsson <gson@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: gson@NetBSD.org,
    pkg-manager@netbsd.org,
    pkgsrc-bugs@netbsd.org,
    gnats-admin@netbsd.org,
    bsiegert@NetBSD.org,
    paul@whooppee.com
Subject: Re: pkg/50357 (anita reports warning message when booting install image)
Date: Thu, 22 Oct 2015 22:24:30 +0300

 This has nothing to do with anita nor pkgsrc. Booting a recent releng
 snapshot,

   http://nyftp.netbsd.org/pub/NetBSD-daily/HEAD/201510220730Z/amd64/installation/cdrom/boot-com.iso

 on a physical amd64 machine, without any anita involvement whatsoever,
 I get the same warning:

   >> NetBSD/x86 BIOS Boot, Revision 5.10 (from NetBSD 7.99.21)
   >> Memory: 638/2873920 k

        1. Boot normally
        2. Boot single user
        3. Disable ACPI
        4. Disable ACPI and SMP
        5. Drop to boot prompt

   Choose an option; RETURN for default; SPACE to stop countdown.
   Option 1 will be chosen in 0 seconds.     
   15238008+675916+606132 [1048848+735275]=0x1276310
   WARNING: couldn't open /var/db/entropy-file
   Loading /stand/amd64/7.99.21/modules/cd9660/cd9660.kmod  
   WARNING: 1 module failed to load

 The logs on b5 show that the warnings started in May, during a period
 of build breakage when the following commits were made:

    2015.05.25.15.38.33 martin src/distrib/amd64/cdroms/Makefile.cdrom 1.17
    2015.05.25.15.38.33 martin src/distrib/common/Makefile.bootcd 1.28
    2015.05.25.15.38.33 martin src/distrib/i386/cdroms/Makefile.cdrom 1.37
    2015.05.25.15.38.33 martin src/distrib/sparc64/cdroms/installcd/Makefile 1.24
    2015.05.25.15.38.33 martin src/distrib/vax/cdroms/installcd/Makefile 1.14
    2015.05.25.18.41.08 matt src/sys/lib/libunwind/unwind_registers.S 1.17
    2015.05.25.20.57.18 prlw1 src/sys/dev/vnd.c 1.244
    2015.05.25.20.57.18 prlw1 src/sys/dev/vndvar.h 1.34
    2015.05.25.21.02.37 prlw1 src/share/man/man9/csf.9 1.9
    2015.05.25.21.02.37 prlw1 src/sys/dev/vnd.c 1.245
    2015.05.25.21.02.37 prlw1 src/sys/kern/kern_mutex.c 1.62
    2015.05.25.21.18.29 skrll src/external/gpl3/gcc/dist/gcc/config/arm/netbsd-elf.h 1.8
    2015.05.25.23.45.54 matt src/sys/arch/mips/mips/mips_machdep.c 1.264
    2015.05.25.23.47.01 matt src/sys/arch/mips/conf/std.octeon 1.3
    2015.05.26.00.42.07 ozaki-r src/distrib/sets/lists/debug/mi 1.114
    2015.05.26.00.42.07 ozaki-r src/distrib/sets/lists/tests/mi 1.623
    2015.05.26.00.42.07 ozaki-r src/tests/net/Makefile 1.22
    2015.05.26.00.42.07 ozaki-r src/tests/net/mcast/Attic/t_mcast.c 1.17
    2015.05.26.00.42.07 ozaki-r src/tests/net/mcast/Makefile 1.2
    2015.05.26.00.42.07 ozaki-r src/tests/net/mcast/mcast.c 1.1
    2015.05.26.00.42.07 ozaki-r src/tests/net/mcast/t_mcast.sh 1.1
    2015.05.26.02.09.34 matt src/sys/arch/evbmips/evbmips/cpu.c 1.4
    2015.05.26.02.09.34 matt src/sys/arch/mips/mips/cpu_subr.c 1.19
    2015.05.26.02.16.38 matt src/sys/arch/mips/include/mcontext.h 1.21
    2015.05.26.02.18.20 matt src/sys/arch/mips/mips/mipsX_subr.S 1.57
    2015.05.26.05.11.33 hkenken src/sys/arch/arm/imx/imx51_esdhc.c 1.3
    2015.05.26.06.55.08 matt src/common/lib/libc/arch/mips/string/strchr.S 1.4
    2015.05.26.06.55.08 matt src/common/lib/libc/arch/mips/string/strrchr.S 1.3
    2015.05.26.15.29.39 pooka src/sys/rump/librump/rumpkern/cons.c 1.5
    2015.05.26.15.46.01 martin src/distrib/sets/maketars 1.82
    2015.05.26.16.08.01 msaitoh src/sys/arch/x86/x86/intel_busclock.c 1.22
    2015.05.26.16.48.05 pooka src/sys/rump/librump/rumpvfs/rumpblk.c 1.60
    2015.05.26.19.59.21 christos src/lib/libedit/readline.c 1.116
    2015.05.26.19.59.21 christos src/lib/libedit/readline/readline.h 1.35
    2015.05.26.21.35.15 christos src/bin/sh/main.c 1.59
    2015.05.26.21.35.15 christos src/bin/sh/options.h 1.22
    2015.05.26.21.35.15 christos src/bin/sh/sh.1 1.115
    2015.05.26.21.35.15 christos src/bin/sh/var.c 1.44
    2015.05.26.21.35.15 christos src/bin/sh/var.h 1.26
    2015.05.26.21.37.24 htodd src/distrib/sets/lists/tests/mi 1.624
    2015.05.26.21.42.46 christos src/lib/libc/gen/vis.c 1.70
    2015.05.26.22.04.32 htodd src/distrib/sets/lists/debug/mi 1.115
    2015.05.26.22.05.44 htodd src/distrib/sets/lists/tests/mi 1.625
    2015.05.27.00.08.50 msaitoh src/sys/arch/x86/x86/intel_busclock.c 1.23
    2015.05.27.00.16.46 msaitoh src/sys/arch/x86/x86/coretemp.c 1.34
    2015.05.27.01.12.04 ozaki-r src/tests/net/net/t_forwarding.sh 1.3
    2015.05.27.07.52.02 matt src/share/man/man7/sysctl.7 1.87
    2015.05.27.09.26.46 martin src/distrib/sets/maketars 1.83
    2015.05.27.09.27.40 martin src/distrib/common/Makefile.bootcd 1.29
    2015.05.27.09.40.51 jmcneill src/sys/arch/evbarm/rpi/rpi_machdep.c 1.65
    2015.05.27.09.44.40 martin src/distrib/amd64/cdroms/Makefile.cdrom 1.18
    2015.05.27.09.44.40 martin src/distrib/common/Makefile.bootcd 1.30
    2015.05.27.09.44.40 martin src/distrib/i386/cdroms/Makefile.cdrom 1.38
    2015.05.27.09.44.40 martin src/distrib/sparc64/cdroms/installcd/Makefile 1.25

 -- 
 Andreas Gustafsson, gson@NetBSD.org

Responsible-Changed-From-To: gson->install-manager
Responsible-Changed-By: gson@NetBSD.org
Responsible-Changed-When: Thu, 22 Oct 2015 19:44:15 +0000
Responsible-Changed-Why:
This is not a pkgsrc or anita issue.


From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: install/50357: warning message from anita
Date: Fri, 10 Jun 2016 08:41:49 +0800 (PHT)

 (I've updated the synopsis for this PR to reflect the real problem.)

 So, here's what's happening...

 1. Various routines in lib/libsa code set the global variable 'fsmod'
     to identify the root file-system.  This appears to be done for
     msdosfs, nfs, ext2fs, cd9660, and ffs file-systems.

 2. In arch/i386/stand/lib/libexec.c the 'fsmod' variable is checked.
     If it is non-NULL, the named module is added to the list of modules
     that gets "passed in" to the kernel.

 3. Early in kernel initialization, we call module_init(), which calls
     module_init_md().  At least on i386 and amd64, this calls
     module_prime() which tries to load the specified module, including
     symbol resolution.

 The problem is, there's no check being made to see if the fs module is
 already built-in to the kernel.  The symbol relocation fails because 
 they're all already defined, so the module load fails.

 This used to be a fairly minor issue, but with the recent commit of a 
 fix for kern/45125 we're now reporting each attempt to redefine the 
 symbols, so lots of messages!

 This problem appears in the installation CD-ROM image when booted.  On 
 the automated test runs on babylon5 it seems that the target (installed) 
 system is not affected.  However, there is at least one user who has 
 (in private E-mail) reported this problem occurring in a recently 
 updated running system.

 Thanks to gson@ for providing the time-range for when this problem may 
 have been introduced.  However, looking through the list of commits he 
 provided doesn't offer any clues.



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

From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: install/50357: Erroneous attempt to load booted file-system's
 module
Date: Fri, 10 Jun 2016 10:29:26 +0800 (PHT)

   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.

 --0-538362010-1465525766=:25798
 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

 The attached patch checks the list of built-in modules for duplicates of 
 any module names pushed in from the boot-loader.  In the case of a 
 duplicate module name, we simply return an error status (no message is 
 logged unless you have previously set the module_verbose_on variable to 
 non-zero).  This avoids any attempt to resolve symbols from the module.

 While here, I'm also modifying another error message to differentiate 
 between failure-to-load and failure-to-get-module-info.

 I'll give folks a week or so to comment on the patch before I commit it.


 +------------------+--------------------------+------------------------+
 | Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
 | (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
 | Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
 +------------------+--------------------------+------------------------+
 --0-538362010-1465525766=:25798
 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=km.diff
 Content-Transfer-Encoding: BASE64
 Content-ID: <Pine.NEB.4.64.1606101029260.25798@pokey.whooppee.com>
 Content-Description: 
 Content-Disposition: attachment; filename=km.diff

 SW5kZXg6IGtlcm5fbW9kdWxlLmMNCj09PT09PT09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0N
 ClJDUyBmaWxlOiAvY3Zzcm9vdC9zcmMvc3lzL2tlcm4va2Vybl9tb2R1bGUu
 Yyx2DQpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMTEwDQpkaWZmIC11IC1wIC1y
 MS4xMTAga2Vybl9tb2R1bGUuYw0KLS0tIGtlcm5fbW9kdWxlLmMJNiBGZWIg
 MjAxNiAyMjo0ODowNyAtMDAwMAkxLjExMA0KKysrIGtlcm5fbW9kdWxlLmMJ
 MTAgSnVuIDIwMTYgMDI6MjI6NTUgLTAwMDANCkBAIC0xMjM1LDcgKzEyMzUs
 OSBAQCBtb2R1bGVfZG9fdW5sb2FkKGNvbnN0IGNoYXIgKm5hbWUsIGJvb2wg
 DQogaW50DQogbW9kdWxlX3ByaW1lKGNvbnN0IGNoYXIgKm5hbWUsIHZvaWQg
 KmJhc2UsIHNpemVfdCBzaXplKQ0KIHsNCisJX19saW5rX3NldF9kZWNsKG1v
 ZHVsZXMsIG1vZGluZm9fdCk7DQogCW1vZHVsZV90ICptb2Q7DQorCW1vZGlu
 Zm9fdCAqY29uc3QgKm1pcDsNCiAJaW50IGVycm9yOw0KIA0KIAltb2QgPSBt
 b2R1bGVfbmV3bW9kdWxlKE1PRFVMRV9TT1VSQ0VfQk9PVCk7DQpAQCAtMTI0
 Myw2ICsxMjQ1LDE2IEBAIG1vZHVsZV9wcmltZShjb25zdCBjaGFyICpuYW1l
 LCB2b2lkICpiYXMNCiAJCXJldHVybiBFTk9NRU07DQogCX0NCiANCisJLyog
 Q2hlY2sgZm9yIGR1cGxpY2F0ZSBtb2R1bGVzICovDQorDQorCV9fbGlua19z
 ZXRfZm9yZWFjaChtaXAsIG1vZHVsZXMpIHsNCisJCWlmIChzdHJjbXAoKCpt
 aXApLT5taV9uYW1lLCBuYW1lKSA9PSAwKSB7DQorCQkJbW9kdWxlX3ByaW50
 KCJNb2R1bGUgYCVzJyBwdXNoZWQgYnkgYm9vdCBsb2FkZXIgIg0KKwkJCSAg
 ICAiYWxyZWFkeSBleGlzdHMuIiwgbmFtZSk7DQorCQkJcmV0dXJuIEVFWElT
 VDsNCisJCX0NCisJfQ0KKw0KIAllcnJvciA9IGtvYmpfbG9hZF9tZW0oJm1v
 ZC0+bW9kX2tvYmosIG5hbWUsIGJhc2UsIHNpemUpOw0KIAlpZiAoZXJyb3Ig
 IT0gMCkgew0KIAkJa21lbV9mcmVlKG1vZCwgc2l6ZW9mKCptb2QpKTsNCkBA
 IC0xMjU0LDggKzEyNjYsOCBAQCBtb2R1bGVfcHJpbWUoY29uc3QgY2hhciAq
 bmFtZSwgdm9pZCAqYmFzDQogCWlmIChlcnJvciAhPSAwKSB7DQogCQlrb2Jq
 X3VubG9hZChtb2QtPm1vZF9rb2JqKTsNCiAJCWttZW1fZnJlZShtb2QsIHNp
 emVvZigqbW9kKSk7DQotCQltb2R1bGVfZXJyb3IoInVuYWJsZSB0byBsb2Fk
 IGAlcycgcHVzaGVkIGJ5IGJvb3QgbG9hZGVyLCAiDQotCQkgICAgImVycm9y
 ICVkIiwgbmFtZSwgZXJyb3IpOw0KKwkJbW9kdWxlX2Vycm9yKCJ1bmFibGUg
 dG8gZmV0Y2hfaW5mbyBmb3IgYCVzJyBwdXNoZWQgYnkgYm9vdCAiDQorCQkg
 ICAgImxvYWRlciwgZXJyb3IgJWQiLCBuYW1lLCBlcnJvcik7DQogCQlyZXR1
 cm4gZXJyb3I7DQogCX0NCiANCg==

 --0-538362010-1465525766=:25798--

From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: install/50357: Erroneous attempt to load booted file-system's
 module
Date: Fri, 10 Jun 2016 10:30:59 +0800 (PHT)

 And, here's a copy of the patch in plain-text:

 Index: kern_module.c
 ===================================================================
 RCS file: /cvsroot/src/sys/kern/kern_module.c,v
 retrieving revision 1.110
 diff -u -p -r1.110 kern_module.c
 --- kern_module.c	6 Feb 2016 22:48:07 -0000	1.110
 +++ kern_module.c	10 Jun 2016 02:22:55 -0000
 @@ -1235,7 +1235,9 @@ module_do_unload(const char *name, bool
   int
   module_prime(const char *name, void *base, size_t size)
   {
 +	__link_set_decl(modules, modinfo_t);
   	module_t *mod;
 +	modinfo_t *const *mip;
   	int error;

   	mod = module_newmodule(MODULE_SOURCE_BOOT);
 @@ -1243,6 +1245,16 @@ module_prime(const char *name, void *bas
   		return ENOMEM;
   	}

 +	/* Check for duplicate modules */
 +
 +	__link_set_foreach(mip, modules) {
 +		if (strcmp((*mip)->mi_name, name) == 0) {
 +			module_print("Module `%s' pushed by boot loader "
 +			    "already exists.", name);
 +			return EEXIST;
 +		}
 +	}
 +
   	error = kobj_load_mem(&mod->mod_kobj, name, base, size);
   	if (error != 0) {
   		kmem_free(mod, sizeof(*mod));
 @@ -1254,8 +1266,8 @@ module_prime(const char *name, void *bas
   	if (error != 0) {
   		kobj_unload(mod->mod_kobj);
   		kmem_free(mod, sizeof(*mod));
 -		module_error("unable to load `%s' pushed by boot loader, "
 -		    "error %d", name, error);
 +		module_error("unable to fetch_info for `%s' pushed by boot "
 +		    "loader, error %d", name, error);
   		return error;
   	}


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

Responsible-Changed-From-To: install-manager->pgoyette
Responsible-Changed-By: pgoyette@NetBSD.org
Responsible-Changed-When: Fri, 10 Jun 2016 02:37:02 +0000
Responsible-Changed-Why:
I'm working on it


State-Changed-From-To: open->analyzed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Fri, 10 Jun 2016 02:37:02 +0000
State-Changed-Why:
Proposed fix has been added to audit trail.  Waiting for any comments
that might arrive.


From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50357: warning message from anita
Date: Wed, 15 Jun 2016 09:24:59 +0800 (PHT)

 Here's a revised patch, which avoids dereferencing an unitialized 
 mi_name pointer for the "dummy_module" (which is used to make sure that 
 the linkset for module pointers is never empty).

 I plan to commit this on Friday unless there are any objections.

 Check for duplicate module names before loading modules that were
 "pushed" by the boot loader.  Under some circumstances, the boot
 loader still pushes in the module name for the root file system
 (particularly on amd64 INSTALL builds, where MEMORY_DISK_HOOKS and
 MEMORY_DISK_DYNAMIC are defined);  when this happens, we get a lot
 of "redefined symbol" error messages because the file system
 module is already loaded.

 This fix does not alter the behavior of pushing the file system
 name.  It simply avoids the redefined symbol errors by detecting
 that the module is already built-in to the kernel and not trying
 to load another copy.

 While here, differentiate the error message text between "failed
 to load" and "failed to fetch_info" conditions.


 Index: kern_module.c
 ===================================================================
 RCS file: /cvsroot/src/sys/kern/kern_module.c,v
 retrieving revision 1.110
 diff -u -p -r1.110 kern_module.c
 --- kern_module.c	6 Feb 2016 22:48:07 -0000	1.110
 +++ kern_module.c	14 Jun 2016 11:39:08 -0000
 @@ -1235,6 +1235,8 @@ module_do_unload(const char *name, bool
   int
   module_prime(const char *name, void *base, size_t size)
   {
 +	__link_set_decl(modules, modinfo_t);
 +	modinfo_t *const *mip;
   	module_t *mod;
   	int error;

 @@ -1243,6 +1245,18 @@ module_prime(const char *name, void *bas
   		return ENOMEM;
   	}

 +	/* Check for duplicate modules */
 +
 +	__link_set_foreach(mip, modules) {
 +		if (*mip == &module_dummy)
 +			continue;
 +		if (strcmp((*mip)->mi_name, name) == 0) {
 +			module_error("module `%s' pushed by boot loader "
 +			    "already exists", name);
 +			kmem_free(mod, sizeof(*mod));
 +			return EEXIST;
 +		}
 +	}
   	error = kobj_load_mem(&mod->mod_kobj, name, base, size);
   	if (error != 0) {
   		kmem_free(mod, sizeof(*mod));
 @@ -1254,8 +1268,8 @@ module_prime(const char *name, void *bas
   	if (error != 0) {
   		kobj_unload(mod->mod_kobj);
   		kmem_free(mod, sizeof(*mod));
 -		module_error("unable to load `%s' pushed by boot loader, "
 -		    "error %d", name, error);
 +		module_error("unable to fetch_info for `%s' pushed by boot "
 +		    "loader, error %d", name, error);
   		return error;
   	}



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

From: "Paul Goyette" <pgoyette@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50357 CVS commit: src/sys/kern
Date: Thu, 16 Jun 2016 23:09:44 +0000

 Module Name:	src
 Committed By:	pgoyette
 Date:		Thu Jun 16 23:09:44 UTC 2016

 Modified Files:
 	src/sys/kern: kern_module.c

 Log Message:
 Check for duplicate module names before loading modules that were
 "pushed" by the boot loader.  The boot loader pushes the module
 name for the root file system (unless the root file system is ffs)
 even if the file system module is built into the kernel.  When
 this happens, we get a lot of "redefined symbol" error messages.

 This fix does not alter the behavior of pushing the file system
 name.  It simply avoids the redefined symbol errors by detecting
 that the module is already built-in to the kernel and not trying
 to load another copy.

 While here, differentiate the error message text between "failed
 to load" and "failed to fetch_info" conditions.

 Addresses PR kern/50357


 To generate a diff of this commit:
 cvs rdiff -u -r1.110 -r1.111 src/sys/kern/kern_module.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: analyzed->pending-pullups
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Thu, 16 Jun 2016 23:14:17 +0000
State-Changed-Why:
Waiting for pull-up to netbsd-7 and netbsd-7-0 - request 7-1183


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50357 CVS commit: [netbsd-7] src/sys/kern
Date: Sun, 10 Jul 2016 09:38:38 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Jul 10 09:38:38 UTC 2016

 Modified Files:
 	src/sys/kern [netbsd-7]: kern_module.c

 Log Message:
 Pull up following revision(s) (requested by pgoyette in ticket #1183):
 	sys/kern/kern_module.c: revision 1.111
 Check for duplicate module names before loading modules that were
 "pushed" by the boot loader.  The boot loader pushes the module
 name for the root file system (unless the root file system is ffs)
 even if the file system module is built into the kernel.  When
 this happens, we get a lot of "redefined symbol" error messages.
 This fix does not alter the behavior of pushing the file system
 name.  It simply avoids the redefined symbol errors by detecting
 that the module is already built-in to the kernel and not trying
 to load another copy.
 While here, differentiate the error message text between "failed
 to load" and "failed to fetch_info" conditions.
 Addresses PR kern/50357


 To generate a diff of this commit:
 cvs rdiff -u -r1.97.2.2 -r1.97.2.3 src/sys/kern/kern_module.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: pgoyette@NetBSD.org
State-Changed-When: Sun, 10 Jul 2016 09:45:16 +0000
State-Changed-Why:
Pullups complete


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.