GNU bug report logs -
#31671
26.1; edebug-defun doesn't step if functions run in a separate thread
Previous Next
Full log
Message #8 received at 31671 <at> debbugs.gnu.org (full text, mbox):
> From: Raimon Grau <raimon <at> konghq.com>
> Date: Thu, 31 May 2018 18:37:17 +0100
>
> Using edebug-defun to instrument a function and running that function in
> a separate thread using `make-thread' makes triggers the breakpoint but
> leaves the bufer in read-only-mode but the user can't interact with
> edebug in any way.
>
> Steps to reproduce (ubuntu 16.04):
> - start emacs with emacs -Q .
> - in the *scratch* buffer, write:
> (defun foo ()
> (message "hi"))
>
> (make-thread 'foo)
> - edebug-defun function foo
> - c-x c-e the (make-thread 'foo) sexp
> - *scratch* buffer point moves to the beginning of function foo
> - press `n` and the minibuffers says: "No catch for tag: exit, nil". The
> whole buffer is in read-only mode. modeline has
> "(Lisp Interaction *Debugging* ElDoc)"
The problem here is that Edebug enters recursive-editing (on the
non-main thread which runs the function 'foo'), then waits for the
user to press a key. While it waits, it releases the global lock, and
the main thread starts running. So when you press a key, you are on a
different thread, and 'throw' doesn't have a matching 'catch' (because
that 'catch' is stored with the handlers of the thread which runs
'foo'.
Not yet sure how to deal with this. Thoughts and ideas are welcome.
This bug report was last modified 7 years and 60 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.