tsgates / rust.ko

A minimal Linux kernel module written in rust.
896 stars 66 forks source link

Panic prints the message then errors out #23

Closed tbelaire closed 8 years ago

tbelaire commented 8 years ago

panic_impl intentionally dereferences a null pointer to cause the kernel to detect a BUG and include the stacktrace.

This is much better than the previous behaviour of looping forever.

tbelaire commented 8 years ago

Note that panicking in module_init is always a bad idea, even with this change.

I had much more success using this on my rot13 branch, with panics in rust_dev_open just aborting the process and printing messages to the syslog, while it seems to lock up insmod if you panic in module_init.

ntninja commented 8 years ago

I second this patch, it's much better than the previous behaviour (hanging the system)