Thanks for the bug report in . Good eye, noticing those dangling pointers -- these could cause problems in obscure circumstances even without custom debuggers. I installed the attached patch into the emacs-25 branch, and (if I understand things correctly) it should address the issues raised in the bug report so I'll close the bug report for now; if I'm wrong and this patch doesn't fix the bugs we can always reopen it.