From nobody Tue Feb 17 23:43:39 2026 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fFx6g6MPHz6SHZV for ; Tue, 17 Feb 2026 23:43:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fFx6g5kzVz4PF0 for ; Tue, 17 Feb 2026 23:43:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771371819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XHuhymDI+BqzduZIdH0g2GaPnLiCi3rhxzUreOxu7Cs=; b=ZkxgTfy50jrbqX7NgmUR68evQK9DgsN85GV/kMHqFf0eKD+zZ8/UBw8fFLUM7qtknK5kGM qZ2gTC5fPRgw4sIyLUvEgDdspYLOyyGkwmvIm7EhKR6gT8DjMKoBKwShm/4uFUQSrOrTac weS02cDrk3ek1Kh+34xjlyH9MHTgx8OVKOcnL1DHN7uz2XWQOTLsl1St0Q/4qvK25CCpU/ UDkn4Jh1o8MPvLERotBaW9vykfw6yS4+v2aZrMGbqQf5ucAKl2UiJH4XqqfURK8UIIStr1 Hr8nNiid/hdmDRI+79189bJdfk/8YvpTX2F4PrTd5+kpA5POZcBLlFO62ZaHFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771371819; a=rsa-sha256; cv=none; b=UkXYNlzeqzNS5mzYtCZsDirq52fi/c6/wN1ybTiQMNfo/aFOxIwHaWOO6u0S0FGvVydiD8 lXyM5wnb389GRoY+YBUPAL6LwDfcDgwk2R/1WD/la4ejY+njNx3Qmje+LcnGcvJrsqizIS ySYSOltIR41aKIu6NNEXRS7q3hLFD41TRicDSnm9dE4RkE92nck22peaaq+7WljMkLS0C1 ZrOTVNFmwAdZbs3L/ZAJsYzk/7wgxYsclxO/m9tAXhILul4JkunejWhdfNIWuL9v6dwej5 WH3uEc8tjEMxhS87Jh+l7vpXfqptsfP3akCGf8x6pWsaRI17CyvET8cOV1LyRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771371819; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XHuhymDI+BqzduZIdH0g2GaPnLiCi3rhxzUreOxu7Cs=; b=P9vGToscLm/9h8mB4lJokOih1j/eesB3ZiurHnEe6OBp/dmEv/PAFrsRfJH744EeGFUWNx CYDoiVOBn3j+ZMYuwq65s6v5r/XypWc4dK3vAiEoW+G7ZzRcq1yYUgyD0BzI4eFLSYKVw5 QeZOAuYMkFXSlL2U6a0JZEQCQVsvfd5aL7imn/N/7uPSF0UI/JaoWqlaV5HlAxaXCfZ8a+ T3QKyehhjbY8MVnYWCZw5yYqbBos151cDlTvXqm2XhyGC34YWywSm/yingX2p5uE/dbr84 iughOpQMJo/bKFTyMAOC34tYtg05cmiiDa1aXCQ9N/9bVVIT4UDcgmIpStgOkQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4fFx6g5L2vzWrV for ; Tue, 17 Feb 2026 23:43:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 61HNhd3u065078 for ; Tue, 17 Feb 2026 23:43:39 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 61HNhd2Y065077 for bugs@FreeBSD.org; Tue, 17 Feb 2026 23:43:39 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 293252] grep(1) hangs when trying to colorize multiple patterns Date: Tue, 17 Feb 2026 23:43:39 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 14.3-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: freebsd@tim.thechases.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D293252 Bug ID: 293252 Summary: grep(1) hangs when trying to colorize multiple patterns Product: Base System Version: 14.3-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: freebsd@tim.thechases.com To reproduce: $ printf 'one\ntwo\nthree\n' | /usr/bin/grep --color=3Dalways -ie ^ -e = wo one Expected behavior: It *should* print all lines (everything matches the "^", but as a zero-width atom, not highlight it), highlighting the "wo" in "two". This is how Ubunt= u's grep(1) behaves. OpenBSD's grep doesn't support --color so I can't reprodu= ce there. Current behavior: It prints the "one" line then it hangs indefinitely pegging a CPU to 100% according to top(1). Observations: - It works if the second pattern starts at the beginning of a line (searchi= ng for "tw" instead of "wo"): $ printf 'one\ntwo\nthree\n' | grep --color=3Dalways -i -e '^' -e tw - It works if I don't _also_ search for the beginning of the line: $ printf 'one\ntwo\nthree\n' | grep --color=3Dalways -i -e wo - It works if I search for '$' as the first pattern instead: $ printf 'one\ntwo\nthree\n' | grep --color=3Dalways -i -e '$' -e wo - It works if I swap the order of the two: $ printf 'one\ntwo\nthree\n' | grep --color=3Dalways -i -e wo -e ^ If I remove the `--color=3Dalways` it works. $ printf 'one\ntwo\nthree\n' | grep -i -e '^' -e wo So there's something in the interaction of the three (the `^` pattern coming first, a second not-starting-at-the-beginning-of-the-line pattern, and the `--color=3Dalways`) that seems to trigger the process-hang/infinite-loop is= sue. --=20 You are receiving this mail because: You are the assignee for the bug.=