Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Why would you need this? Commented Aug 2, 2013 at 18:46
  • 1
    @MichaelMrozek just to experiment. Although I imagine it could be useful to kernel developers. Commented Aug 2, 2013 at 18:47
  • 5
    You could load a kernel module which immediately tries to dereference NULL. That should give a fairly safe kernel panic. Or you could just have the module call panic. A kernel panic isn't just one, solitary thing—its a whole range of errors. You're asking something similar to "is there some way I can make a program crash?" Commented Aug 2, 2013 at 19:48
  • the sysrq method does create a kernel crash, but you probably don't have anything set up to handle the crashdump, and you aren't looking at the console where the crash information is sent. Commented Aug 2, 2013 at 20:32
  • 2
    @derobert Dereferencing NULL will give an Oops which only ends up being a panic if the kernel is configured as such (CONFIG_PANIC_ON_OOPS=y). To trigger a panic... simply load a module that calls panic()! Commented Aug 2, 2013 at 20:49