From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#30481: 26.0.91; infinite recursion + edebug = memory corruption Date: Fri, 16 Feb 2018 22:30:33 -0500 Message-ID: <87lgfs70o6.fsf@gmail.com> References: <87shaun9ix.fsf@users.sourceforge.net> <87po5ymqed.fsf@users.sourceforge.net> <874lnafeun.fsf@gmx.de> <87mv12m3q6.fsf@users.sourceforge.net> <877es528vp.fsf@gmx.de> <87h8r9mlxx.fsf@users.sourceforge.net> <87sha17gf1.fsf_-_@gmail.com> <83k1vde3bn.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1518838173 9820 195.159.176.226 (17 Feb 2018 03:29:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Feb 2018 03:29:33 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) Cc: 30481@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 17 04:29:29 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emtBU-00012O-2j for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Feb 2018 04:29:08 +0100 Original-Received: from localhost ([::1]:34673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emtDV-0007GO-VJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Feb 2018 22:31:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emtDP-0007FB-AK for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2018 22:31:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emtDK-0002Wq-Dn for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2018 22:31:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39522) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1emtDK-0002Wm-9z for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2018 22:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1emtDJ-0001ZA-NP for bug-gnu-emacs@gnu.org; Fri, 16 Feb 2018 22:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Feb 2018 03:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30481 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 30481-submit@debbugs.gnu.org id=B30481.15188382444838 (code B ref 30481); Sat, 17 Feb 2018 03:31:01 +0000 Original-Received: (at 30481) by debbugs.gnu.org; 17 Feb 2018 03:30:44 +0000 Original-Received: from localhost ([127.0.0.1]:47419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emtD2-0001Fe-6D for submit@debbugs.gnu.org; Fri, 16 Feb 2018 22:30:44 -0500 Original-Received: from mail-it0-f44.google.com ([209.85.214.44]:52700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emtD0-000170-9P; Fri, 16 Feb 2018 22:30:42 -0500 Original-Received: by mail-it0-f44.google.com with SMTP id o13so3936661ito.2; Fri, 16 Feb 2018 19:30:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=HgeBx6NPuWAiV4kMVUO171BSidDc4Nxv7O5/j73BiGE=; b=CgnUIpQoWS+XpWdr4FfXzoAZa4ov89KNUIHHZN+amqIRjj8jsppo9HG2kmLzuqpi3y TO8Sns9Iv1WpVTOzvzSh8W0xnzMdC51xW36XwS4i2//C41I1/i5DKNpsNl4wi6PsWN8w NXetR1EoswnGZnva4rQMen35kxnJifJQtVQec/8sCOTecoz61cHLdFYwOaCK/2Le9RNm oSqb1/9fHmjU0BNHuQeSchykpi+wAPk2x7yH1XoCqxKtDcwPmH1ykUnRCa0iS6DzsxOF z7vGcxavWLz4/x2qC2vCigt3OCT6wekk1WG+TCaD22cFxD3S6TSqZjqFQxbMzZwYzVGI r4HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=HgeBx6NPuWAiV4kMVUO171BSidDc4Nxv7O5/j73BiGE=; b=X4iV2LXdtSAtUhqxXw1UXC/pK38lSa9GXaMp1Y+l2gk+l7r6ZH4jAvitJc2mIHA6pS 5MDQt9R4aJctvQGljIkn8xSfsF2DT8X0d1wEqYAG5nftfKZO2/iTWjG6j1Jk4kcsmNbV ISH91H24ft55OszohbZ8Wvmu/xVASXsabIvbmVlvcPd7NcBdc99a1Shc62vai+EKU3xf ocDGe/eVR+IOXUA6/WGIvOea+1lDeNErRqL2+5B9Oy8Vvp13baKZikTbLnyqAX46qj6/ 1KowiEVqQdWKjaTnTVUY7ZnD+8ivu/5TfIWBJ4aPMfWa9bXt9Ow6O9eEbzSUzmYWpI93 o/7g== X-Gm-Message-State: APf1xPAw0x5pxj+d0tvNXhdgK8cxZX/MH68Ao1JpGnomTVQiMTTQ2izT +iwtc1BZOIur6vV2uPBYbpUyIA== X-Google-Smtp-Source: AH8x225xDQndDh02jW7usNZs9RTa3iu2uubgSD57j4AvNE3SgX33m1x+dUGZVIgP/bU8+np9xYvY9A== X-Received: by 10.36.14.202 with SMTP id 193mr4870235ite.137.1518838236328; Fri, 16 Feb 2018 19:30:36 -0800 (PST) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id g186sm2880354itg.2.2018.02.16.19.30.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2018 19:30:35 -0800 (PST) In-Reply-To: <83k1vde3bn.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 16 Feb 2018 10:39:08 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:143361 Archived-At: tags 30481 fixed close 30481 26.1 quit Eli Zaretskii writes: >> From: Noam Postavsky >> Date: Thu, 15 Feb 2018 22:38:10 -0500 >> >> The following patch solves the problem by not calling >> signal-hook-function when the specpdl array is exhausted. I think it >> could be safe for emacs-26. > > Please push to emacs-26, and thanks. Pushed (with test) [1: c352434ab8]. > (Is it practical to have a test for this?) Yes, actually. I initially had some trouble reproducing without instrumenting a function with edebug, but now I see that's just because a function which let-binds only a single variable hits max-lisp-eval-depth before max-specpdl-size (edebug's intrumentation adds more bindings per call). Let-binding two variables allows to trigger the bug with just (defun foo () (let ((x 1) (y 2)) (foo))) (let ((signal-hook-function #'ignore)) (foo)) [1: c352434ab8]: 2018-02-16 22:13:34 -0500 Avoid memory corruption with specpdl overflow + edebug (Bug#30481) https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=c352434ab89617b48c7c1f29342a22e5a5685504