From owner-freebsd-tcltk@FreeBSD.ORG Sat Jun 1 16:35:15 2013 Return-Path: Delivered-To: tcltk@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 38AC2905 for ; Sat, 1 Jun 2013 16:35:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 9667C6EF for ; Sat, 1 Jun 2013 16:35:14 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::fd3e:b0cb:49ba:1855] (unknown [IPv6:2001:7b8:3a7:0:fd3e:b0cb:49ba:1855]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9D0195C44 for ; Sat, 1 Jun 2013 18:35:10 +0200 (CEST) From: Dimitry Andric Content-Type: multipart/mixed; boundary="Apple-Mail=_8ED3CD7C-CD2A-46A6-9388-0F4BFF18EB3B" Subject: patch: increase tcl86 regular expression depth limit to help dejagnu Message-Id: Date: Sat, 1 Jun 2013 18:35:06 +0200 To: tcltk@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) X-Mailer: Apple Mail (2.1503) X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 16:35:15 -0000 --Apple-Mail=_8ED3CD7C-CD2A-46A6-9388-0F4BFF18EB3B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi, When running the libffi test suite using dejagnu, I ran into the following tcl86 error: ... Running target unix Using /usr/local/share/dejagnu/baseboards/unix.exp as board description = file for target. Using /usr/local/share/dejagnu/config/unix.exp as generic interface file = for target. Using ../../testsuite/config/default.exp as tool-and-target-specific = interface file. Running ../../testsuite/libffi.call/call.exp ... ERROR: tcl error sourcing ../../testsuite/libffi.call/call.exp. ERROR: couldn't compile regular expression pattern: out of memory while executing "regexp $texttmp ${output}" (procedure "saved-dg-test" line 247) invoked from within "saved-dg-test ../../testsuite/libffi.call/huge_struct.c {-O0 -W -Wall} = {}" ("eval" body line 1) invoked from within "eval saved-dg-test $args " (procedure "dg-test" line 6) invoked from within "dg-test $testcase $flags ${default-extra-flags}" (procedure "dg-runtest" line 10) invoked from within "dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W = -Wall" """ (file "../../testsuite/libffi.call/call.exp" line 24) invoked from within "source ../../testsuite/libffi.call/call.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source ../../testsuite/libffi.call/call.exp" invoked from within "catch "uplevel #0 source $test_file_name"" Running ../../testsuite/libffi.special/special.exp ... After some searching, I found this similar bug on Tcl's tracker: = The change that introduced the limit is here: To make tcl86 work for the libffi tests, I simply doubled the limit from 500 to 1000, as in the attached diff. Can you please consider adding this to the tcl86 port? -Dimitry --Apple-Mail=_8ED3CD7C-CD2A-46A6-9388-0F4BFF18EB3B Content-Disposition: attachment; filename=lang__tcl86-double-regex-depth-limit-1.diff Content-Type: application/octet-stream; name="lang__tcl86-double-regex-depth-limit-1.diff" Content-Transfer-Encoding: 7bit Fix tcl out of memory failure when running dejagnu tests, similar to: Running target unix Using /usr/local/share/dejagnu/baseboards/unix.exp as board description file for target. Using /usr/local/share/dejagnu/config/unix.exp as generic interface file for target. Using ../../testsuite/config/default.exp as tool-and-target-specific interface file. Running ../../testsuite/libffi.call/call.exp ... ERROR: tcl error sourcing ../../testsuite/libffi.call/call.exp. ERROR: couldn't compile regular expression pattern: out of memory while executing "regexp $texttmp ${output}" (procedure "saved-dg-test" line 247) invoked from within "saved-dg-test ../../testsuite/libffi.call/huge_struct.c {-O0 -W -Wall} {}" ("eval" body line 1) invoked from within "eval saved-dg-test $args " (procedure "dg-test" line 6) invoked from within "dg-test $testcase $flags ${default-extra-flags}" (procedure "dg-runtest" line 10) invoked from within "dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" """ (file "../../testsuite/libffi.call/call.exp" line 24) invoked from within "source ../../testsuite/libffi.call/call.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source ../../testsuite/libffi.call/call.exp" invoked from within "catch "uplevel #0 source $test_file_name"" Running ../../testsuite/libffi.special/special.exp ... See also: Index: lang/tcl86/files/patch-generic-regc_nfa.c =================================================================== --- lang/tcl86/files/patch-generic-regc_nfa.c (revision 0) +++ lang/tcl86/files/patch-generic-regc_nfa.c (working copy) @@ -0,0 +1,11 @@ +--- ../generic/regc_nfa.c.orig 2011-04-26 17:14:02.000000000 +0200 ++++ ../generic/regc_nfa.c 2013-06-01 18:08:49.000000000 +0200 +@@ -759,7 +759,7 @@ duptraverse( + * Arbitrary depth limit. Needs tuning, but this value is sufficient to + * make all normal tests (not reg-33.14) pass. + */ +-#define DUPTRAVERSE_MAX_DEPTH 500 ++#define DUPTRAVERSE_MAX_DEPTH 1000 + + if (depth++ > DUPTRAVERSE_MAX_DEPTH) { + NERR(REG_ESPACE); --Apple-Mail=_8ED3CD7C-CD2A-46A6-9388-0F4BFF18EB3B-- From owner-freebsd-tcltk@FreeBSD.ORG Sat Jun 1 17:02:15 2013 Return-Path: Delivered-To: tcltk@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9FCA5ED9; Sat, 1 Jun 2013 17:02:15 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-ie0-x230.google.com (mail-ie0-x230.google.com [IPv6:2607:f8b0:4001:c03::230]) by mx1.freebsd.org (Postfix) with ESMTP id 6EAFF7E2; Sat, 1 Jun 2013 17:02:15 +0000 (UTC) Received: by mail-ie0-f176.google.com with SMTP id at20so6639483iec.35 for ; Sat, 01 Jun 2013 10:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=GBKK/T68qLU660hZq5zZyZ/zrZM4zV7tu3cOiVvCHHo=; b=ZHdiCWJchsfDDX0gbwskMMbAoZUADHU4G8EshWVzOLZ/nngUQDsk0BZa78zW664Pm7 /OJU61gseCBVc4Bc6HpM/7RaajDg3L8/JQa42BLe5VFzBg/xQMWKpzW4fh2cm3TQb6CN psjacRoC7uygQbPhJGxBnHaPMFmfeW1/udOjSLcf49g16PNsLwWR0Z+CNW5tFTmyadlP fyU+OTuUZDDNx+mPf7puus1V26nzjQHJjhogKtoTEafrq92uVxsyJPUewJYOdDi+g0gZ E6QBZ4EMDxYQLMG6kIXwHpYUIVOgomvjb7rczJoezpmbL1EVw4GqWq/j7RwnF5dQDtTt 8P4g== X-Received: by 10.50.118.69 with SMTP id kk5mr4079900igb.36.1370106135109; Sat, 01 Jun 2013 10:02:15 -0700 (PDT) MIME-Version: 1.0 Sender: utisoft@gmail.com Received: by 10.64.71.101 with HTTP; Sat, 1 Jun 2013 10:01:45 -0700 (PDT) In-Reply-To: References: From: Chris Rees Date: Sat, 1 Jun 2013 18:01:45 +0100 X-Google-Sender-Auth: TF_kY0d3_l3_wezeHqQEKE842hs Message-ID: Subject: Re: patch: increase tcl86 regular expression depth limit to help dejagnu To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Cc: tcltk@freebsd.org X-BeenThere: freebsd-tcltk@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD-specific Tcl/Tk discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 17:02:15 -0000 On 1 June 2013 17:35, Dimitry Andric wrote: > Hi, > > When running the libffi test suite using dejagnu, I ran into the > following tcl86 error: > > ... > Running target unix > Using /usr/local/share/dejagnu/baseboards/unix.exp as board description file for target. > Using /usr/local/share/dejagnu/config/unix.exp as generic interface file for target. > Using ../../testsuite/config/default.exp as tool-and-target-specific interface file. > Running ../../testsuite/libffi.call/call.exp ... > ERROR: tcl error sourcing ../../testsuite/libffi.call/call.exp. > ERROR: couldn't compile regular expression pattern: out of memory > while executing > "regexp $texttmp ${output}" > (procedure "saved-dg-test" line 247) > invoked from within > "saved-dg-test ../../testsuite/libffi.call/huge_struct.c {-O0 -W -Wall} {}" > ("eval" body line 1) > invoked from within > "eval saved-dg-test $args " > (procedure "dg-test" line 6) > invoked from within > "dg-test $testcase $flags ${default-extra-flags}" > (procedure "dg-runtest" line 10) > invoked from within > "dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "-O0 -W -Wall" """ > (file "../../testsuite/libffi.call/call.exp" line 24) > invoked from within > "source ../../testsuite/libffi.call/call.exp" > ("uplevel" body line 1) > invoked from within > "uplevel #0 source ../../testsuite/libffi.call/call.exp" > invoked from within > "catch "uplevel #0 source $test_file_name"" > Running ../../testsuite/libffi.special/special.exp ... > > After some searching, I found this similar bug on Tcl's tracker: > > > The change that introduced the limit is here: > > > To make tcl86 work for the libffi tests, I simply doubled the limit from > 500 to 1000, as in the attached diff. Can you please consider adding > this to the tcl86 port? The attached diff that I missed, and made by hand >.< Pietro, Mikhail, I see no reason not to commit this? I'll do so tomorrow if neither of you object. Chris http://www.bayofrum.net/~crees/patches/tcl-increase-regex-limit.diff