Nice write up here: line http://www.nico.schottelius.org/blog/reboot-linux-if-task-blocked-for-more-than-n-seconds/
Summary (in case that link goes away in future):
Set items in sysctl.conf if your badly written code hangs and
eventually panics the kernel:
# Reboot X seconds after panic kernel.panic = X # Panic if a hung task was found kernel.hung_task_panic = 1 # Setup timeout for hung task to XYZ seconds kernel.hung_task_timeout_secs = XYZ