This is from the second backtrace, the first one is looking more like a crash during the kamailio shutdown. Could it be possible that you have a loop in your cfg? Just wondered from the large number of run_action, do_action calls in the trace. Kamailio should not crash from it, sure.