[stacktrace] Fix out of bounds panic