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:57:05 -0500 Message-ID: <87inpy7gn2.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> <87lguu7hq8.fsf@users.sourceforge.net> <83zijafwqy.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1483297105 16472 195.159.176.226 (1 Jan 2017 18:58:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Jan 2017 18:58:25 +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:58:21 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 1cNlKi-0003Ia-7P for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jan 2017 19:58:16 +0100 Original-Received: from localhost ([::1]:54248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNlKm-00012u-1M for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jan 2017 13:58:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cNlJZ-0000QY-Eh for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 13:57:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cNlJW-0006vC-Cr for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 13:57:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51630) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cNlJW-0006v5-8u for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 13:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cNlJW-00069U-04 for bug-gnu-emacs@gnu.org; Sun, 01 Jan 2017 13:57:02 -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:57: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.148329697123586 (code B ref 24751); Sun, 01 Jan 2017 18:57:01 +0000 Original-Received: (at 24751) by debbugs.gnu.org; 1 Jan 2017 18:56:11 +0000 Original-Received: from localhost ([127.0.0.1]:38796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNlIg-00068L-Rr for submit@debbugs.gnu.org; Sun, 01 Jan 2017 13:56:11 -0500 Original-Received: from mail-it0-f49.google.com ([209.85.214.49]:35024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cNlId-000688-U6 for 24751@debbugs.gnu.org; Sun, 01 Jan 2017 13:56:08 -0500 Original-Received: by mail-it0-f49.google.com with SMTP id c20so262290052itb.0 for <24751@debbugs.gnu.org>; Sun, 01 Jan 2017 10:56:07 -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=BYhiUdZqL5HvKNSuGCNny391IgJKqvyWoxsIhnVx9DU=; b=C1w6ota0xO/TaCVCZvV0hYKcLk5xTXrrQeG0kj5r6zeezDqi+zYE5OOv/SpB7Vf1dt PzvTztKJGzjSkGMsp/qTy4Lgn26W1JvWI0z0vqcsfzStTtcOG1Ct4DmlRcuebMujwuNp 0yi3ozlj0y/dEacFBxBv0a/ZGV22NBOkH6EhHbCFlTHRLYlV6VyyofaBlnd+vl5WSJ7v 8OWkeghiHsDIPqBDR7zcBcSqcVu5ahS9dH/NoVFKRiPNfAQ1j4FDaqTDtIocooy84zqx hzNjthAfAGBbF5315TZMwYpwwoKUca3LogeF8epl6W5PqKSij0X0rEKnPsHyJYa86eza lkUA== 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=BYhiUdZqL5HvKNSuGCNny391IgJKqvyWoxsIhnVx9DU=; b=W6b9XUNHrfYjb16aEDwUO0kG46GUOOmefS9whg4f/HOlqlkTbnadeVeuBJtpkjbcf2 PqjZ4M0OJGF7JdcSNt6sGhy9DhkGplXrw0n9o+Ua1n8tMvKk3aDXp92D5DtZBL4DXbj4 2PsgQCY2aWartQs06TKqpEDyYQvO+urn4W3JFxspjzSX3vjbDY0YfvryG8vW0Zu4qk7J U0D4LDP1yfnMR2v2tvgUPOgXotuSmtFZDPScZ+z5iGiKhjainmDMs/6VWhapT3WrtFEr j8iEA9CcBgzDGi2smlHzF+u1SGKkhp/I/GhFY08gIdL9/mgYAlFtjmbwjQtoIRBIpWiF hN3Q== X-Gm-Message-State: AIkVDXIZiLn1lGuBf4wv2KP1hMFhGHo4Jietg032EhjgC53fG28/dxhcYnK7vBULJ/nCpA== X-Received: by 10.36.92.145 with SMTP id q139mr48519860itb.107.1483296962134; Sun, 01 Jan 2017 10:56:02 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id l3sm30697073ioa.7.2017.01.01.10.56.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 01 Jan 2017 10:56:01 -0800 (PST) In-Reply-To: <83zijafwqy.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 01 Jan 2017 20:41:57 +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:127662 Archived-At: Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Cc: 24751@debbugs.gnu.org >> Date: Sun, 01 Jan 2017 13:33:35 -0500 >> >> 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 the question. You can compile regex.c with the > "-DREGEX_MALLOC" option whenever you like. We don't do that, ^^^^^^^^^^^^^^^^ Thanks, that's what I was wondering about in my question. > >> I don't understand why you say relocation is dependent on >> REGEX_MALLOC, I thought only REL_ALLOC affects that. > > REL_ALLOC determines whether ralloc.c is compiled in, which I > mentioned above. But if REL_ALLOC is defined, then SAFE_ALLOCA could cause relocation (via malloc) regardless of whether REGEX_MALLOC is defined or not, no?