v2.6.25: WARNING: at kernel/lockdep.c:2437 __lock_acquire+0xc69/0xfa0() - Kernel

This is a discussion on v2.6.25: WARNING: at kernel/lockdep.c:2437 __lock_acquire+0xc69/0xfa0() - Kernel ; Hi, This appears in clean v2.6.25: ------------[ cut here ]------------ WARNING: at kernel/lockdep.c:2437 __lock_acquire+0xc69/0xfa0() Pid: 1002, comm: scsi_eh_4 Not tainted 2.6.25 #379 [ ] warn_on_slowpath+0x3c/0x50 [ ] ? __lock_acquire+0x219/0xfa0 [ ] ? __lock_acquire+0x219/0xfa0 [ ] ? __kernel_text_address+0x8/0x20 [ ] ? ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: v2.6.25: WARNING: at kernel/lockdep.c:2437 __lock_acquire+0xc69/0xfa0()

  1. v2.6.25: WARNING: at kernel/lockdep.c:2437 __lock_acquire+0xc69/0xfa0()

    Hi,

    This appears in clean v2.6.25:

    ------------[ cut here ]------------
    WARNING: at kernel/lockdep.c:2437 __lock_acquire+0xc69/0xfa0()
    Pid: 1002, comm: scsi_eh_4 Not tainted 2.6.25 #379
    [] warn_on_slowpath+0x3c/0x50
    [] ? __lock_acquire+0x219/0xfa0
    [] ? __lock_acquire+0x219/0xfa0
    [] ? __kernel_text_address+0x8/0x20
    [] ? dump_trace+0xce/0x120
    [] ? save_stack_trace+0x1c/0x40
    [] ? save_trace+0x39/0xa0
    [] ? mark_lock+0x61/0x540
    [] __lock_acquire+0xc69/0xfa0
    [] ? __cancel_work_timer+0x5a/0x140
    [] ? native_sched_clock+0x5c/0xb0
    [] lock_acquire+0x6e/0x90
    [] ? ata_scsi_error+0x33/0x6a0
    [] _spin_lock_irqsave+0x26/0x60
    [] ? ata_scsi_error+0x33/0x6a0
    [] ? ata_bmdma_error_handler+0x0/0x50
    [] ata_scsi_error+0x33/0x6a0
    [] ? schedule+0x27a/0x410
    [] ? __scsi_iterate_devices+0x51/0x70
    [] ? scsi_run_host_queues+0x21/0x30
    [] scsi_error_handler+0x9e/0x4e0
    [] ? schedule+0x27a/0x410
    [] ? scsi_error_handler+0x0/0x4e0
    [] kthread+0x36/0x60
    [] ? kthread+0x0/0x60
    [] kernel_thread_helper+0x7/0x10
    =======================
    ---[ end trace 5e5d737e76fd4940 ]---

    Full log and config:

    http://folk.uio.no/vegardno/linux/log-20080420.txt
    http://folk.uio.no/vegardno/linux/config-20080420.txt

    (The bootup is from qemu for the ease of harvesting the log -- but it
    happens on real hardware too!)


    Vegard

    --
    "The animistic metaphor of the bug that maliciously sneaked in while
    the programmer was not looking is intellectually dishonest as it
    disguises that the error is the programmer's own creation."
    -- E. W. Dijkstra, EWD1036
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: v2.6.25: WARNING: at kernel/lockdep.c:2437 __lock_acquire+0xc69/0xfa0()

    On Sun, 2008-04-20 at 12:29 +0200, Vegard Nossum wrote:
    > Hi,
    >
    > This appears in clean v2.6.25:
    >
    > ------------[ cut here ]------------
    > WARNING: at kernel/lockdep.c:2437 __lock_acquire+0xc69/0xfa0()
    > Pid: 1002, comm: scsi_eh_4 Not tainted 2.6.25 #379
    > [] warn_on_slowpath+0x3c/0x50
    > [] ? __lock_acquire+0x219/0xfa0
    > [] ? __lock_acquire+0x219/0xfa0
    > [] ? __kernel_text_address+0x8/0x20
    > [] ? dump_trace+0xce/0x120
    > [] ? save_stack_trace+0x1c/0x40
    > [] ? save_trace+0x39/0xa0
    > [] ? mark_lock+0x61/0x540
    > [] __lock_acquire+0xc69/0xfa0
    > [] ? __cancel_work_timer+0x5a/0x140
    > [] ? native_sched_clock+0x5c/0xb0
    > [] lock_acquire+0x6e/0x90
    > [] ? ata_scsi_error+0x33/0x6a0
    > [] _spin_lock_irqsave+0x26/0x60
    > [] ? ata_scsi_error+0x33/0x6a0
    > [] ? ata_bmdma_error_handler+0x0/0x50
    > [] ata_scsi_error+0x33/0x6a0
    > [] ? schedule+0x27a/0x410
    > [] ? __scsi_iterate_devices+0x51/0x70
    > [] ? scsi_run_host_queues+0x21/0x30
    > [] scsi_error_handler+0x9e/0x4e0
    > [] ? schedule+0x27a/0x410
    > [] ? scsi_error_handler+0x0/0x4e0
    > [] kthread+0x36/0x60
    > [] ? kthread+0x0/0x60
    > [] kernel_thread_helper+0x7/0x10
    > =======================
    > ---[ end trace 5e5d737e76fd4940 ]---


    Indeed, quite easy to reproduce:

    diff --git a/kernel/lockdep.c b/kernel/lockdep.c
    index 81a4e4a..33901ef 100644
    --- a/kernel/lockdep.c
    +++ b/kernel/lockdep.c
    @@ -2434,6 +2434,13 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
    * the hash, not class->key.
    */
    id = class - lock_classes;
    + if (id >= MAX_LOCKDEP_KEYS) {
    + spinlock_t *slock = container_of(lock, spinlock_t, dep_map);
    +
    + printk(KERN_EMERG "magic: %x\n", slock->magic);
    + printk(KERN_EMERG "class: %p\n", class);
    + printk(KERN_EMERG "id: %u\n", id);
    + }
    if (DEBUG_LOCKS_WARN_ON(id >= MAX_LOCKDEP_KEYS))
    return 0;



    gives me:

    ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11
    magic: c050cf60
    class: c7c20e54
    id: 2265185251
    ------------[ cut here ]------------
    WARNING: at /mnt/md0/src/linux-2.6-2/kernel/lockdep.c:2444
    __lock_acquire+0x57b/0xfd0()


    Looks like someone is stomping on the spinlock or just passing us
    garbage.



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

  3. Re: v2.6.25: WARNING: at kernel/lockdep.c:2437 __lock_acquire+0xc69/0xfa0()

    Peter Zijlstra wrote:
    > On Sun, 2008-04-20 at 12:29 +0200, Vegard Nossum wrote:
    >> Hi,
    >>
    >> This appears in clean v2.6.25:
    >>
    >> ------------[ cut here ]------------
    >> WARNING: at kernel/lockdep.c:2437 __lock_acquire+0xc69/0xfa0()
    >> Pid: 1002, comm: scsi_eh_4 Not tainted 2.6.25 #379
    >> [] warn_on_slowpath+0x3c/0x50
    >> [] ? __lock_acquire+0x219/0xfa0
    >> [] ? __lock_acquire+0x219/0xfa0
    >> [] ? __kernel_text_address+0x8/0x20
    >> [] ? dump_trace+0xce/0x120
    >> [] ? save_stack_trace+0x1c/0x40
    >> [] ? save_trace+0x39/0xa0
    >> [] ? mark_lock+0x61/0x540
    >> [] __lock_acquire+0xc69/0xfa0
    >> [] ? __cancel_work_timer+0x5a/0x140
    >> [] ? native_sched_clock+0x5c/0xb0
    >> [] lock_acquire+0x6e/0x90
    >> [] ? ata_scsi_error+0x33/0x6a0
    >> [] _spin_lock_irqsave+0x26/0x60
    >> [] ? ata_scsi_error+0x33/0x6a0
    >> [] ? ata_bmdma_error_handler+0x0/0x50
    >> [] ata_scsi_error+0x33/0x6a0
    >> [] ? schedule+0x27a/0x410
    >> [] ? __scsi_iterate_devices+0x51/0x70
    >> [] ? scsi_run_host_queues+0x21/0x30
    >> [] scsi_error_handler+0x9e/0x4e0
    >> [] ? schedule+0x27a/0x410
    >> [] ? scsi_error_handler+0x0/0x4e0
    >> [] kthread+0x36/0x60
    >> [] ? kthread+0x0/0x60
    >> [] kernel_thread_helper+0x7/0x10
    >> =======================
    >> ---[ end trace 5e5d737e76fd4940 ]---

    >
    > Indeed, quite easy to reproduce:
    >
    > diff --git a/kernel/lockdep.c b/kernel/lockdep.c
    > index 81a4e4a..33901ef 100644
    > --- a/kernel/lockdep.c
    > +++ b/kernel/lockdep.c
    > @@ -2434,6 +2434,13 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
    > * the hash, not class->key.
    > */
    > id = class - lock_classes;
    > + if (id >= MAX_LOCKDEP_KEYS) {
    > + spinlock_t *slock = container_of(lock, spinlock_t, dep_map);
    > +
    > + printk(KERN_EMERG "magic: %x\n", slock->magic);
    > + printk(KERN_EMERG "class: %p\n", class);
    > + printk(KERN_EMERG "id: %u\n", id);
    > + }
    > if (DEBUG_LOCKS_WARN_ON(id >= MAX_LOCKDEP_KEYS))
    > return 0;
    >
    >
    >
    > gives me:
    >
    > ata3: PATA max PIO4 cmd 0x1e8 ctl 0x3ee irq 11
    > magic: c050cf60
    > class: c7c20e54
    > id: 2265185251
    > ------------[ cut here ]------------
    > WARNING: at /mnt/md0/src/linux-2.6-2/kernel/lockdep.c:2444
    > __lock_acquire+0x57b/0xfd0()
    >
    >
    > Looks like someone is stomping on the spinlock or just passing us
    > garbage.


    Does the attached patch help?

    --
    tejun


+ Reply to Thread