kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Linux module for causing a system hard lock-up
@ 2011-06-08 19:27 limp
  2011-06-08 20:12 ` Daniel Baluta
  2011-06-09  4:28 ` Michael Blizek
  0 siblings, 2 replies; 12+ messages in thread
From: limp @ 2011-06-08 19:27 UTC (permalink / raw)
  To: kernelnewbies

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-06-30  9:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-08 19:27 Linux module for causing a system hard lock-up limp
2011-06-08 20:12 ` Daniel Baluta
2011-06-08 22:24   ` limp
2011-06-08 22:53     ` Jeff Haran
2011-06-08 22:53     ` Greg KH
2011-06-09  4:28 ` Michael Blizek
2011-06-09  4:46   ` Michael Blizek
2011-06-09  7:06     ` Mulyadi Santosa
2011-06-14 20:23       ` limp
2011-06-14 21:36         ` João Eduardo Luís
2011-06-28 14:35           ` hlist_add_head luca ellero
     [not found]             ` <BANLkTikb1ungKEJ_WoHOpMG+=-sHcFb5ag@mail.gmail.com>
2011-06-30  9:18               ` hlist_add_head piyush moghe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).