追踪 emacs 中的 max-specpdl-size 错误

发布于 2024-08-02 15:57:22 字数 351 浏览 8 评论 0原文

我在 emacs 中随机遇到以下错误:

变量绑定深度超过 max-specpdl-size

...并且我在非常随机的时刻得到它。经过研究后,似乎某个地方的某些 elisp 递归得太深了。有什么策略可以追踪这个问题吗?我完全不知道到底是什么原因造成的。

我收到了一些错误,表明一些与 Ropemacs 的无限递归类似的错误(但这些通常是 Python 错误)。是否有可能 Ropemacs 配置错误?

更新:有趣的是,我发现如果我对“speedbar”执行“Ch a”而不是对“rope-”执行“Cha a”,我总是会收到此错误。

I've been randomly getting the following error in emacs:

Variable binding depth exceeds max-specpdl-size

...and I've been getting it at very random moments. After researching this, it seems as though some elisp somewhere is recursing too deeply. Are there any strategies for tracking this down? I'm totally at a loss as far as what is actually causing this.

I've gotten some errors indicating something along the lines of infinite recursion with ropemacs (but these are usually Python errors). Could something be misconfigured with ropemacs?

Update: Interestingly enough, I've found that I always get this error if I do a "C-h a" for "speedbar" but not for "rope-".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

凯凯我们等你回来 2024-08-09 15:57:22

要跟踪问题,您可以尝试以下操作:

(setq max-specpdl-size 5)  ; default is 1000, reduce the backtrace level
(setq debug-on-error t)    ; now you should get a backtrace
C-h a ; in speedbar

您应该对错误进行回溯,此时您可以跟踪有问题的例程。

我还尝试在没有配置文件的情况下加载 emacs (emacs -q),以查看 .emacs 中是否有某些内容会影响某些内容。 (我没有使用 Ch a 获得无限循环)。如果它是你的 .emacs,那么我发现追踪它的最好方法是二分搜索(在你的 .emacs 中间放置一个错误 (error "frog") 或类似的东西) ,加载,测试,如果没有问题,将错误放在 3/4,否则放在 1/4,重复...),或者手动逐行评估您的 .emacs(逐个区域),在每个部分之后进行测试。这些设置应该有帮助。

To track the problem down, you can try this:

(setq max-specpdl-size 5)  ; default is 1000, reduce the backtrace level
(setq debug-on-error t)    ; now you should get a backtrace
C-h a ; in speedbar

You should get a backtrace upon the error, and at that point, you can track down the offending routine.

