From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#6214: 23.1; json-read-string crashes emacs with long string Date: Mon, 16 Aug 2010 13:40:13 -0400 Message-ID: <874oeuv4le.fsf__16988.7649747126$1281982204$gmane$org@stupidchicken.com> References: <87pr0t5h1q.fsf@yoom.home.cworth.org> <87fx1pkrsh.fsf@stupidchicken.com> <87tymzv6ga.fsf@steelpick.2x.cz> <878w4afozw.fsf@stupidchicken.com> <87sk2hbq3s.fsf@steelpick.2x.cz> <8739ug3mrr.fsf@stupidchicken.com> <87r5i02uo7.fsf@steelpick.2x.cz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1281982204 5239 80.91.229.12 (16 Aug 2010 18:10:04 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Aug 2010 18:10:04 +0000 (UTC) Cc: 6214@debbugs.gnu.org, Notmuch mailing list , Carl Worth To: Michal Sojka Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 16 20:10:02 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ol48H-0005AV-3G for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Aug 2010 20:10:01 +0200 Original-Received: from localhost ([127.0.0.1]:34386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ol48G-0001fX-Bh for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Aug 2010 14:10:00 -0400 Original-Received: from [140.186.70.92] (port=37568 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ol47B-0000oT-M8 for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2010 14:08:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ol479-0004tt-OB for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2010 14:08:53 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40660) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ol479-0004to-Mu for bug-gnu-emacs@gnu.org; Mon, 16 Aug 2010 14:08:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Ol3fG-0004qF-QW; Mon, 16 Aug 2010 13:40:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Aug 2010 17:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6214 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6214-submit@debbugs.gnu.org id=B6214.128198039418602 (code B ref 6214); Mon, 16 Aug 2010 17:40:02 +0000 Original-Received: (at 6214) by debbugs.gnu.org; 16 Aug 2010 17:39:54 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ol3f7-0004pz-KA for submit@debbugs.gnu.org; Mon, 16 Aug 2010 13:39:53 -0400 Original-Received: from pantheon-po45.its.yale.edu ([130.132.50.79]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ol3f5-0004pt-MU for 6214@debbugs.gnu.org; Mon, 16 Aug 2010 13:39:52 -0400 Original-Received: from furry ([64.134.241.146]) (authenticated bits=0) by pantheon-po45.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o7GHekVB003001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 16 Aug 2010 13:40:49 -0400 Original-Received: by furry (Postfix, from userid 1000) id 71ED6C013; Mon, 16 Aug 2010 13:40:13 -0400 (EDT) In-Reply-To: <87r5i02uo7.fsf@steelpick.2x.cz> (Michal Sojka's message of "Sun, 15 Aug 2010 09:37:28 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 16 Aug 2010 13:40:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:39550 Archived-At: Thanks, that is a useful backtrace. Could you apply this patch and see if it fixes the problem? === modified file 'src/eval.c' *** src/eval.c 2010-08-06 19:07:16 +0000 --- src/eval.c 2010-08-16 17:37:22 +0000 *************** *** 2430,2437 **** register int i, numargs; register Lisp_Object spread_arg; register Lisp_Object *funcall_args; ! Lisp_Object fun; struct gcpro gcpro1; fun = args [0]; funcall_args = 0; --- 2430,2438 ---- register int i, numargs; register Lisp_Object spread_arg; register Lisp_Object *funcall_args; ! Lisp_Object fun, retval; struct gcpro gcpro1; + USE_SAFE_ALLOCA; fun = args [0]; funcall_args = 0; *************** *** 2470,2477 **** { /* Avoid making funcall cons up a yet another new vector of arguments by explicitly supplying nil's for optional values */ ! funcall_args = (Lisp_Object *) alloca ((1 + XSUBR (fun)->max_args) ! * sizeof (Lisp_Object)); for (i = numargs; i < XSUBR (fun)->max_args;) funcall_args[++i] = Qnil; GCPRO1 (*funcall_args); --- 2471,2478 ---- { /* Avoid making funcall cons up a yet another new vector of arguments by explicitly supplying nil's for optional values */ ! SAFE_ALLOCA (funcall_args, Lisp_Object *, ((1 + XSUBR (fun)->max_args) ! * sizeof (Lisp_Object))); for (i = numargs; i < XSUBR (fun)->max_args;) funcall_args[++i] = Qnil; GCPRO1 (*funcall_args); *************** *** 2483,2490 **** function itself as well as its arguments. */ if (!funcall_args) { ! funcall_args = (Lisp_Object *) alloca ((1 + numargs) ! * sizeof (Lisp_Object)); GCPRO1 (*funcall_args); gcpro1.nvars = 1 + numargs; } --- 2484,2491 ---- function itself as well as its arguments. */ if (!funcall_args) { ! SAFE_ALLOCA (funcall_args, Lisp_Object *, ((1 + numargs) ! * sizeof (Lisp_Object))); GCPRO1 (*funcall_args); gcpro1.nvars = 1 + numargs; } *************** *** 2500,2506 **** } /* By convention, the caller needs to gcpro Ffuncall's args. */ ! RETURN_UNGCPRO (Ffuncall (gcpro1.nvars, funcall_args)); } /* Run hook variables in various ways. */ --- 2501,2511 ---- } /* By convention, the caller needs to gcpro Ffuncall's args. */ ! retval = Ffuncall (gcpro1.nvars, funcall_args); ! UNGCPRO; ! SAFE_FREE (); ! ! return retval; } /* Run hook variables in various ways. */