From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: stack overflow limit Date: Wed, 04 May 2011 23:43:47 +0300 Message-ID: <83oc3imc1o.fsf@gnu.org> References: <62EAF87B4F294B2FB9F2ED7EC6E562D0@us.oracle.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1304541848 27255 80.91.229.12 (4 May 2011 20:44:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 May 2011 20:44:08 +0000 (UTC) Cc: drew.adams@oracle.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 04 22:44:04 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QHivT-0004e0-67 for ged-emacs-devel@m.gmane.org; Wed, 04 May 2011 22:44:03 +0200 Original-Received: from localhost ([::1]:34589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHivS-0007GV-P6 for ged-emacs-devel@m.gmane.org; Wed, 04 May 2011 16:44:02 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHivO-0007G2-1L for emacs-devel@gnu.org; Wed, 04 May 2011 16:43:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QHivM-0003pF-Tk for emacs-devel@gnu.org; Wed, 04 May 2011 16:43:57 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:45536) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QHivM-0003oo-GR for emacs-devel@gnu.org; Wed, 04 May 2011 16:43:56 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0LKO00L00UTWB400@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Wed, 04 May 2011 23:43:49 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.234.175]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LKO00K3MUWZX350@a-mtaout20.012.net.il>; Wed, 04 May 2011 23:43:49 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:139119 Archived-At: > From: Stefan Monnier > Date: Wed, 04 May 2011 15:51:22 -0300 > Cc: emacs-devel@gnu.org > > > Not a request or a suggestion. I'm just wondering about the stack size limit > > (e.g. for regexp search, search.c). > > Would it make sense to make it any bigger, given that machines > > nowadays are more powerful and have more memory, or do you consider > > that pretty much all such stack overflows (e.g. for regexp matching) > > are just due to poorly chosen regexps? > > IIRC this depends on the OS stack size, which hasn't grown nearly as > fast as hardware resources. How much stack does Emacs have on a typical Unix or GNU machine these days? The value of re_max_failures we use now needs 4MB of stack on a 32-but machine, twice as much on a 64-bit machine. We also need stack space for GC. The result should be compared to what Emacs has and what it can have. `ulimit' seems to indicate we get 8MB of stack on an x86_64 GNU/Linux system. On Windows, we tell the linker to reserve 8MB as well (but the Windows build is a 32-bit build.) Ultimately, the question is: should we increase the value of re_max_failures?