unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Петров Андрей" <an.petrov@pay-lab.ru>
To: 52479@debbugs.gnu.org
Subject: bug#52479: 27.2; EDebugging stops when breakpoint condition can not be printed
Date: Tue, 14 Dec 2021 13:03:51 +0000	[thread overview]
Message-ID: <62d5f9445730439e9d6b765f3d181c78@pay-lab.ru> (raw)

Hello, team!
The following code can reproduce the bug:


(require 'cl-lib)
(require 'eieio)

(defclass my-field ()
  ((from-types :initform nil)
   (type :initform nil)))

(defun test ()
  "Demonstrates edebug condition printing bug.
1. evaluate the buffer
2. instrument `test' function for debugging
3. add conditional breakpoint inside lambda below (see comment)
   M-x edebug-set-conditional-breakpoint [RET] root [RET]
4. Start the function for debugging
   M-x (test)
5. Continue to the breakpoint
   c

Now error: \"Apparently circular structure being printed\" is
printed and no further debugging is possible.
"
  (let* ((root (my-field))
	 (tmp root))
    (dotimes (i 100)
      (let ((a (my-field)))
	(push a (oref tmp type))
	(push tmp (oref a from-types))
	(setf tmp a)))
    (push root (oref tmp type))    
    (cl-remove root '(1 2 3 4) :test (lambda (a b) ;; <-- put cursor here and set
				       ;; conditional breakpoint with condition: root
				       (= (length (oref a from-types))) b))
    (cl-remove root '(1 2 3 4) :test (lambda (a b) (= (length (oref a from-types))) b))
    (cl-remove root '(1 2 3 4) :test (lambda (a b) (= (length (oref a from-types))) b))
    "Finished"
    ))


It hard for me to get backtraces on the example but on other
(complicated) code I got the following using recursive edit:

Debugger entered--Lisp error: (error "Apparently circular structure being printed")
  apply(debug error (error "Apparently circular structure being printed"))
  edebug(error (error "Apparently circular structure being printed"))
  signal(error ("Apparently circular structure being printed"))
  edebug-signal(error ("Apparently circular structure being printed"))
  message("Break: %s => %s" filtered (#<field field-157aa078be4c>))
  edebug--display-1(nil 0 before)
  edebug--display(nil 0 before)
  edebug-debugger(0 before nil)
  edebug-before(0)
  (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after (edebug-before 3) 10 (if (edebug-after 0 4 filtered) (edebug-after (edebug-before 5) 8 (cl-remove (edebug-after 0 6 parent) (edebug-after 0 7 context) :count 1 :test (lambda (a b) (edebug-enter ... ... ...)))) (edebug-after 0 9 context)))))
  (lambda nil (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after (edebug-before 3) 10 (if (edebug-after 0 4 filtered) (edebug-after (edebug-before 5) 8 (cl-remove (edebug-after 0 6 parent) (edebug-after 0 7 context) :count 1 :test (lambda ... ...))) (edebug-after 0 9 context))))))()
  edebug-default-enter(edebug-anon17 (#<field field-157aa078be4c>) (lambda nil (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after (edebug-before 3) 10 (if (edebug-after 0 4 filtered) (edebug-after (edebug-before 5) 8 (cl-remove ... ... :count 1 :test ...)) (edebug-after 0 9 context)))))))
  edebug-enter(edebug-anon17 (#<field field-157aa078be4c>) (lambda nil (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after (edebug-before 3) 10 (if (edebug-after 0 4 filtered) (edebug-after (edebug-before 5) 8 (cl-remove ... ... :count 1 :test ...)) (edebug-after 0 9 context)))))))
  (lambda (parent) (edebug-enter 'edebug-anon17 (list parent) #'(lambda nil (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after ... 10 ...))))))(#<field field-157aa078be4c>)
  mapcan((lambda (parent) (edebug-enter 'edebug-anon17 (list parent) #'(lambda nil (edebug-after (edebug-before 0) 11 (find-inpas-paths (edebug-after 0 1 parent) (edebug-after 0 2 stop-id) (edebug-after ... 10 ...)))))) (#<field field-157aa078be4c>))


P.S. I could not copy the text from emacs with C-c M-i according to hint:
While in the mail buffer:

  Type C-c C-c to send the bug report.
  Type C-x k RET to cancel (don’t send it).
  Type C-c M-i to copy text to your preferred mail program.   <----


Andrey Petrov.





             reply	other threads:[~2021-12-14 13:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 13:03 Петров Андрей [this message]
2021-12-15  5:26 ` bug#52479: 27.2; EDebugging stops when breakpoint condition can not be printed Michael Heerdegen
2021-12-15  7:01   ` Петров Андрей
2021-12-19 13:05   ` Lars Ingebrigtsen
2021-12-19 15:50     ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62d5f9445730439e9d6b765f3d181c78@pay-lab.ru \
    --to=an.petrov@pay-lab.ru \
    --cc=52479@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).