unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: Stefan <monnier@iro.umontreal.ca>
Cc: Paul Eggert <eggert@cs.ucla.edu>,
	Dmitry Antipov <dmantipov@yandex.ru>,
	Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: Avoid C stack overflow
Date: Sat, 15 Mar 2014 10:38:05 +0900	[thread overview]
Message-ID: <87iorgkzr6.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <jwv61ngafy4.fsf-monnier+emacs@gnu.org>

Stefan writes:

 > > Emacs already has a stack-overflow prevention mechanism, right?
 > 
 > Yes.
 > 
 > > And we're talking about what to do when the user deliberately disables
 > > it? So the simplest answer is "don't do that".
 > 
 > Actually, when we bump into something like max-lisp-eval-depth, we
 > could look at the actual C stack size to compute the average "C stack

Surely you want a worst-case-experienced-in-practice estimate here.
So you should collect data on *variation* of the ratio of C stack size
to max-lisp-eval-depth as well.

N.B. Unless the stack is extremely well-behaved across Lisp programs,
you're computing max-lisp-eval-depth to stack size for the case where
you hit max-lisp-eval-depth.  It might very well be that this is quite
different from cases where you don't.  I don't know if this *matters*
in any practical application to Emacs development, probably not.  But
I don't know what other uses people might find for this statistic.

 > usage per Lisp eval depth" and from that compute a approximate upper
 > bound on the maximum safe value of max-lisp-eval-depth.



      reply	other threads:[~2014-03-15  1:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-13 16:42 Avoid C stack overflow Dmitry Antipov
2014-03-13 17:38 ` Eli Zaretskii
2014-03-13 17:57 ` Paul Eggert
2014-03-13 20:56   ` Eli Zaretskii
2014-03-14  7:02     ` Paul Eggert
2014-03-14  5:47   ` Dmitry Antipov
2014-03-14  6:59     ` Paul Eggert
2014-03-14 11:27       ` Dmitry Antipov
2014-03-14 13:05       ` Stefan Monnier
2014-03-14 13:56         ` Paul Eggert
2014-03-14 16:45           ` Stefan
2014-03-15  1:38             ` Stephen J. Turnbull [this message]

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=87iorgkzr6.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=dmantipov@yandex.ru \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).