From owner-freebsd-bugs@FreeBSD.ORG Tue Nov 16 23:40:32 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3857616A4E1 for ; Tue, 16 Nov 2004 23:40:32 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B85143D7D for ; Tue, 16 Nov 2004 23:40:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id iAGNeODA084080 for ; Tue, 16 Nov 2004 23:40:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id iAGNeOm9084078; Tue, 16 Nov 2004 23:40:24 GMT (envelope-from gnats) Resent-Date: Tue, 16 Nov 2004 23:40:24 GMT Resent-Message-Id: <200411162340.iAGNeOm9084078@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jean-Yves Lefort Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E9C4316A4D0 for ; Tue, 16 Nov 2004 23:36:31 +0000 (GMT) Received: from gateway.lefort.net (212.68.242.203.brutele.be [212.68.242.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1BD2543D45 for ; Tue, 16 Nov 2004 23:36:31 +0000 (GMT) (envelope-from jylefort@brutele.be) Received: from jsite.lefort.net (jsite.lefort.net [192.168.1.2]) by gateway.lefort.net (Postfix) with ESMTP id 6DA6E5551 for ; Wed, 17 Nov 2004 00:36:29 +0100 (CET) Received: by jsite.lefort.net (Postfix, from userid 1000) id 1524B22E18; Wed, 17 Nov 2004 00:36:28 +0100 (CET) Message-Id: <20041116233628.1524B22E18@jsite.lefort.net> Date: Wed, 17 Nov 2004 00:36:28 +0100 (CET) From: Jean-Yves Lefort To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/74020: regexec() hangs with UTF-8 locales X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jean-Yves Lefort List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2004 23:40:33 -0000 >Number: 74020 >Category: bin >Synopsis: regexec() hangs with UTF-8 locales >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Nov 16 23:40:23 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Jean-Yves Lefort >Release: FreeBSD 5.3-RELEASE i386 >Organization: >Environment: System: FreeBSD jsite.lefort.net 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Nov 12 15:27:39 CET 2004 jylefort@jsite.lefort.net:/usr/obj/usr/src/sys/JSITE i386 >Description: In some situations, regexec() hangs. >How-To-Repeat: Compile this: --- cut --- #include #include #include #include int main (int argc, char **argv) { int status; regex_t test_re; regmatch_t pmatch[3]; setlocale(LC_ALL, ""); status = regcomp(&test_re, "foo=(.*) bar=(.*)", REG_EXTENDED); assert(status == 0); /* if the locale encoding is UTF-8, this call hangs */ regexec(&test_re, "foo=one bar=two\302\251", test_re.re_nsub + 1, pmatch, 0); return 0; } --- cut --- Works fine when executed with a non UTF-8 locale: $ LANG=en_US.ISO8859-1 ./test $ Hangs when executed with an UTF-8 locale: $ LANG=en_US.UTF-8 ./test >Fix: >Release-Note: >Audit-Trail: >Unformatted: