Linux module for causing a system hard lock-up

Michael Blizek michi1 at michaelblizek.twilightparadox.com
Thu Jun 9 00:28:49 EDT 2011


Hi!

On 20:27 Wed 08 Jun     , limp wrote:
> Hi all,
> 
> I am trying to hard lockup my Linux system (Debian) for evaluating some
> crash report mechanism.
...
> 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;
> }

Do you have SMP? On non-smp spin_lock_irqsave is mapped to local_irq_save().
Maybe try this:

int init_module(void)
{
	unsigned long iflags;

	local_irq_save(iflags);
	while (1) {
	}
	local_irq_restore(iflags);

	return 0;
}

	-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com




More information about the Kernelnewbies mailing list