2002-02-04 11:26:45

by sathish jayapalan

[permalink] [raw]
Subject: How to crash a system and take a dump?

Hi,
I have a doubt. I know that linux kernel doesn't crash
so easily. Is there any way to panic the system? Can I
go to the source area and insert/modify a variable in
kernel code so that the kernel references a null
pointer and crashes while running the kernel compiled
with this variable. My aim is to learn crash dump
analysis with 'Lcrash tool". Please help me out with
this.

Thanks in advance,
sathish




__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions!
http://auctions.yahoo.com


2002-02-04 11:40:52

by Alexander Sandler

[permalink] [raw]
Subject: RE: How to crash a system and take a dump?

> Hi,
> I have a doubt. I know that linux kernel doesn't crash
> so easily. Is there any way to panic the system? Can I
> go to the source area and insert/modify a variable in
> kernel code so that the kernel references a null
> pointer and crashes while running the kernel compiled
> with this variable. My aim is to learn crash dump
> analysis with 'Lcrash tool". Please help me out with
> this.

Go to interrupt handler (for instance in fs/buffer.c end_buffer_io_async() )
and cause segmentation fault.
System will try to kill process that caused segmentation fault and since
it's in interrupt context will panic.

Sasha.

2002-02-04 12:32:25

by Gianni Tedesco

[permalink] [raw]
Subject: Re: How to crash a system and take a dump?

On Mon, 2002-02-04 at 11:26, sathish jayapalan wrote:
> Hi,
> I have a doubt. I know that linux kernel doesn't crash
> so easily. Is there any way to panic the system? Can I
> go to the source area and insert/modify a variable in
> kernel code so that the kernel references a null
> pointer and crashes while running the kernel compiled
> with this variable. My aim is to learn crash dump
> analysis with 'Lcrash tool". Please help me out with
> this.

Im not sure about the Lcrash tool, but core dumps can be obtained from
the kernel at any time simply by reading /proc/kcore.

Hope that helps.

--
// Gianni Tedesco <[email protected]>
80% of all email is a figment of procmails imagination.

2002-02-04 13:29:25

by Suparna Bhattacharya

[permalink] [raw]
Subject: Re: How to crash a system and take a dump?

With LKCD, you can also trigger a dump via the Alt+Sysrq+c key.
If you run into problems when trying to use this, then you might need
some of the fixes that we've checked into the lkcd cvs tree.

Regards
Suparna
IBM Linux Technology Center

sathish jayapalan wrote:
>
> Hi,
> I have a doubt. I know that linux kernel doesn't crash
> so easily. Is there any way to panic the system? Can I
> go to the source area and insert/modify a variable in
> kernel code so that the kernel references a null
> pointer and crashes while running the kernel compiled
> with this variable. My aim is to learn crash dump
> analysis with 'Lcrash tool". Please help me out with
> this.
>
> Thanks in advance,
> sathish
>
> __________________________________________________
> Do You Yahoo!?
> Great stuff seeking new owners in Yahoo! Auctions!
> http://auctions.yahoo.com
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2002-02-05 02:32:54

by Philippe Troin

[permalink] [raw]
Subject: Re: How to crash a system and take a dump?

Alexander Sandler <[email protected]> writes:

> > Hi,
> > I have a doubt. I know that linux kernel doesn't crash
> > so easily. Is there any way to panic the system? Can I
> > go to the source area and insert/modify a variable in
> > kernel code so that the kernel references a null
> > pointer and crashes while running the kernel compiled
> > with this variable. My aim is to learn crash dump
> > analysis with 'Lcrash tool". Please help me out with
> > this.
>
> Go to interrupt handler (for instance in fs/buffer.c end_buffer_io_async() )
> and cause segmentation fault.
> System will try to kill process that caused segmentation fault and since
> it's in interrupt context will panic.

Simplier: insmod this module:

#include <linux/module.h>

int init_module()
{
panic("Forcing panic");
}

int cleanup_module()
{
}

Phil.

2002-02-05 18:51:26

by Alexander Sandler

[permalink] [raw]
Subject: RE: How to crash a system and take a dump?

This one is too genious to be found right away ;)

> Simplier: insmod this module:
>
> #include <linux/module.h>
>
> int init_module()
> {
> panic("Forcing panic");
> }
>
> int cleanup_module()
> {
> }

Sasha.