From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Shahid Newsgroups: gmane.emacs.help Subject: debugging post command hook max-lisp-eval-depth Date: Sun, 17 Jun 2018 17:34:02 +0000 Message-ID: <87efh5uxkl.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529256752 8699 195.159.176.226 (17 Jun 2018 17:32:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 17 Jun 2018 17:32:32 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 27.0.50 To: Help GNU Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 17 19:32:28 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUbXO-00029e-G3 for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jun 2018 19:32:26 +0200 Original-Received: from localhost ([::1]:55940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUbZV-0002tE-Lv for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jun 2018 13:34:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUbZ2-0002t6-6o for help-gnu-emacs@gnu.org; Sun, 17 Jun 2018 13:34:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUbYz-0002tS-3X for help-gnu-emacs@gnu.org; Sun, 17 Jun 2018 13:34:08 -0400 Original-Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:34424) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fUbYy-0002t9-Us for help-gnu-emacs@gnu.org; Sun, 17 Jun 2018 13:34:05 -0400 Original-Received: by mail-qt0-x235.google.com with SMTP id d3-v6so13364667qto.1 for ; Sun, 17 Jun 2018 10:34:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=vRqXQ3vFShQgQbfJfOjPMhOgs0l01pTmMVd4m9NR5eY=; b=fxZhcC2NvEN3Q2+sD26wGCcyoK9RZAuav6gTEXWprDN8wGtKJkDsac0x0qGvfLT/IE hXb95k6wtQHNisoJSdAwNhY/gnwBrCdFSW2Ov7wlwhFt5JS3dK//0lBDh3OJm0in7pNj oHZix7KJVENK24/YGAxJQ6fbc/h5QHnQIJ+x4Mj/IEKQ56ty0B26VufJijXNT3R1w6i1 0K2tBfebsYcgowotciMU8gKMk1VBr4tirR1cVk6L8ux3cMXtWZBBr0XBimYsDDwddvUG kVMpSIJUIqVt/Jnyvp83Q/ExdrIG9GbZzZkt2xs6YcOZ3FlAa+iYQA72iBCBGNxW4bBu PFCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=vRqXQ3vFShQgQbfJfOjPMhOgs0l01pTmMVd4m9NR5eY=; b=fFcW86F0E11QV+9FTMRf/K2w9RYYIdyDHVBOaOHkIbHSt8+hHiRDB5kf9gPpCS/K+F PHSoRTUs3RyN5Wdyb69fhq9LgtO1/OJs+K/L5ADr9lxtdbbblvfDaU15pD57IXn4WSMz TQfbkevYpqRIxnWYoj638haxP2XFPIQtntJCXuzTTvMSqyTxaQvOxtX5fgEIijpNRkgI fgdby0AHoAwLqCAg+UQL16tohw6bejtaUE4HJf7L3RamZuzYeA3z8XgGe8qzguzCqYkc IqzH3N5glukvoDNxYUTW84OSWYjlvjVsXz7CRR2tAAvoPdDKUbgZP1bIjzirlmjS5u6R KXEg== X-Gm-Message-State: APt69E0ANiKr0G7ZVjkEi3iJuLBSoGgFgWh96fNUJB3v8tCjzg9Vhygu Qw8GTqNt0ZiL2Ir8a2kM/+njNzKY X-Google-Smtp-Source: ADUXVKLBcz4/pHpjJVZCKUc3BYVAXoQEDvhS8+fDoyjb0gh1qev7h3XQ+vzOyTd81sGl4pCX1wCRuA== X-Received: by 2002:ac8:43ce:: with SMTP id w14-v6mr8600479qtn.137.1529256843947; Sun, 17 Jun 2018 10:34:03 -0700 (PDT) Original-Received: from dee925c335f3 (cpe-184-152-55-93.nyc.res.rr.com. [184.152.55.93]) by smtp.gmail.com with ESMTPSA id v26-v6sm10484168qtc.12.2018.06.17.10.34.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jun 2018 10:34:03 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::235 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117184 Archived-At: Hi all, every now and then my Emacs will get in a bad state because of some infinite recursion in the post-command-hook. I am reaching out for ideas on how to debug Emacs when it gets into this weird state. Keep in mind that it is hard to do anything with Emacs at that point since any command (switching buffer, starting debugger) will fail with the same error `Lisp nesting exceeds...'. I don't know when this started happening and can't easily debug/bisect my configuration since this situation happens rarely and intermittently (2 or 3 times last week). What I currently have is the following post-command-hook in init.el (not sure how useful it will be) to stop the infinite recursion: (defvar debug-post-command-hook-count nil) (defun debug-post-command-hook () (let ((debug-post-command-hook-count (1+ (or debug-post-command-hook-count 0)))) (if (> debug-post-command-hook-count 10) (debug) (print (format "post-command-hook %d %S" debug-post-command-hook-count (current-buffer)) #'external-debugging-output)))) (add-hook 'post-command-hook #'debug-post-command-hook) I also compiled emacs with no optimization and debug symbols (using info in etc/DEBUG) and planning to use `xbacktrace' when I run into that situation. Do you have any other ideas to prepare me for when this happens again ? p.s. my emacs version is "4a7e74fea687011ee81dcbb02294bccd99b3a05f". I tried to use the latest commit but ran into weird issues during redisplay (where Emacs would end up in die()) and autocompletion (where the candidates left edge isn't lined up properly), but I decided to ignore those issues for now and stick with the previous revision. -js