crashing fresbsd 5.1-current?

Joshua Oreman oremanj at webserver.get-linux.org
Wed May 21 17:18:37 PDT 2003


On Wed, May 21, 2003 at 06:39:27AM -0600 or thereabouts, Aaron Wohl seemed to write:
> How do I crash freebsd? I changed the dump* stuff in /etc/rc.conf.  I
> want to make sure it works.  I looked at man shutdown and man poweroff
> but I dont see a crash option.  There should be some option to a system
> call you need to be root to do that internaly does panic("test crash") ?

Yep. man 2 reboot - especially RB_DUMP. It doesn't panic, but it dumps core.
Try this:

$ cat > crash.c <<EOF
#include <unistd.h>
#include <sys/reboot.h>

int main()
{
	reboot (RB_DUMP | RB_AUTOBOOT);
	return 255;
}
EOF
$ gcc -o crash crash.c
$ su
Password:
# ./crash


If you were a developer, and wanted to have a little more fun, you
could make a KLD that created a /dev/panic device. Then, something
like:

# echo "I wonder how big a security hole this is..." > /dev/panic

would panic with the specified message. See the Developer's Handbook.

-- Josh

> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"


More information about the freebsd-questions mailing list