lkcd
[Top] [All Lists]

Re: How to crash system?

To: "Marco Shaw" <marco@xxxxxxxxxxx>
Subject: Re: How to crash system?
From: Jan IVEN <jan.iven@xxxxxxx>
Date: 28 Apr 2000 18:07:39 +0200
Cc: <lkcd@xxxxxxxxxxx>
In-reply-to: "Marco Shaw"'s message of "Fri, 28 Apr 2000 11:30:49 -0300"
References: <20000428143202.AAA22395@xxxxxxxxxxxxxxxxxx@Lxxxx.nbtel.nb.ca>
Sender: owner-lkcd@xxxxxxxxxxx
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.6
>>>>> "Marco" == Marco Shaw <marco@xxxxxxxxxxx> writes:

 Marco> I want to run through some crash scenarios during an upcoming
 Marco> presentation.  So I need to crash my system and produce a good
 Marco> dump.

 Marco> How could I produce such results with the 2.2.13 SGI-enhanced
 Marco> kernel?

No idea about the SGI-enhanced kernel. Besides from the things in the
LKCD FAQ, I tried these (but not on LKCD, since it doesn't support IDE
on 2.2 kernels):

+ a magic SysRq for crash: doesn't work reliably, since it is being
  called inside the keyboard interrupt handler -- this leads to the
  interrupt handler being killed most of the time, nothing will be
  written to disk afterwards. Might work with the "in memory" dump
  facilities of mclinux, didn't try these. The mclinux crash dump
  patch already contains this sysrq.

+ a dummy module that calls panic: works for me. Just compile and
  insmod. Please share your experiences.

Regards
Jan


/* crash.c 
 * adapted from hello.c ("Hello, world" module) by Ori Pomerantz
 */

/* The necessary header files */

/* Standard in kernel modules */
#include <linux/kernel.h>   /* We're doing kernel work */
#include <linux/module.h>   /* Specifically, a module */
#include <linux/types.h>

/* Deal with CONFIG_MODVERSIONS */
#if CONFIG_MODVERSIONS==1
#define MODVERSIONS
#include <linux/modversions.h>
#endif        

/* Initialize the module */
int init_module()
{
  printk("Goodbye, World: calling panic()\n");
  panic("poisoned module");
  /* shouldn't reach this point */
  return 0;
}

/* Cleanup - undid whatever init_module did */
void cleanup_module()
{
  printk("Short is the life of a kernel module\n");
}

<Prev in Thread] Current Thread [Next in Thread>