From owner-freebsd-bugs@FreeBSD.ORG Sat Dec 7 16:20:02 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2315EF93 for ; Sat, 7 Dec 2013 16:20:02 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E82DF16D9 for ; Sat, 7 Dec 2013 16:20:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id rB7GK1QE022692 for ; Sat, 7 Dec 2013 16:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id rB7GK0Y4022691; Sat, 7 Dec 2013 16:20:00 GMT (envelope-from gnats) Date: Sat, 7 Dec 2013 16:20:00 GMT Message-Id: <201312071620.rB7GK0Y4022691@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Wolfgang Jenkner Subject: Re: bin/182463: vi(1): vi core dumps on exit with a specific vi.exrc [regression] X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Wolfgang Jenkner List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2013 16:20:02 -0000 The following reply was made to PR bin/182463; it has been noted by GNATS. From: Wolfgang Jenkner To: bug-followup@FreeBSD.org Cc: Martin.Birgmeier@aon.at Subject: Re: bin/182463: vi(1): vi core dumps on exit with a specific vi.exrc [regression] Date: Sat, 07 Dec 2013 17:10:58 +0100 --=-=-= Content-Type: text/plain I can reproduce the bug on 10.0-BETA3 when setting MALLOC_CONF=junk:true in vi's environment. However, even with the default malloc options, vi crashes reliably when the terminal window where it runs is resized (which makes vi rather unusable with a dwm-style tiling window manager). Both crashes seem to be due to an oversight in commit 68ca13 in the upstream nvi2 repo https://github.com/lichray/nvi2 The (hopefully) attached patch fixes this. It can be applied with `patch -p1 <...' in /usr/src/contrib/nvi and vi can then be rebuilt from /usr/src/usr.bin/vi. Note that NetBSD, OpenBSD and skimo's nvi don't use SLIST, but DFly does and so has probably the same bug. I have Bcc'ed lichray in order not to expose his address here. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-SLIST-surgery.patch Content-Description: SLIST migration fix From 0facfe2d0586822291b18aa25433f76a19d70d2d Mon Sep 17 00:00:00 2001 From: Wolfgang Jenkner Date: Fri, 22 Nov 2013 16:44:45 +0100 Subject: [PATCH] Fix SLIST surgery. Mostly copied from seq_delete. --- cl/cl_term.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cl/cl_term.c b/cl/cl_term.c index 3d8cdb2..4761ee2 100644 --- a/cl/cl_term.c +++ b/cl/cl_term.c @@ -187,14 +187,18 @@ cl_term_init(SCR *sp) int cl_term_end(GS *gp) { - SEQ *qp, *nqp; + SEQ *qp, *nqp, *pre_qp = NULL; /* Delete screen specific mappings. */ SLIST_FOREACH_SAFE(qp, gp->seqq, q, nqp) if (F_ISSET(qp, SEQ_SCREEN)) { - SLIST_REMOVE_HEAD(gp->seqq, q); + if (qp == SLIST_FIRST(gp->seqq)) + SLIST_REMOVE_HEAD(gp->seqq, q); + else + SLIST_REMOVE_AFTER(pre_qp, q); (void)seq_free(qp); - } + } else + pre_qp = qp; return (0); } -- 1.8.4.3 --=-=-=--