From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 471C21F466 for ; Mon, 20 Jan 2020 10:41:34 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:from:to:cc:references:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=G7Xfkp6gZoRikv8S +gRKfV5eW73i33g7uOQVTHMPs6zJhL5xomKhJjDlS+sYWurJh85YGYcY5sVKHhbR 1bPWzZv7gh5IZgfM3YEQeTYTn2F+1NaLZYmlq90gxY2jYjvRxO3uCn3QXLLmDttB nieEgcyhbQtPiw4k51HTMtx6Q7w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:from:to:cc:references:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=NTn35tBfhv7WrARieVlM1P a/01E=; b=VtQhUtbpTOQ19GBQOnMPTP3ZKffKdHC4vKylWtjjHmI+FB/BSZcuPY 2y7jjRwwc0BxH3323t3SikavVfAphlTsqCcWqxVnFBuBEBfU6Uod+LjP4bnGFimN E+aTcUofuAfFY4O7MXZbXq8GghCWcS+yJz9UT3vUardTNdHQn3jhQ= Received: (qmail 12979 invoked by alias); 20 Jan 2020 10:41:31 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 12893 invoked by uid 89); 20 Jan 2020 10:41:31 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: huawei.com Subject: Re: question about regex From: liqingqing To: Paul Eggert , =?UTF-8?Q?Tim_R=c3=bchsen?= CC: , Florian Weimer , "Carlos O'Donell" , Hushiyuan , Liusirui References: <05dfac46-6cf3-1f5d-14e7-3c8b07b2093e@cs.ucla.edu> <377311fb-fdf3-6467-3b48-28404d8c3326@huawei.com> Message-ID: Date: Mon, 20 Jan 2020 18:41:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <377311fb-fdf3-6467-3b48-28404d8c3326@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On 2020/1/3 16:09, liqingqing wrote: > > > On 2020/1/3 6:14, Paul Eggert wrote: >> On 1/2/20 8:16 AM, Tim Rühsen wrote: >>> Meanwhile grep (or libc) seems to exit gracefully: >> >> Yes, there's no core dump if the operating system supports stack overflow detection that grep can use. The problem occurs only on OSes that don't do that, or on apps that don't try to detect stack overflow and simply dump core (or worse). >> >> On 1/2/20 2:54 AM, liqingqing wrote: >> >>> do we have any plan or good ways to fix up the bug as below >> >> The best way would be to fix bug#24269, i.e., fix the glibc regex code so that it doesn't blow the stack. If you could write a patch for this bug (something that doesn't hurt performance for ordinary regexps), that would be welcome. >> hello everyone, I have read the regex source code and found that it's not a easy work to fix bug#24269 by modify the regex algorithm. a possible way is that add a backtrack limit to avoid infinite loop. I have tested this way and it works ok. so what do you think about the bug#24269? optimize the algorithm or add a backtrack-limit? or not fix.