From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: [Stephen.Berman@bogus.example.com: Emacs hangs while edebugging recentf.el] Date: Fri, 16 Dec 2005 10:35:25 -0500 Message-ID: <871x0drr5u.fsf@stupidchicken.com> References: <43A1B877.2080005@gmx.at> <87mzj1527v.fsf@stupidchicken.com> <43A26B64.6030901@gmx.at> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1134762743 23974 80.91.229.2 (16 Dec 2005 19:52:23 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 16 Dec 2005 19:52:23 +0000 (UTC) Cc: rms@gnu.org, emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 16 20:52:22 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EnLb0-0002Bj-GC for ged-emacs-devel@m.gmane.org; Fri, 16 Dec 2005 20:50:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EnLbd-0001w1-K0 for ged-emacs-devel@m.gmane.org; Fri, 16 Dec 2005 14:51:05 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EnHfS-0007LI-Hr for emacs-devel@gnu.org; Fri, 16 Dec 2005 10:38:46 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EnHfQ-0007Kq-OI for emacs-devel@gnu.org; Fri, 16 Dec 2005 10:38:45 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EnHcx-00074F-Dw for emacs-devel@gnu.org; Fri, 16 Dec 2005 10:36:14 -0500 Original-Received: from [18.95.6.226] (helo=localhost.localdomain) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EnHfN-0006BO-UU; Fri, 16 Dec 2005 10:38:42 -0500 Original-Received: by localhost.localdomain (Postfix, from userid 1000) id 2F8951E42E3; Fri, 16 Dec 2005 10:35:26 -0500 (EST) Original-To: martin rudalics In-Reply-To: <43A26B64.6030901@gmx.at> (martin rudalics's message of "Fri, 16 Dec 2005 08:23:16 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:47876 Archived-At: martin rudalics writes: > > It works for me, at least using the recipe given in the original > > email. What steps are you using? > > `edebug-defun' on `widget-field-find' and customizing some arbitrary > editable field. And `edebug-print-level' equalling 50. My (Windows ME) > swap area quickly grew from its usual 70MB to nearly 500MB before I was > able to kill Emacs. OK, I guess that hack was not good enough to cover all situations. Try this one; it should be pretty much bulletproof. *** emacs/src/print.c.~1.215.~ 2005-12-15 19:09:36.000000000 -0500 --- emacs/src/print.c 2005-12-16 10:20:17.000000000 -0500 *************** *** 1313,1326 **** /* Give up if we go so deep that print_object will get an error. */ /* See similar code in print_object. */ ! /* Because print_preprocess "follows" nested lists in a slightly ! different order from print_object, there is a risk of giving up ! too soon. In that case, a deeply nested circular list may cause ! print_object to loop. Using 3 * PRINT_CIRCLE should make this ! possibility negligible, but at some point someone will have to ! sit down and do a more careful analysis. -- cyd */ ! if (print_depth >= 3 * PRINT_CIRCLE) ! return; /* Avoid infinite recursion for circular nested structure in the case where Vprint_circle is nil. */ --- 1313,1320 ---- /* Give up if we go so deep that print_object will get an error. */ /* See similar code in print_object. */ ! if (print_depth >= PRINT_CIRCLE) ! error ("Apparently circular structure being printed"); /* Avoid infinite recursion for circular nested structure in the case where Vprint_circle is nil. */ *** emacs/lisp/emacs-lisp/edebug.el.~3.84.~ 2005-12-13 21:38:03.000000000 -0500 --- emacs/lisp/emacs-lisp/edebug.el 2005-12-16 10:29:59.000000000 -0500 *************** *** 3711,3717 **** (print-level (or edebug-print-level print-level)) (print-circle (or edebug-print-circle print-circle)) (print-readably nil)) ;; lemacs uses this. ! (edebug-prin1-to-string value))) (defun edebug-compute-previous-result (edebug-previous-value) (if edebug-unwrap-results --- 3711,3719 ---- (print-level (or edebug-print-level print-level)) (print-circle (or edebug-print-circle print-circle)) (print-readably nil)) ;; lemacs uses this. ! (condition-case nil ! (edebug-prin1-to-string value) ! (error "# Circular or too deeply-nested structure #")))) (defun edebug-compute-previous-result (edebug-previous-value) (if edebug-unwrap-results