emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: Emacs hangs while edebugging recentf.el]


From: Chong Yidong
Subject: Re: address@hidden: Emacs hangs while edebugging recentf.el]
Date: Tue, 13 Dec 2005 17:27:04 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Richard M. Stallman" <address@hidden> writes:

>     I reproduced the error and also found that Emacs hangs in the built-in
>     function `prin1-to-string' when it tries to print the value the
>     function `widget-create' returns, which contains a lot of circular
>     references in a deeply nested list.  If I don't interrupt the hang,
>     after some time, the function fails with a "Memory exhausted" message.
>     Notice that the widgets are correctly created in the "*Open Recent*"
>     buffer.  This is only the edebug prin1 function that hangs.
>
>     When I set the value of `edebug-print-level' to 10 instead of the
>     default value of 50, Emacs no more hangs.
>
>     Maybe there is a bug in the prin1-to-string function?  Unfortunately I
>     don't know how to fix it.
>
> Can someone investigate that bug?  David Ponce said he can't.

I think the trouble is that the way print_preprocess "follows" nested
lists, while handling print_depth, is slightly different from the way
print_object does it.  Because of this, it is possible for
print_preprocess to give up sooner than print_object would.  An object
could thus fail to be put into Vprint_number_table, even though
print_object later is later called for it.

There is a quick but inelegant way to cover up this bug:

*** emacs/src/print.c.~1.214.~  2005-11-10 08:45:06.000000000 -0500
--- emacs/src/print.c   2005-12-13 17:17:49.000000000 -0500
***************
*** 1313,1319 ****
  
    /* 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)
      return;
  
    /* Avoid infinite recursion for circular nested structure
--- 1313,1319 ----
  
    /* Give up if we go so deep that print_object will get an error.  */
    /* See similar code in print_object.  */
!   if (print_depth > 2 * PRINT_CIRCLE)
      return;
  
    /* Avoid infinite recursion for circular nested structure




reply via email to

[Prev in Thread] Current Thread [Next in Thread]