bin/182463: vi(1): vi core dumps on exit with a specific vi.exrc [regression]
Wolfgang Jenkner
wjenkner at inode.at
Sat Dec 7 16:20:02 UTC 2013
The following reply was made to PR bin/182463; it has been noted by GNATS.
From: Wolfgang Jenkner <wjenkner at inode.at>
To: bug-followup at FreeBSD.org
Cc: Martin.Birgmeier at 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 <wjenkner at inode.at>
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
--=-=-=--
More information about the freebsd-bugs
mailing list