lkml.org 
[lkml]   [1999]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: Oops+Panic report - quite long
    hi,

    Sorry about the last mail. insmod dumps core because I did not recompile
    my driver after adding the patch.

    I am sorry to say that your patch did not help much at all. The ksymoops
    o/p of 'insmod driver.o' is exactly the same as before.

    ksymoops 0.7c on i586 2.2.10. Options used
    -v /usr/src/linux/vmlinux (specified)
    -k /proc/ksyms (default)
    -l /proc/modules (default)
    -o /home/rajukv/pqs/driver (specified)
    -m /usr/src/linux/System.map (default)

    No modules in ksyms, skipping objects
    Warning (read_lsmod): no symbols in lsmod, is /proc/modules a valid
    lsmod file?
    Unable to handle kernel NULL pointer dereference at virtual address
    0000002c
    current->tss.cr3 = 0048b000, %cr3 = 0048b000
    *pde = 00000000
    Oops: 0000
    CPU: 0
    EIP: 0010:[<c281832d>]
    Using defaults from ksymoops -t elf32-i386 -a i386
    EFLAGS: 00010286
    eax: 00000000 ebx: 00000000 ecx: 00000000 edx: c282b7b0
    esi: 00000000 edi: 0000007f ebp: c154fe8c esp: c154fe5c
    ds: 0018 es: 0018 ss: 0018
    Process insmod (pid: 590, process nr: 48, stackpage=c154f000)
    Stack: 0000007f 00000001 00000000 c154fe84 00000001 00000000 00000bb8
    c1cfb278
    00000000 00026c7f c1cfb000 c154feb0 c154feb0 c0112096 00000000
    00000001
    c0224a20 00000000 00000001 ffffff0f c0118b23 c154fecc c0118b45
    c154fed4
    Call Trace: [<c0112096>] [<c0118b23>] [<c0118b45>] [<c281004c>]
    [<c01099e2>] [<c
    281a880>] [<c0107acc>]
    [<c281004c>] [<c281a880>] [<c018c9f9>] [<c281a880>] [<c281004c>]
    [<c01afd
    8c>] [<c018d21e>] [<c281a880>]
    [<c2810000>] [<c2810069>] [<c281a880>] [<c01161a7>] [<c2810000>]
    [<c282b8
    1c>] [<c2810048>] [<c0107a30>]
    [<c2810000>]
    Code: 8b 40 2c 8b 40 0c 8b 00 89 45 fc 8b 4d fc 8b 51 2c 83 ba 40

    >>EIP; c281832d <END_OF_CODE+25e7629/????> <=====
    Trace; c0112096 <timer_bh+37a/3ec>
    Trace; c0118b23 <do_bottom_half+5f/a0>
    Trace; c0118b45 <do_bottom_half+81/a0>
    Trace; c281004c <END_OF_CODE+25df348/????>
    Trace; c01099e2 <do_IRQ+52/5c>
    Trace; c281a880 <END_OF_CODE+25e9b7c/????>
    Trace; c0107acc <ret_from_intr+0/20>
    Trace; c281004c <END_OF_CODE+25df348/????>
    Trace; c281a880 <END_OF_CODE+25e9b7c/????>
    Trace; c018c9f9 <scsi_register_host+59/264>
    Trace; c281a880 <END_OF_CODE+25e9b7c/????>
    Trace; c281004c <END_OF_CODE+25df348/????>
    Trace; c01afd8c <__generic_copy_from_user+30/40>
    Trace; c018d21e <scsi_register_module+2a/5c>
    Trace; c281a880 <END_OF_CODE+25e9b7c/????>
    Trace; c2810000 <END_OF_CODE+25df2fc/????>
    Trace; c2810069 <END_OF_CODE+25df365/????>
    Trace; c281a880 <END_OF_CODE+25e9b7c/????>
    Trace; c01161a7 <sys_init_module+46b/4ec>
    Trace; c2810000 <END_OF_CODE+25df2fc/????>
    Trace; c282b81c <END_OF_CODE+25fab18/????>
    Trace; c2810048 <END_OF_CODE+25df344/????>
    Trace; c0107a30 <system_call+34/38>
    Trace; c2810000 <END_OF_CODE+25df2fc/????>
    Code; c281832d <END_OF_CODE+25e7629/????>
    00000000 <_EIP>:
    Code; c281832d <END_OF_CODE+25e7629/????> <=====
    0: 8b 40 2c mov 0x2c(%eax),%eax <=====
    Code; c2818330 <END_OF_CODE+25e762c/????>
    3: 8b 40 0c mov 0xc(%eax),%eax
    Code; c2818333 <END_OF_CODE+25e762f/????>
    6: 8b 00 mov (%eax),%eax
    Code; c2818335 <END_OF_CODE+25e7631/????>
    8: 89 45 fc mov %eax,0xfffffffc(%ebp)
    Code; c2818338 <END_OF_CODE+25e7634/????>
    b: 8b 4d fc mov 0xfffffffc(%ebp),%ecx
    Code; c281833b <END_OF_CODE+25e7637/????>
    e: 8b 51 2c mov 0x2c(%ecx),%edx
    Code; c281833e <END_OF_CODE+25e763a/????>
    11: 83 ba 40 00 00 00 00 cmpl $0x0,0x40(%edx)

    Aiee, killing interrupt handler
    Unable to handle kernel NULL pointer dereference at virtual address
    00000000
    current->tss.cr3 = 00101000, %cr3 = 00101000
    *pde = 00000000
    Oops: 0002
    CPU: 0
    EIP: 0010:[<c01111c2>]
    EFLAGS: 00010282
    eax: 00000018 ebx: c154e000 ecx: 00000005 edx: c19a0000
    esi: 00000000 edi: c154e000 ebp: c154fdbc esp: c154fd98
    ds: 0018 es: 0018 ss: 0018
    Process insmod (pid: 590, process nr: 48, stackpage=c154f000)
    Stack: 00000000 c154e000 00000000 c0117789 c154e000 c154e000 00000000
    00000000
    c154e000 00000021 c0117b75 c154fe20 00000000 0000002c c154e000
    c1284800
    c128488c c154e000 c0107f1b 0000000b 00000000 c010ec78 c01b77ee
    c154fe20
    Call Trace: [<c0117789>] [<c0117b75>] [<c0107f1b>] [<c010ec78>]
    [<c01b77ee>] [<c0107b35>] [<c282b7b0>]
    [<c281832d>] [<c28182b0>] [<c0112096>] [<c0118b23>] [<c0118b45>]
    [<c28100
    4c>] [<c01099e2>] [<c281a880>]
    [<c0107acc>] [<c281004c>] [<c281a880>] [<c018c9f9>] [<c281a880>]
    [<c28100
    4c>] [<c01afd8c>] [<c018d21e>]
    [<c281a880>] [<c2810000>] [<c2810069>] [<c281a880>] [<c01161a7>]
    [<c28100
    00>] [<c282b81c>] [<c2810048>]
    [<c0107a30>] [<c2810000>]
    Code: c7 05 00 00 00 00 00 00 00 00 8d 65 d8 5b 5e 5f 89 ec 5d c3

    >>EIP; c01111c2 <schedule+3ae/3c4> <=====
    Trace; c0117789 <exit_notify+f5/24c>
    Trace; c0117b75 <do_exit+295/29c>
    Trace; c0107f1b <die+53/54>
    Trace; c010ec78 <do_page_fault+2cc/31c>
    Trace; c01b77ee <lk_lockmsg+166e/1740>
    Trace; c0107b35 <error_code+2d/34>
    Trace; c282b7b0 <END_OF_CODE+25faaac/????>
    Trace; c281832d <END_OF_CODE+25e7629/????>
    Trace; c28182b0 <END_OF_CODE+25e75ac/????>
    Trace; c0112096 <timer_bh+37a/3ec>
    Trace; c0118b23 <do_bottom_half+5f/a0>
    Trace; c0118b45 <do_bottom_half+81/a0>
    Trace; c281004c <END_OF_CODE+25df348/????>
    Trace; c01099e2 <do_IRQ+52/5c>
    Trace; c281a880 <END_OF_CODE+25e9b7c/????>
    Trace; c0107acc <ret_from_intr+0/20>
    Trace; c281004c <END_OF_CODE+25df348/????>
    Trace; c281a880 <END_OF_CODE+25e9b7c/????>
    Trace; c018c9f9 <scsi_register_host+59/264>
    Trace; c281a880 <END_OF_CODE+25e9b7c/????>
    Trace; c281004c <END_OF_CODE+25df348/????>
    Trace; c01afd8c <__generic_copy_from_user+30/40>
    Trace; c018d21e <scsi_register_module+2a/5c>
    Trace; c281a880 <END_OF_CODE+25e9b7c/????>
    Trace; c2810000 <END_OF_CODE+25df2fc/????>
    Trace; c2810069 <END_OF_CODE+25df365/????>
    Trace; c281a880 <END_OF_CODE+25e9b7c/????>
    Trace; c01161a7 <sys_init_module+46b/4ec>
    Trace; c2810000 <END_OF_CODE+25df2fc/????>
    Trace; c282b81c <END_OF_CODE+25fab18/????>
    Trace; c2810048 <END_OF_CODE+25df344/????>
    Trace; c0107a30 <system_call+34/38>
    Trace; c2810000 <END_OF_CODE+25df2fc/????>
    Code; c01111c2 <schedule+3ae/3c4>
    00000000 <_EIP>:
    Code; c01111c2 <schedule+3ae/3c4> <=====
    0: c7 05 00 00 00 00 00 movl $0x0,0x0 <=====
    Code; c01111c9 <schedule+3b5/3c4>
    7: 00 00 00
    Code; c01111cc <schedule+3b8/3c4>
    a: 8d 65 d8 lea 0xffffffd8(%ebp),%esp
    Code; c01111cf <schedule+3bb/3c4>
    d: 5b pop %ebx
    Code; c01111d0 <schedule+3bc/3c4>
    e: 5e pop %esi
    Code; c01111d1 <schedule+3bd/3c4>
    f: 5f pop %edi
    Code; c01111d2 <schedule+3be/3c4>
    10: 89 ec mov %ebp,%esp
    Code; c01111d4 <schedule+3c0/3c4>
    12: 5d pop %ebp
    Code; c01111d5 <schedule+3c1/3c4>
    13: c3 ret

    Aiee, killing interrupt handler


    And this goes on as before.

    Also, please note that this module is not loaded during initialization.
    I am manually trying to load it using insmod.

    Thanks in advance,
    Raju

    On Sat, Nov 27, 1999 at 02:35:16PM +0530, Raju K V [rajukv@wipinfo.soft.net] wrote:
    > hi,
    >
    > I added the patch (manually, since patch failed).
    > But I get a core dump when I do insmod.
    > I am listing the gdb output of insmod.
    >
    > [root@linpqs /home/rajukv/driver]# insmod driver.o
    > Segmentation fault
    > [root@linpqs /home/rajukv/driver]# gdb insmod
    > GNU gdb 4.17.0.4 with Linux/x86 hardware watchpoint and FPU support
    > Copyright 1998 Free Software Foundation, Inc.
    > GDB is free software, covered by the GNU General Public License, and you are
    > welcome to change it and/or distribute copies of it under certain conditions.
    > Type "show copying" to see the conditions.
    > There is absolutely no warranty for GDB. Type "show warranty" for details.
    > This GDB was configured as "i386-redhat-linux"...
    > (gdb) r driver.o
    > Starting program: /sbin/insmod driver.o
    >
    > Program received signal SIGSEGV, Segmentation fault.
    > 0x804dac9 in obj_add_symbol (f=0x805d068, name=0x80522f3 "__this_module",
    > symidx=4294967295, info=1, secidx=12, value=0, size=76) at obj_common.c:171
    > 171 f->local_symtab[symidx] = sym;
    > (gdb) b obj_add_symbol
    > Breakpoint 1 at 0x804d94d: file obj_common.c, line 94.
    > (gdb) r
    > The program being debugged has been started already.
    > Start it from the beginning? (y or n) y
    > Starting program: /sbin/insmod driver.o
    >
    > Breakpoint 1, obj_add_symbol (f=0x805d068, name=0x80522f3 "__this_module",
    > symidx=4294967295, info=1, secidx=12, value=0, size=76) at obj_common.c:94
    > 94 unsigned long hash = f->symbol_hash(name) % HASH_BUCKETS;
    > (gdb) n
    > 95 int n_type = ELFW(ST_TYPE)(info);
    > (gdb)
    > 96 int n_binding = ELFW(ST_BIND)(info);
    > (gdb)
    > 98 for (sym = f->symtab[hash]; sym; sym = sym->next)
    > (gdb)
    > 165 sym = arch_new_symbol();
    > (gdb)
    > 166 sym->next = f->symtab[hash];
    > (gdb)
    > 167 f->symtab[hash] = sym;
    > (gdb)
    > 168 sym->ksymidx = -1;
    > (gdb)
    > 170 if (ELFW(ST_BIND)(info) == STB_LOCAL)
    > (gdb)
    > 171 f->local_symtab[symidx] = sym;
    > (gdb)
    >
    > Program received signal SIGSEGV, Segmentation fault.
    > 0x804dac9 in obj_add_symbol (f=0x805d068, name=0x80522f3 "__this_module",
    > symidx=4294967295, info=1, secidx=12, value=0, size=76) at obj_common.c:171
    > 171 f->local_symtab[symidx] = sym;
    > (gdb) q
    > The program is running. Exit anyway? (y or n) y
    >
    > insmod -V
    > insmod version 2.2.2-pre6
    > Usage:
    > insmod [-fkmopsvVxXyY] [-o name] [-P prefix] module [[sym=value]...]
    >
    > module Filename of a loadable kernel module (*.o)
    > -f, --force Force loading under wrong kernel version
    > -k, --autoclean Make module autoclean-able
    > -m, --map Generate load map (so crashes can be traced)
    > -n, --noload Don't load, just show
    > -o NAME, --name=NAME Set internal module name to NAME
    > -p, --poll Poll mode; check if the module matches the
    > kernel
    > -s, --syslog Report errors via syslog
    > -v, --verbose Verbose output
    > -L, --lock Prevent simultaneous loads of the same module
    > -V, --version Show version
    > -x Do not export externs
    > -X Do export externs (default)
    > -y Do not add ksymoops symbols
    > -Y Do add ksymoops symbols (default)
    > -P PREFIX
    > --prefix=PREFIX Prefix for kernel or module symbols
    >
    > Thanks in advance,
    > Raju
    >
    > On Sat, Nov 27, 1999 at 04:36:19AM +1100, Keith Owens [kaos@ocs.com.au] wrote:
    > > On Fri, 26 Nov 1999 17:57:35 +0530,
    > > Raju K V <rajukv@wipinfo.soft.net> wrote:
    > > >While loading my SCSI HBA driver with
    > > >insmod driver.o
    > > >I get the foll never ending Oops+panic. Here is the ksymoops o/p:
    > > >No modules in ksyms, skipping objects
    > > >EIP: 0010:[<c281832d>]
    > > >>>EIP; c281832d <END_OF_CODE+25e7629/????> <=====
    > >
    > > When modules fail during initialization they are left in limbo. The
    > > module is loaded, symbols are stored, dependencies are logged but the
    > > kernel refuses to let programs query the module because it is not
    > > marked as running yet. Apply this patch against 2.2.10 and you will be
    > > able to get symbols for modules that fail during initialization.
    > > Reproduce the problem, feed the new log through ksymoops and you should
    > > get symbols this time.
    > >
    > > Index: 10.1/kernel/module.c
    > > --- 10.1/kernel/module.c Fri, 05 Feb 1999 09:47:48 +1100 keith (linux-2.2/h/18_module.c 1.1 644)
    > > +++ 10.1(w)/kernel/module.c Sat, 27 Nov 1999 04:29:01 +1100 keith (linux-2.2/h/18_module.c 1.1 644)
    > > @@ -13,6 +13,7 @@
    > > * 0.99.14 version by Jon Tombs <jon@gtex02.us.es>,
    > > * Heavily modified by Bjorn Ekwall <bj0rn@blox.se> May 1994 (C)
    > > * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
    > > + * Add MOD_INITIALIZING Keith Owens <kaos@ocs.com.au> Nov 1999
    > > *
    > > * This source is covered by the GNU GPL, the same as all kernel sources.
    > > */
    > > @@ -329,16 +330,18 @@
    > > put_mod_name(name);
    > >
    > > /* Initialize the module. */
    > > + mod->flags |= MOD_INITIALIZING;
    > > atomic_set(&mod->uc.usecount,1);
    > > if (mod->init && mod->init() != 0) {
    > > atomic_set(&mod->uc.usecount,0);
    > > + mod->flags &= ~MOD_INITIALIZING;
    > > error = -EBUSY;
    > > goto err0;
    > > }
    > > atomic_dec(&mod->uc.usecount);
    > >
    > > /* And set it running. */
    > > - mod->flags |= MOD_RUNNING;
    > > + mod->flags = (mod->flags | MOD_RUNNING) & ~MOD_INITIALIZING;
    > > error = 0;
    > > goto err0;
    > >
    > > @@ -462,7 +465,7 @@
    > >
    > > if (mod == &kernel_module)
    > > return -EINVAL;
    > > - if ((mod->flags & (MOD_RUNNING | MOD_DELETED)) != MOD_RUNNING)
    > > + if (!MOD_CAN_QUERY(mod))
    > > if (put_user(0, ret))
    > > return -EFAULT;
    > > else
    > > @@ -506,7 +509,7 @@
    > >
    > > if (mod == &kernel_module)
    > > return -EINVAL;
    > > - if ((mod->flags & (MOD_RUNNING | MOD_DELETED)) != MOD_RUNNING)
    > > + if (!MOD_CAN_QUERY(mod))
    > > if (put_user(0, ret))
    > > return -EFAULT;
    > > else
    > > @@ -550,7 +553,7 @@
    > > char *strings;
    > > unsigned long *vals;
    > >
    > > - if ((mod->flags & (MOD_RUNNING | MOD_DELETED)) != MOD_RUNNING)
    > > + if (!MOD_CAN_QUERY(mod))
    > > if (put_user(0, ret))
    > > return -EFAULT;
    > > else
    > > @@ -716,7 +719,7 @@
    > > struct module_symbol *msym;
    > > unsigned int j;
    > >
    > > - if ((mod->flags & (MOD_RUNNING|MOD_DELETED)) != MOD_RUNNING)
    > > + if (!MOD_CAN_QUERY(mod))
    > > continue;
    > >
    > > /* magic: write module info as a pseudo symbol */
    > > @@ -865,7 +868,10 @@
    > > safe_copy_cstr(" (autoclean)");
    > > if (!(mod->flags & MOD_USED_ONCE))
    > > safe_copy_cstr(" (unused)");
    > > - } else
    > > + }
    > > + else if (mod->flags & MOD_INITIALIZING)
    > > + safe_copy_cstr(" (initializing)");
    > > + else
    > > safe_copy_cstr(" (uninitialized)");
    > >
    > > if ((ref = mod->refs) != NULL) {
    > > @@ -909,7 +915,7 @@
    > > unsigned i;
    > > struct module_symbol *sym;
    > >
    > > - if (!(mod->flags & MOD_RUNNING) || (mod->flags & MOD_DELETED))
    > > + if (!MOD_CAN_QUERY(mod))
    > > continue;
    > >
    > > for (i = mod->nsyms, sym = mod->syms; i > 0; --i, ++sym) {
    > > @@ -957,7 +963,7 @@
    > >
    > > for (mp = module_list; mp; mp = mp->next) {
    > > if (((modname == NULL) || (strcmp(mp->name, modname) == 0)) &&
    > > - (mp->flags & (MOD_RUNNING | MOD_DELETED)) == MOD_RUNNING &&
    > > + MOD_CAN_QUERY(mp) &&
    > > (mp->nsyms > 0)) {
    > > for (i = mp->nsyms, sym = mp->syms;
    > > i > 0; --i, ++sym) {
    > > Index: 10.1/include/linux/module.h
    > > --- 10.1/include/linux/module.h Fri, 05 Feb 1999 09:47:48 +1100 keith (linux-2.2/F/51_module.h 1.1 644)
    > > +++ 10.1(w)/include/linux/module.h Sat, 27 Nov 1999 04:29:01 +1100 keith (linux-2.2/F/51_module.h 1.1 644)
    > > @@ -101,6 +101,7 @@
    > > #define MOD_VISITED 8
    > > #define MOD_USED_ONCE 16
    > > #define MOD_JUST_FREED 32
    > > +#define MOD_INITIALIZING 64
    > >
    > > /* Values for query_module's which. */
    > >
    > > @@ -109,6 +110,9 @@
    > > #define QM_REFS 3
    > > #define QM_SYMBOLS 4
    > > #define QM_INFO 5
    > > +
    > > +/* Can the module be queried? */
    > > +#define MOD_CAN_QUERY(mod) (((mod)->flags & (MOD_RUNNING | MOD_INITIALIZING)) && !((mod)->flags & MOD_DELETED))
    > >
    > > /* When struct module is extended, we must test whether the new member
    > > is present in the header received from insmod before we can use it.
    > > Index: 10.1/arch/sparc64/kernel/sys_sparc32.c
    > > --- 10.1/arch/sparc64/kernel/sys_sparc32.c Mon, 14 Jun 1999 17:28:27 +1000 keith (linux-2.2/r/b/30_sys_sparc3 1.3 644)
    > > +++ 10.1(w)/arch/sparc64/kernel/sys_sparc32.c Sat, 27 Nov 1999 04:29:01 +1100 keith (linux-2.2/r/b/30_sys_sparc3 1.3 644)
    > > @@ -3034,7 +3034,7 @@
    > >
    > > if (mod->next == NULL)
    > > return -EINVAL;
    > > - if ((mod->flags & (MOD_RUNNING | MOD_DELETED)) != MOD_RUNNING)
    > > + if (!MOD_CAN_QUERY(mod))
    > > if (put_user(0, ret))
    > > return -EFAULT;
    > > else
    > > @@ -3078,7 +3078,7 @@
    > >
    > > if (mod->next == NULL)
    > > return -EINVAL;
    > > - if ((mod->flags & (MOD_RUNNING | MOD_DELETED)) != MOD_RUNNING)
    > > + if (!MOD_CAN_QUERY(mod))
    > > if (put_user(0, ret))
    > > return -EFAULT;
    > > else
    > > @@ -3122,7 +3122,7 @@
    > > char *strings;
    > > unsigned *vals;
    > >
    > > - if ((mod->flags & (MOD_RUNNING | MOD_DELETED)) != MOD_RUNNING)
    > > + if (!MOD_CAN_QUERY(mod))
    > > if (put_user(0, ret))
    > > return -EFAULT;
    > > else

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:55    [W:0.058 / U:90.268 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site