I'd also try loading emacs w/out your configuration file (emacs -q), to see if there's something in your .emacs that is affecting things. (I don't get the infinite loop using C-h a). And if it is your .emacs, then the best way I've found to track that down is either binary search (put an error (error "frog") or somesuch in the middle of your .emacs, load, test, if no problems, put the error at 3/4, otherwise at 1/4, repeat...), or manually evaluate your .emacs line by line (region by region), testing after each portion. Those settings should help.

童话 2024-08-09 15:57:22

对我来说也不起作用。我发现 Ch+v 实际上 max-specpdl-size 根本没有被更改为 5 setq。然后我尝试与 Mx set-variable 交互设置它。这也没有改变它的价值。最后我设法用 Mx customize-variable 设置它。

顺便说一句,在我的系统上,max-specpdl-size 是 140,因此太小了。我必须将其增加到 1000,不是为了获得回溯并对其进行调试,而是为了使其正常工作。

For me too it did not work. I found with C-h+v that actually max-specpdl-size was not changed to 5 at all by the setq. I then tried to set it interactively with M-x set-variable. That too did not change its value. Finally I managed to set it with M-x customize-variable.

Btw, on my system max-specpdl-size was 140 and thus to small. I had to increase it to 1000, not in order to get a backtrace and debug it, but to make it work.

秋千易 2024-08-09 15:57:22

报告发布 10 年后,这种错误仍然存​​在于 XEmacs 21.4(补丁 24)“标准 C”[Lucid](x86_64-linux-gnu、Mule)中。我从 Mx vm 获取它(尝试阅读我的电子邮件,我每天都会这样做很多次)。

Debugger entered--Lisp error: (error "Variable binding depth exceeds max-specpdl-size")
  signal(error ("Variable binding depth exceeds max-specpdl-size"))
  byte-code("..." [buf data kill-buffer signal] 3)
  find-file-noselect("/home/brech/mail/folders/INBOX")
  byte-code("..." [f full-startup access-method remote-spec buffer-file-coding-system folder string-match imap pop bufferp nil vm-pop-find-spec-for-name error "No such POP folder: %s" vm-pop-make-filename-for-spec t file-exists-p (rename-file f-pass f-nospec) ((error)) (rename-file f-nopass f-nospec) ((error)) 3 vm-imap-parse-spec-to-list vm-imap-make-filename-for-spec expand-file-name file-directory-p "%s is a directory" vm-get-file-buffer no-conversion raw-text message "Reading %s..." find-file-noselect "Reading %s... done" (pop imap) buffer-name rename-buffer set-buffer-multibyte get-coding-system no-conversion-unix no-conversion-dos no-conversion-mac binary buffer-modified-p ((set-buffer-modified-p omodified)) encode-coding-region set-buffer-file-coding-system decode-coding-region coding-system-base raw-text-unix ...] 9)
  ad-Orig-vm(nil nil nil)
  (setq ad-return-value (ad-Orig-vm folder read-only access-method))
  (let (ad-return-value) (if (and ... mail-archive-file-name folder ... ...) (setq read-only ...)) (setq ad-return-value (ad-Orig-vm folder read-only access-method)) ad-return-value)
  (lambda (&optional folder read-only access-method) "$ad-doc: vm$" (interactive (list nil current-prefix-arg)) (let (ad-return-value) (if ... ...) (setq ad-return-value ...) ad-return-value))(nil nil)
  call-interactively(vm)
  command-execute(vm t)
  execute-extended-command(nil)
  call-interactively(execute-extended-command)

一个粗略的解决方法是退出 XEmacs 并重新开始。仅退出并重新启动虚拟机没有帮助。

The kind of bug still exists 10 years after the report, in XEmacs 21.4 (patch 24) "Standard C" [Lucid] (x86_64-linux-gnu, Mule). I get it from M-x vm (trying to read my e-mail, which I do many times every day).

Debugger entered--Lisp error: (error "Variable binding depth exceeds max-specpdl-size")
  signal(error ("Variable binding depth exceeds max-specpdl-size"))
  byte-code("..." [buf data kill-buffer signal] 3)
  find-file-noselect("/home/brech/mail/folders/INBOX")
  byte-code("..." [f full-startup access-method remote-spec buffer-file-coding-system folder string-match imap pop bufferp nil vm-pop-find-spec-for-name error "No such POP folder: %s" vm-pop-make-filename-for-spec t file-exists-p (rename-file f-pass f-nospec) ((error)) (rename-file f-nopass f-nospec) ((error)) 3 vm-imap-parse-spec-to-list vm-imap-make-filename-for-spec expand-file-name file-directory-p "%s is a directory" vm-get-file-buffer no-conversion raw-text message "Reading %s..." find-file-noselect "Reading %s... done" (pop imap) buffer-name rename-buffer set-buffer-multibyte get-coding-system no-conversion-unix no-conversion-dos no-conversion-mac binary buffer-modified-p ((set-buffer-modified-p omodified)) encode-coding-region set-buffer-file-coding-system decode-coding-region coding-system-base raw-text-unix ...] 9)
  ad-Orig-vm(nil nil nil)
  (setq ad-return-value (ad-Orig-vm folder read-only access-method))
  (let (ad-return-value) (if (and ... mail-archive-file-name folder ... ...) (setq read-only ...)) (setq ad-return-value (ad-Orig-vm folder read-only access-method)) ad-return-value)
  (lambda (&optional folder read-only access-method) "$ad-doc: vm
quot; (interactive (list nil current-prefix-arg)) (let (ad-return-value) (if ... ...) (setq ad-return-value ...) ad-return-value))(nil nil)
  call-interactively(vm)
  command-execute(vm t)
  execute-extended-command(nil)
  call-interactively(execute-extended-command)

A crude work-around is quitting XEmacs and starting all over. Only quitting and re-starting vm does not help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文