Linux module for causing a system hard lock-up

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

 



Hi all,

I am trying to hard lockup my Linux system (Debian) for evaluating some
crash report mechanism.
Basically, what I want to do is to load a module that will cause a
non-interruptible hang.

I found the following code on this website
(http://oslearn.blogspot.com/2011/04/use-nmi-watchdog.html), but the module
fails to hard lockup my system:


#include <linux/module.h>
#include <linux/kernel.h>   /* printk() */

int init_module(void)
{
    unsigned long flags;
    static spinlock_t lock;
    spin_lock_init(&lock);
    spin_lock_irqsave(&lock, flags);
    printk(KERN_INFO "Hello, world\n");
    spin_lock_irqsave(&lock, flags);
    //spin_lock(&lock);
    printk(KERN_INFO "Hello, world\n");
    return 0;
}

void cleanup_module(void)
{
    printk(KERN_INFO "Goodbye cruel world\n");
}


Could anyone please let me know how can I achieve this?

Thanks in advance.

John K.


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux