Revert "Revert "Revert "Add a callback on crash"""

This reverts commit 6754122580fd746b0bfda17158a8283e4909cc62.