From owner-freebsd-amd64@FreeBSD.ORG Mon Jan 3 20:00:29 2011 Return-Path: Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD00C106566B for ; Mon, 3 Jan 2011 20:00:29 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8FF608FC15 for ; Mon, 3 Jan 2011 20:00:29 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p03K0Tlc026190 for ; Mon, 3 Jan 2011 20:00:29 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p03K0TlI026189; Mon, 3 Jan 2011 20:00:29 GMT (envelope-from gnats) Resent-Date: Mon, 3 Jan 2011 20:00:29 GMT Resent-Message-Id: <201101032000.p03K0TlI026189@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-amd64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Olivier Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE5E3106566B for ; Mon, 3 Jan 2011 19:53:20 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id BDDC48FC15 for ; Mon, 3 Jan 2011 19:53:20 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p03JrKEs023973 for ; Mon, 3 Jan 2011 19:53:20 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p03JrK1w023972; Mon, 3 Jan 2011 19:53:20 GMT (envelope-from nobody) Message-Id: <201101031953.p03JrK1w023972@red.freebsd.org> Date: Mon, 3 Jan 2011 19:53:20 GMT From: Olivier To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 X-Mailman-Approved-At: Mon, 03 Jan 2011 23:55:39 +0000 Cc: Subject: amd64/153659: awk segfaults when trying to extract a combination of special characters X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jan 2011 20:00:29 -0000 >Number: 153659 >Category: amd64 >Synopsis: awk segfaults when trying to extract a combination of special characters >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-amd64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Jan 03 20:00:29 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Olivier >Release: 8.1 >Organization: interfaSys Ltd >Environment: FreeBSD 8.1-STABLE FreeBSD 8.1-STABLE #0 r213396 amd64 >Description: awk seg faults when it has to deal with at least one sequence of characters. This makes it crash: %* I don't know if it happens with other combinations >How-To-Repeat: # edit conf Type this GPG_PW='%*' # edit awk_test.sh Type this awk '/^[ \t]*GPG_PW[ \t=]/{\ sub(/^[ \t]*GPG_PW[ \t]*=*/,"",$0);\ gsub(/^[ \t]*[\047"]|[\047"][ \t]*$/,"",$0);\ printf $0; exit}' "$1" Now try to extract GPG_PW # ./awk_test.sh conf You will get this: ./awk_test.sh: line 4: 18676 Segmentation fault: 11 (core dumped) awk '/^[ \t]*GPG_PW[ \t=]/{\ sub(/^[ \t]*GPG_PW[ \t]*=*/,"",$0);\ gsub(/^[ \t]*[\047"]|[\047"][ \t]*$/,"",$0);\ printf $0; exit}' "$1" >Fix: I'm not aware of any fixes >Release-Note: >Audit-Trail: >Unformatted: