From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#24751: 26.0.50; Regex stack overflow not detected properly (gets "Variable binding depth exceeds max-specpdl-size") Date: Sun, 01 Jan 2017 13:33:35 -0500 Message-ID: <87lguu7hq8.fsf@users.sourceforge.net> References: <87twc6tl0i.fsf@users.sourceforge.net> <83h97nlknj.fsf@gnu.org> <87mvhdoh4q.fsf@users.sourceforge.net> <83zilcipcr.fsf@gnu.org> <87a8d4lyzo.fsf@users.sourceforge.net> <83a8d3cq9s.fsf@gnu.org> <87wpg5l9st.fsf@users.sourceforge.net> <83d1hwhgdi.fsf@gnu.org> <87r36ckzca.fsf@users.sourceforge.net> <83polvfl3h.fsf@gnu.org> <87oa1fknx9.fsf@users.sourceforge.net> <83y40idqm3.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1483295600 3041 195.159.176.226 (1 Jan 2017 18:33:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Jan 2017 18:33:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 24751@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 01 19:33:16 2017 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 1cNkwU-0008P7-HF for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jan 2017 19:33:14 +0100 Original-Received: from localhost ([::1]:54176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNkwW-00050r-IE for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jan 2017 13:33:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNkwN-00050B-Mg for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 13:33:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNkwJ-00069f-KO for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 13:33:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51614) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cNkwJ-00069Z-Ge for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 13:33:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cNkwH-0005bi-NX for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 13:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Jan 2017 18:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24751 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24751-submit@debbugs.gnu.org id=B24751.148329555921520 (code B ref 24751); Sun, 01 Jan 2017 18:33:01 +0000 Original-Received: (at 24751) by debbugs.gnu.org; 1 Jan 2017 18:32:39 +0000 Original-Received: from localhost ([127.0.0.1]:38780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNkvv-0005b0-LM for submit@debbugs.gnu.org; Sun, 01 Jan 2017 13:32:39 -0500 Original-Received: from mail-io0-f171.google.com ([209.85.223.171]:36664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNkvu-0005an-Fz for 24751@debbugs.gnu.org; Sun, 01 Jan 2017 13:32:38 -0500 Original-Received: by mail-io0-f171.google.com with SMTP id h133so164835187ioe.3 for <24751@debbugs.gnu.org>; Sun, 01 Jan 2017 10:32:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=fFbmkDMX01G5mCAo1m1WRnuGlVAcg5mljTnvKwhIC3o=; b=amJB/8R9tcYQYubHX0iAUQWYySC7DT4y276wPi5N1EzZzni3BOwL8gKiK5/YEo8DCU HnZBGOWlgNvEu/f3xgfcolcW3iQ9y6YxSS2Vot2+BcSyIHsrVvEcWXBPrS5HRo4rG9rg W/DpqODAswrtM1IuDmV0qlcHDqTkujs24OGp/RsgrsbDYD+a8rRO18FEuz7hjPtIfcb3 agvAK7mFsWfAgA8XzSRuK5WpkCbHONnoVaYhJsjKGJlB/qBq9Rv2A0WkS2wjBxe6C7mh H8NXP5espYKyL7qSEQ5BYr+LDQRv6cTdjBnHchpHRAPiJbqHTAWzw1B+MzlInQ0usmH5 dVew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=fFbmkDMX01G5mCAo1m1WRnuGlVAcg5mljTnvKwhIC3o=; b=jG4swIo1+TVMUNQ8b4wSKsua92nd6W/FlTdgifss/GkHqFOx5xJTKH9M7xrWN6sMmp 0p6AWELeeGHwKsdCSJTGL0t+O28czd6vDXAIb7jen0OkZqVMR3xcXUG6JHNbziQkbPbf 2dFj2DSHcwyKwfp97AvEhiiBHRrK9sh8n56H82I6qi255Hxs0xSxfXBxwsZgF4tPg29n 6SEWgH6G3jHiVsYRMltl5GJnh1UPBmjqqb+lQDPmhJayNxsomERnadpZEr7NUdFLWrv8 kzPmtRM02R618Ih6S+NSghU7A6/U4faj7qsvcckVDVW7Sv2XzhlXNmcY8fnPR2KS5qhI T4tA== X-Gm-Message-State: AIkVDXJ1pWR/D+lqJIeOG7wYTepKEJ/iceWLoZtr3yAOgB/lCZsBl+Y8F5z0zDJ2o3kDCA== X-Received: by 10.107.40.142 with SMTP id o136mr41989932ioo.1.1483295552816; Sun, 01 Jan 2017 10:32:32 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id g130sm21558798ita.10.2017.01.01.10.32.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 01 Jan 2017 10:32:31 -0800 (PST) In-Reply-To: <83y40idqm3.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 17 Nov 2016 18:21:24 +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:127660 Archived-At: Eli Zaretskii writes: >> >> /* Define MATCH_MAY_ALLOCATE unless we need to make sure that the >> searching and matching functions should not call alloca. On some >> systems, alloca is implemented in terms of malloc, and if we're >> using the relocating allocator routines, then malloc could cause a >> relocation, which might (if the strings being searched are in the >> ralloc heap) shift the data out from underneath the regexp >> routines. >> >> [...] > > The first part is not obsolete, but its reasoning is backwards: > SAFE_ALLOCA indeed can call malloc, but it could only cause relocation > if REGEX_MALLOC is defined (and ralloc.c is compiled in). And when > you define REGEX_MALLOC, MATCH_MAY_ALLOCATE is undefined. So the text > there should be revised. Is there ever any case where REGEX_MALLOC is defined? I can't see where it happens. I don't understand why you say relocation is dependent on REGEX_MALLOC, I thought only REL_ALLOC affects that. And since we added r_alloc_inhibit_buffer_relocation around the regex calls, aren't all these concerns about relocation obsolete?