2001-03-21 09:45:13

by Antwerpen, Oliver

[permalink] [raw]
Subject: How to provoke kernel panic

Moin,

Could someone kindly tell me how to provoke a kernel panic? I need to do so
for testing some applications regarding system crash awareness.

Olli


2001-03-21 10:09:33

by Keith Owens

[permalink] [raw]
Subject: Re: How to provoke kernel panic

On Wed, 21 Mar 2001 10:43:25 +0100,
"Antwerpen, Oliver" <[email protected]> wrote:
>Could someone kindly tell me how to provoke a kernel panic? I need to do so
>for testing some applications regarding system crash awareness.

Create fs/example-module.c

#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>

int init_module(void)
{
printk("module loading\n");
panic("test panic\n");
return 0;
}

Add "obj-m += example-module.o" to fs/Makefile.
make modules, insmod fs/example-module.o and watch the bits fly.

2001-03-21 13:55:51

by Richard B. Johnson

[permalink] [raw]
Subject: Re: How to provoke kernel panic

On Wed, 21 Mar 2001, Antwerpen, Oliver wrote:

> Moin,
>
> Could someone kindly tell me how to provoke a kernel panic? I need to do so
> for testing some applications regarding system crash awareness.
>
> Olli
> -

If you want a real crash, rather than an induced panic(), just:

`cp /dev/zero /dev/mem`

.... from the root account.


This will demonstrate that most 'crash detector' programs are
worthless (including some watchdog timers).

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.