Current-Users archive

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

Re: Recent i386-GENERIC panic



On Fri, 16 Sep 2011, John D. Baker wrote:

On Fri, 16 Sep 2011, John D. Baker wrote:

if (mod->mod_required[i])
   printf("module %s requires module %s!\n",
       mod->mod_info->mi_name, mod->mod_required[i]->mod_info->mi_name);

(It's just finished compiling.  Will try shortly.)

First I noticed that the kernel size with the above added lines was
EXACTLY the same as without it.

Very odd.

Next, no message from the above printf was ever printed.  ...

Actually, I'm not surprised - see below ...

... I thought I
might have stale objects around, so I deleted the compile/GENERIC directory and $RELEASEDIR/binary/kernel/netbsd-GENERIC.gz file and
compiled again.

As before, resulting kernel size is the same as without the printf,
no messages at all from it.

When the panic occurs, the KASSERT() line number is 695, three lines
down from stock, so the source was compiled.

I take that to mean "mod->mod_required[i]" is NULL in the "if()", but is
non-NULL in the KASSERT()!  Whisky Tango Foxtrot /IMI/ K

No, the KASSERT panics when mod->mod_required[i] _is_ NULL.

It might be more clear to use the following debug printf's:

Index: kern_module.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_module.c,v
retrieving revision 1.81
diff -u -p -r1.81 kern_module.c
--- kern_module.c       14 Sep 2011 12:29:22 -0000      1.81
+++ kern_module.c       16 Sep 2011 14:59:01 -0000
@@ -684,14 +684,19 @@ module_enqueue(module_t *mod)
         * This is so that autounload can unload requisite modules with
         * only one pass through the queue.
         */
+       printf("%s required %d modules\n", mod->mod_info->mi_name,
+               mod->nrequired);
        if (mod->mod_nrequired) {
                TAILQ_INSERT_HEAD(&module_list, mod, mod_chain);

                /* Add references to the requisite modules. */
                for (i = 0; i < mod->mod_nrequired; i++) {
+                       printf("   %s",
+                               mod->mod_required[i]->mod_info->mi_name);
                        KASSERT(mod->mod_required[i] != NULL);
                        mod->mod_required[i]->mod_refcnt++;
                }
+               printf("\n");
        } else {
                TAILQ_INSERT_TAIL(&module_list, mod, mod_chain);
        }
@@ -772,6 +777,8 @@ module_do_builtin(const char *name, modu
                                return error;
                        }
                        mod->mod_required[mod->mod_nrequired++] = mod2;
+                       if (mod2 == NULL)
+                               printf("NULL require in %s\n", __func__);
                }
        }

@@ -1036,6 +1043,8 @@ module_do_load(const char *name, bool is
                        if (error != 0)
                                goto fail;
                        mod->mod_required[mod->mod_nrequired++] = mod2;
+                       if (mod2 == NULL)
+                               printf("NULL require in %s\n", __func__);
                }
        }


In addition to printing out the dependencies, it will hopefully tell us which call is returning NULL.

-------------------------------------------------------------------------
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index