From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 22 02:59:33 2014 Received: (at submit) by debbugs.gnu.org; 22 Mar 2014 06:59:33 +0000 Received: from localhost ([127.0.0.1]:44117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRFu0-0001mX-8u for submit@debbugs.gnu.org; Sat, 22 Mar 2014 02:59:32 -0400 Received: from pbsg500.nifty.com ([202.248.238.70]:20065) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRFtt-0001mI-SD for submit@debbugs.gnu.org; Sat, 22 Mar 2014 02:59:29 -0400 Received: from [10.120.1.43] (i118-21-128-66.s30.a048.ap.plala.or.jp [118.21.128.66]) (authenticated) by pbsg500.nifty.com with ESMTP id s2M6xBB6022219 for ; Sat, 22 Mar 2014 15:59:12 +0900 X-Nifty-SrcIP: [118.21.128.66] Date: Sat, 22 Mar 2014 15:59:11 +0900 From: Norihiro Tanaka To: submit@debbugs.gnu.org Subject: a DFA state which is built previously may be re-built in non-UTF8 locales Message-Id: <20140322155805.E745.27F6AC2D@kcn.ne.jp> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------_531AAC47000000000212_MULTIPART_MIXED_" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.65.07 [ja] X-Spam-Score: 2.7 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Package: grep When don't pass backref parameter to dfaexec(), a DFA state which is built previously may be re-built. In non-UTF8 locales, when reach a state which mbps aren't empty, exit main loop and call build_state() in dfa.c, even if the state has been already built. [...] Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [202.248.238.70 listed in psbl.surriel.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.7 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Package: grep When don't pass backref parameter to dfaexec(), a DFA state which is built previously may be re-built. In non-UTF8 locales, when reach a state which mbps aren't empty, exit main loop and call build_state() in dfa.c, even if the state has been already built. [...] Content analysis details: (2.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [202.248.238.70 listed in psbl.surriel.com] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record --------_531AAC47000000000212_MULTIPART_MIXED_ Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Package: grep When don't pass backref parameter to dfaexec(), a DFA state which is built previously may be re-built. In non-UTF8 locales, when reach a state which mbps aren't empty, exit main loop and call build_state() in dfa.c, even if the state has been already built. That will cause increase of processing time, and waste of a lot of memories. Fortunately, grep program doesn't pass the code in dfa.c unless mblen_buf overflows, since backref parameter is specified when dfaexec() is called with large buffer. Norihiro --------_531AAC47000000000212_MULTIPART_MIXED_ Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch.txt" >From fba7984fa2a5baff18e1b48611c3d7fb3701255b Mon Sep 17 00:00:00 2001 From: Norihiro Tanaka Date: Sat, 22 Mar 2014 15:11:52 +0900 Subject: [PATCH] grep: avoid to re-build a state built previously. * src/dfa.c (dfaexec): avoid to re-build a state built previously. --- src/dfa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dfa.c b/src/dfa.c index 5e60cd5..8261849 100644 --- a/src/dfa.c +++ b/src/dfa.c @@ -3501,7 +3501,8 @@ dfaexec (struct dfa *d, char const *begin, char *end, if (s >= 0) { - build_state (s, d); + if (!d->trans[s]) + build_state (s, d); trans = d->trans; continue; } -- 1.9.1 --------_531AAC47000000000212_MULTIPART_MIXED_-- From debbugs-submit-bounces@debbugs.gnu.org Sat Mar 22 18:53:01 2014 Received: (at control) by debbugs.gnu.org; 22 Mar 2014 22:53:01 +0000 Received: from localhost ([127.0.0.1]:45181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRUmi-0004Jl-RG for submit@debbugs.gnu.org; Sat, 22 Mar 2014 18:53:01 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:46952) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WRUmf-0004JZ-Nd for control@debbugs.gnu.org; Sat, 22 Mar 2014 18:52:58 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id A995839E8017 for ; Sat, 22 Mar 2014 15:52:56 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PYsDS3HI2Ff8 for ; Sat, 22 Mar 2014 15:52:56 -0700 (PDT) Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 6365539E8008 for ; Sat, 22 Mar 2014 15:52:56 -0700 (PDT) Message-ID: <532E1448.403@cs.ucla.edu> Date: Sat, 22 Mar 2014 15:52:56 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: control@debbugs.gnu.org Subject: mark bugs that have patches Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) tags 17066 + patch tags 17056 + patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 01 04:47:34 2014 Received: (at 17066) by debbugs.gnu.org; 1 Apr 2014 08:47:34 +0000 Received: from localhost ([127.0.0.1]:58715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WUuM1-0004ML-Ot for submit@debbugs.gnu.org; Tue, 01 Apr 2014 04:47:34 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:37697) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WUuLz-0004MC-LQ for 17066@debbugs.gnu.org; Tue, 01 Apr 2014 04:47:32 -0400 Received: by mail-wi0-f179.google.com with SMTP id z2so2909467wiv.0 for <17066@debbugs.gnu.org>; Tue, 01 Apr 2014 01:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=8SvAf9Xqanm2WaRjUMIYFR48lcaY2BrAF9k31n15E5w=; b=VMQl9ob2+HWIOf0ZyBkV58KQku7a2MVb5IQPd3Y3vVa4t0evLVg4FETVtyVDB5Zj1v 7uzuYXPiUJmzhxM8thfeRjjoGhk2pJ8Ds3r9RbCq2zVb01OL43Ib/ixhSNusFfJk8w9J MVV60BOwuea8DkLIi9ajZFYPBRktJYyU1ApMo21/VHKWTSnZrkSUk1XHT3c5n9i7EtYI D+ZELSKoDgTvVcHdcOgtlSDizDHy2HOoNOr7j1b2Hp5X732jPPIhWqFkJvcXDcKGE/9t Sf9kutOi8C+g1Q+7o3U0iPGUx8Xwlv5Df6hX4dMomJfUuEcP3NHz97DsQAA2szx/z3O2 07Kg== X-Received: by 10.180.87.233 with SMTP id bb9mr16365296wib.10.1396342050776; Tue, 01 Apr 2014 01:47:30 -0700 (PDT) Received: from yakj.usersys.redhat.com (net-37-117-156-129.cust.vodafonedsl.it. [37.117.156.129]) by mx.google.com with ESMTPSA id o5sm39023219eeg.8.2014.04.01.01.47.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 01:47:29 -0700 (PDT) Message-ID: <533A7D1F.2030209@gnu.org> Date: Tue, 01 Apr 2014 10:47:27 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Norihiro Tanaka , 17066@debbugs.gnu.org Subject: Re: bug#17066: a DFA state which is built previously may be re-built in non-UTF8 locales References: <20140322155805.E745.27F6AC2D@kcn.ne.jp> In-Reply-To: <20140322155805.E745.27F6AC2D@kcn.ne.jp> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 17066 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Il 22/03/2014 07:59, Norihiro Tanaka ha scritto: > > From fba7984fa2a5baff18e1b48611c3d7fb3701255b Mon Sep 17 00:00:00 2001 > From: Norihiro Tanaka > Date: Sat, 22 Mar 2014 15:11:52 +0900 > Subject: [PATCH] grep: avoid to re-build a state built previously. > > * src/dfa.c (dfaexec): avoid to re-build a state built previously. > --- > src/dfa.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/dfa.c b/src/dfa.c > index 5e60cd5..8261849 100644 > --- a/src/dfa.c > +++ b/src/dfa.c > @@ -3501,7 +3501,8 @@ dfaexec (struct dfa *d, char const *begin, char *end, > > if (s >= 0) > { > - build_state (s, d); > + if (!d->trans[s]) > + build_state (s, d); > trans = d->trans; > continue; > } > -- 1.9.1 Thanks, I'll apply this patch. Paolo From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 02 01:25:57 2014 Received: (at 17066-done) by debbugs.gnu.org; 2 Apr 2014 05:25:57 +0000 Received: from localhost ([127.0.0.1]:59970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVDgS-0000oi-3e for submit@debbugs.gnu.org; Wed, 02 Apr 2014 01:25:56 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:42549) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVDgM-0000oT-LZ for 17066-done@debbugs.gnu.org; Wed, 02 Apr 2014 01:25:51 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 9E84339E8014; Tue, 1 Apr 2014 22:25:49 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q7qLgMDnXjr4; Tue, 1 Apr 2014 22:25:41 -0700 (PDT) Received: from [192.168.1.9] (pool-108-0-233-62.lsanca.fios.verizon.net [108.0.233.62]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 1159039E8013; Tue, 1 Apr 2014 22:25:41 -0700 (PDT) Message-ID: <533B9F54.3050604@cs.ucla.edu> Date: Tue, 01 Apr 2014 22:25:40 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Paolo Bonzini , Norihiro Tanaka , 17066-done@debbugs.gnu.org Subject: Re: bug#17066: a DFA state which is built previously may be re-built in non-UTF8 locales References: <20140322155805.E745.27F6AC2D@kcn.ne.jp> <533A7D1F.2030209@gnu.org> In-Reply-To: <533A7D1F.2030209@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.9 (--) X-Debbugs-Envelope-To: 17066-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.9 (--) Paolo Bonzini wrote: > Thanks, I'll apply this patch. Thanks, closing this bug report as done. From unknown Sat Jun 14 19:35:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 30 Apr 2014 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator