unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Baoqiu Cui <Baoqiu.Cui@yahoo.com>
To: rms@gnu.org
Cc: Robert Widhopf-Fenk <hack@robf.de>, emacs-devel@gnu.org
Subject: Re: VM crashes on big INBOX file ==> problem found!!!
Date: Thu, 20 Dec 2007 14:21:04 -0800	[thread overview]
Message-ID: <18282.60112.186266.318585@AFTERRDOUBT-LX.ds.corp.yahoo.com> (raw)
In-Reply-To: <E1IlmAe-0000BJ-I0@fencepost.gnu.org>

Sorry for the late reply.  I wanted to look deeper into the VM code but
could not find time to do that.  I guess it might be easier for the new
maintainer of VM, Robert Widhopf-Fenk, to take a look at this problem
and see if there is anything that can be changed in VM.  I am copying
this email to Robert...

Thanks for looking into this problem, Richard!

- Baoqiu

Richard Stallman writes:
 >     garbage collection is triggered and function mark_object() (in alloc.c)
 >     is recursively called about 29,885 times (see the backtrace info
 >     below)!!!  So many levels of mark_object() calls make the stack
 >     overflow, causing a segmentation fault.
 > 
 > I wonder if this indicates a bad choice of data structures.
 > mark_object calls itself recursively for many kinds of pointers,
 > but it is supposed to loop rather than recurse for cdr pointers.
 > This is so that long lists do not cause recursion.
 > Most data structures don't have a tremendous amount of nesting
 > in the car direction.
 > 
 > I wonder what sort of data structures made 29,885 recursive
 > calls necessary.  Perhaps we should change those data structures
 > or else change the garbage collector so it recurses less.
 > 
 > For instance, maybe a lot of this recursion goes thru symbols.  If so,
 > here is an idea.  Suppose that when mark_object finds a symbol which
 > is not yet marked, and is interned in the main obarray, it sets a bit
 > "needs to be marked" in the symbol.  Then increment a counter
 > which records how many symbols are in this state.
 > 
 > Then gc_sweep could end by scanning the main obarray over and over,
 > marking those symbols, until the counter goes to zero.
 > 
 > Depending on the nature of the problem, this might or might not
 > help much.  If the main data types involved are others,
 > a different solution might help.

  reply	other threads:[~2007-12-20 22:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <yoruodet2jjm.fsf@AFTERRDOUBT-LX.ds.corp.yahoo.com>
     [not found] ` <fflvjt$dcs$1@reader1.panix.com>
     [not found]   ` <yoru7ildglb3.fsf@AFTERRDOUBT-LX.ds.corp.yahoo.com>
     [not found]     ` <ffo8rl$169$1@reader1.panix.com>
     [not found]       ` <v9myu82p62.fsf@marauder.physik.uni-ulm.de>
     [not found]         ` <yorumyu8f7pt.fsf@AFTERRDOUBT-LX.ds.corp.yahoo.com>
     [not found]           ` <yoruabq6icer.fsf_-_@AFTERRDOUBT-LX.ds.corp.yahoo.com>
2007-10-27 13:57             ` VM crashes on big INBOX file ==> problem found!!! Richard Stallman
2007-12-20 22:21               ` Baoqiu Cui [this message]
2007-12-21 19:49                 ` Richard Stallman

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=18282.60112.186266.318585@AFTERRDOUBT-LX.ds.corp.yahoo.com \
    --to=baoqiu.cui@yahoo.com \
    --cc=emacs-devel@gnu.org \
    --cc=hack@robf.de \
    --cc=rms@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).