NetBSD Problem Report #57365

From  Tue Apr 18 10:55:55 2023
Return-Path: <>
Received: from ( [])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 5D0A71A9239
	for <>; Tue, 18 Apr 2023 10:55:55 +0000 (UTC)
Message-Id: <>
Date: Tue, 18 Apr 2023 10:55:54 +0000 (UTC)
Subject: shells/fish crash when CURSES_DEFAULT is ncurses
X-Send-Pr-Version: www-1.0

>Number:         57365
>Category:       pkg
>Synopsis:       shells/fish crash when CURSES_DEFAULT is ncurses
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 18 11:00:01 +0000 2023
>Last-Modified:  Tue May 09 23:26:30 +0000 2023
>Originator:     Chavdar Ivanov
>Release:        pkgsrc -current as of 17/04/2023
CI4 Consulting Ltd
NetBSD ymir.lorien.lan 10.99.3 NetBSD 10.99.3 (GENERIC) #3: Thu Apr 13 14:24:47 BST 2023  sysbuild@ymir.lorien.lan:/dumps/sysbuild/amd64/obj/home/sysbuild/src/sys/arch/amd64/compile/GENERIC amd64
The package Makefile includes unconditional libterminfo linking under NetBSD. This clashes with the ncurses terminfo routines and is necessary only when the buildint curses is used. The trace looks like:
Thread 1 (LWP 20753 of process 20753 ""):
#0  0x000076ee2e4fef13 in _ti_parm_analyse () from /usr/lib/
#1  0x000076ee2e4ff04d in ?? () from /usr/lib/
#2  0x000076ee2e4ffda4 in ?? () from /usr/lib/
#3  0x000000000021f5d0 in screen_t::reset_abandoning_line (this=this@entry=0x76ee2d9fb478, screen_width=158) at /usr/include/g++/ext/new_allocator.h:79
#4  0x000000000021c244 in reader_data_t::readline[abi:cxx11](int) (this=0x76ee2d9fb010, nchars_or_0=nchars_or_0@entry=0) at /usr/pkgsrc/shells/fish/work/fish-3.6.1/src/reader.cpp:4415
#5  0x000000000021d191 in read_i (parser=...) at /usr/include/g++/bits/shared_ptr_base.h:1329
#6  reader_read (parser=..., fd=fd@entry=0, io=...) at /usr/pkgsrc/shells/fish/work/fish-3.6.1/src/reader.cpp:4762
#7  0x00000000002c8732 in main (argc=<optimized out>, argv=0x7f7fffa6c958) at /usr/pkgsrc/shells/fish/work/fish-3.6.1/src/fish.cpp:571

Thanks to for the analysis. 
Build shells/fish v3.6.1 with CURSES_DEFAULT=ncurses.
Index: Makefile
RCS file: /cvsroot/pkgsrc/shells/fish/Makefile,v
retrieving revision 1.42
diff -u -r1.42 Makefile
--- Makefile    29 Mar 2023 09:39:02 -0000      1.42
+++ Makefile    18 Apr 2023 10:54:29 -0000
@@ -28,7 +28,9 @@
 CXXFLAGS.NetBSD+=      -fpermissive
 LDFLAGS+=              -lexecinfo
+.if ${CURSES_DEFAULT} != "ncurses"
 LDFLAGS.NetBSD+=       -lterminfo

 # Upstream intentionally omits open.1 on Darwin, but adds realpath.1
 PLIST_VARS+=   open realpath
cvs diff: Diffing patches


From: David Holland <>
Subject: Re: pkg/57365: shells/fish crash when CURSES_DEFAULT is ncurses
Date: Tue, 9 May 2023 23:20:42 +0000

 On Tue, Apr 18, 2023 at 11:00:01AM +0000, wrote:
  > +.if ${CURSES_DEFAULT} != "ncurses"
  >  LDFLAGS.NetBSD+=       -lterminfo
  > +.endif

 This should be keyed to CURSES_TYPE (chosen by rather
 than the default setting, since at least in theory the resolved type
 might be different and that's the one we want.

 ...also it should be LIBS and not LDFLAGS :-)

 David A. Holland

From: "David A. Holland" <>
Subject: PR/57365 CVS commit: pkgsrc/shells/fish
Date: Tue, 9 May 2023 23:23:37 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Tue May  9 23:23:37 UTC 2023

 Modified Files:
 	pkgsrc/shells/fish: Makefile

 Log Message:
 shells/fish: fix ncurses linkage, from Chavdar Ivanov and RVP in PR 57365

 Only add -lterminfo when using base curses on NetBSD, not ncurses.
 Also put it in LIBS, not LDFLAGS :-)

 The previous behavior gives a bad build, but only with non-default
 settings, so I'm not bumping the revision.

 XXX: the magic to add -lterminfo probably belongs in

 To generate a diff of this commit:
 cvs rdiff -u -r1.42 -r1.43 pkgsrc/shells/fish/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-When: Tue, 09 May 2023 23:26:30 +0000
fixed slightly differently, please crosscheck that it works just in case :-)


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.