From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5028 invoked by alias); 17 Dec 2004 08:38:00 -0000 Mailing-List: contact glibc-bugs-regex-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-regex-owner@sources.redhat.com Received: (qmail 4933 invoked by uid 48); 17 Dec 2004 08:37:49 -0000 Date: Fri, 17 Dec 2004 08:38:00 -0000 Message-ID: <20041217083749.4931.qmail@sourceware.org> From: "bonzini at gnu dot org" To: glibc-bugs-regex@sources.redhat.com In-Reply-To: <20041217083412.611.bonzini@gnu.org> References: <20041217083412.611.bonzini@gnu.org> Reply-To: sourceware-bugzilla@sources.redhat.com Subject: [Bug regex/611] regex with a long character sequence requires huge stack space X-Bugzilla-Reason: CC X-SW-Source: 2004-12/txt/msg00007.txt.bz2 List-Id: ------- Additional Comments From bonzini at gnu dot org 2004-12-17 08:37 ------- Created an attachment (id=312) --> (http://sources.redhat.com/bugzilla/attachment.cgi?id=312&action=view) patch fixing this bug This patch is a big one that completely separates parse tree creation and NFA construction. It was posted on http://sources.redhat.com/ml/libc-alpha/2004-12/msg00045.html first; this version is identical except that it includes the bug 605 changes on which the libc-alpha patch is based. Improvements in this patch include: 1) It eliminates recursion on CONCAT nodes from regcomp.c; with an 8 MB stack, perl -e "print 's/' . ('a' x 300000) . '//'" | sed -f - segfaults in analyze_tree without the patch. Of course with a lower stack size it takes much shorter regexes to trigger the bug, and anyway this is not nice behavior (ok, regex is a memory hog but at least it usually gives REG_ESPACE). I don't have the time to fix this in a different way -- as I said, I am not doing this just for fun. 2) It provides a useful infrastructure while actually removing code from regcomp.c (the patched file is ~60 lines shorter). This infrastructure can help in turn removing code from regexec.c and making it faster (see for example the star-normal form mentioned in libc-alpha). -- http://sources.redhat.com/bugzilla/show_bug.cgi?id=611 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.