Added protected memory allocation to stacktrace