From owner-freebsd-bugs@freebsd.org Mon Sep 14 12:37:26 2020 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 486A73D52DF for ; Mon, 14 Sep 2020 12:37:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4Bqm8k1Gdkz4dLm for ; Mon, 14 Sep 2020 12:37:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 299053D52DE; Mon, 14 Sep 2020 12:37:26 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 295873D5473 for ; Mon, 14 Sep 2020 12:37:26 +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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bqm8k0Lm2z4dTD for ; Mon, 14 Sep 2020 12:37:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) 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 E38D817393 for ; Mon, 14 Sep 2020 12:37:25 +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 08ECbPvH079550 for ; Mon, 14 Sep 2020 12:37:25 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 08ECbPkx079549 for bugs@FreeBSD.org; Mon, 14 Sep 2020 12:37:25 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 249308] col(1) segfaults with '\v' Date: Mon, 14 Sep 2020 12:37:26 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: rajeev_v_pillai@yahoo.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: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Sep 2020 12:37:26 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D249308 --- Comment #1 from Rajeev Pillai --- col(1) segfaults with this simple test case: $ printf 'hello\vworld\n' | col world Segmentation fault $ sudo lldb col (lldb) target create "col" Current executable set to 'col' (x86_64). (lldb) run Process 73895 launching Process 73895 launched: '/usr/home/rvp/work/col' (x86_64) hello^Kworld world Process 73895 stopped * thread #1, name =3D 'col', stop reason =3D signal SIGSEGV: invalid addres= s (fault address: 0x10) frame #0: 0x0000000000202f4d col`flush_lines(nflush=3D58) at col.c:371:= 14 368=20=20 369 while (--nflush >=3D 0) { 370 l =3D lines; -> 371 lines =3D l->l_next; 372 if (l->l_line) { 373 flush_blanks(); 374 flush_line(l); (lldb) quit Quitting LLDB will kill one or more processes. Do you really want to procee= d: [Y/n] y $ uname -a FreeBSD X202E.localdomain 12.1-RELEASE-p9 FreeBSD 12.1-RELEASE-p9 GENERIC=20 amd64 $ Patch to fix this: --- START PATCH --- diff -urN a/col.c b/col.c --- a/col.c 2019-11-01 00:02:51.000000000 +0000 +++ b/col.c 2020-09-14 11:34:11.054313000 +0000 @@ -366,7 +366,7 @@ { LINE *l; - while (--nflush >=3D 0) { + while (--nflush >=3D 0 && lines) { l =3D lines; lines =3D l->l_next; if (l->l_line) { --- END PATCH --- -RVP --=20 You are receiving this mail because: You are the assignee for the bug.=