From owner-freebsd-current@freebsd.org Mon Mar 29 23:31:42 2021 Return-Path: Delivered-To: freebsd-current@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 716805AFD7E for ; Mon, 29 Mar 2021 23:31:42 +0000 (UTC) (envelope-from btv1==72253626328==tom@invisible-island.net) Received: from smtp-1a.his.com (smtp-1a.his.com [216.194.196.25]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4F8TP93CNfz4tHL for ; Mon, 29 Mar 2021 23:31:41 +0000 (UTC) (envelope-from btv1==72253626328==tom@invisible-island.net) Received: from cuda201.his.com (cuda201.his.com [216.194.196.22]) by smtp-1a.his.com (Postfix) with ESMTPS id 4637AEC for ; Mon, 29 Mar 2021 19:31:40 -0400 (EDT) X-ASG-Debug-ID: 1617060699-061c415d62cb8d0001-85yNCL Received: from smtp-nf-202.his.com (smtp-nf-202.his.com [216.194.196.20]) by cuda201.his.com with ESMTP id EbcJ8znjqJmYxybH; Mon, 29 Mar 2021 19:31:39 -0400 (EDT) X-Barracuda-Envelope-From: tom@invisible-island.net X-Barracuda-RBL-Trusted-Forwarder: 216.194.196.20 Received: from zproxy101.his.com (zproxy101.his.com [18.218.2.49]) by smtp-nf-202.his.com (Postfix) with ESMTPS id 8BE716099E; Mon, 29 Mar 2021 19:31:39 -0400 (EDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by zproxy101.his.com (Postfix) with ESMTP id 59FDE17811C; Mon, 29 Mar 2021 19:31:39 -0400 (EDT) X-Barracuda-RBL-IP: 18.218.2.49 X-Barracuda-Effective-Source-IP: zproxy101.his.com[18.218.2.49] X-Barracuda-Apparent-Source-IP: 18.218.2.49 Received: from zproxy101.his.com ([127.0.0.1]) by localhost (zproxy101.his.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id xfnjuOb0k8-9; Mon, 29 Mar 2021 19:31:39 -0400 (EDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by zproxy101.his.com (Postfix) with ESMTP id 41BBD17A3A7; Mon, 29 Mar 2021 19:31:39 -0400 (EDT) X-Virus-Scanned: amavisd-new at zproxy101.his.com Received: from zproxy101.his.com ([127.0.0.1]) by localhost (zproxy101.his.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id me_dPqX_0REs; Mon, 29 Mar 2021 19:31:39 -0400 (EDT) Received: from prl-debianold-64.jexium-island.net (static-71-246-219-82.washdc.fios.verizon.net [71.246.219.82]) by zproxy101.his.com (Postfix) with ESMTPSA id 28AF117811C; Mon, 29 Mar 2021 19:31:39 -0400 (EDT) Received: from tom by prl-debianold-64.jexium-island.net with local (Exim 4.92) (envelope-from ) id 1lR1MA-0001Bw-Rf; Mon, 29 Mar 2021 19:31:38 -0400 Date: Mon, 29 Mar 2021 19:31:38 -0400 From: Thomas Dickey To: Henric Jungheim Cc: FreeBSD-current@freebsd.org Subject: Re: 13.0-RC3 bison causes tputs SIGSEGV Message-ID: <20210329233138.GA4334@prl-debianold-64.jexium-island.net> X-ASG-Orig-Subj: Re: 13.0-RC3 bison causes tputs SIGSEGV Reply-To: dickey@his.com References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Barracuda-Connect: smtp-nf-202.his.com[216.194.196.20] X-Barracuda-Start-Time: 1617060699 X-Barracuda-URL: https://spam.his.com:443/cgi-mod/mark.cgi X-Barracuda-BRTS-Status: 1 X-Virus-Scanned: by bsmtpd at his.com X-Barracuda-Scan-Msg-Size: 4714 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=6.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.88878 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Rspamd-Queue-Id: 4F8TP93CNfz4tHL X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of btv1==72253626328==tom@invisible-island.net designates 216.194.196.25 as permitted sender) smtp.mailfrom=btv1==72253626328==tom@invisible-island.net X-Spamd-Result: default: False [-5.20 / 15.00]; HAS_REPLYTO(0.00)[dickey@his.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:216.194.196.0/22]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[dickey@his.com,btv1==72253626328==tom@invisible-island.net]; RCVD_IN_DNSWL_LOW(-0.10)[216.194.196.25:from]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[216.194.196.25:from]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_NEQ_ENVFROM(0.00)[dickey@his.com,btv1==72253626328==tom@invisible-island.net]; ASN(0.00)[asn:11604, ipnet:216.194.196.0/24, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[his.com]; SPAMHAUS_ZRD(0.00)[216.194.196.25:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_COUNT_SEVEN(0.00)[10]; MAILMAN_DEST(0.00)[FreeBSD-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2021 23:31:42 -0000 --UlVJffcvxoiEqYs2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Mar 29, 2021 at 12:12:55PM -0700, Henric Jungheim wrote: > > I ran into a bit of an odd problem when building the > sysutils/grub2-bhyve port on 13.0-RC3 (on x64). The bison command > dumps core when the output is going to a console. Redirecting the > build output to a file avoids the problem. I'm not sure if this is > an ncurses issue, a port issue (and which port?), my box, or > something else (clang?). It might be a problem with the application's initialization of ncurses. > This is what the tail end of the port build looks like: > ... > grub-mkfont: No (explicitly disabled) > grub-mount: No (explicitly disabled) > starfield theme: No (No grub-mkfont) > With libzfs support: Yes > ******************************************************* > ===> Building for grub2-bhyve-0.40_8 > gmake[1]: Entering directory '/usr/ports/sysutils/grub2-bhyve/work/grub2-bhyve-0.40' > bison -d -p grub_script_yy -b grub_script ./grub-core/script/parser.y > ./grub-core/script/parser.y:94.1-12: warning: deprecated directive: '%pure-parser', use '%define api.pure' [ > > And here's what lldb has to say: > > > sysutils/grub2-bhyve/work/grub2-bhyve-0.40>lldb -- /usr/local/bin/bison -d -p grub_script_yy -b grub_script ./grub-core/script/parser.y > (lldb) target create "/usr/local/bin/bison" > Current executable set to '/usr/local/bin/bison' (x86_64). > (lldb) settings set -- target.run-args "-d" "-p" "grub_script_yy" "-b" "grub_script" "./grub-core/script/parser.y" > (lldb) run > Process 50108 launching > Process 50108 launched: '/usr/local/bin/bison' (x86_64) > ./grub-core/script/parser.y:94.1-12: warning: deprecated directive: %pure-parser, use %define api.pure [signal SIGSEGV: invalid address (fault address: 0x0) > frame #0: 0x0000000000000000 > error: Bad address > (lldb) bt > * thread #1, name = 'bison', stop reason = signal SIGSEGV: invalid address (fault address: 0x0) > * frame #0: 0x0000000000000000 > frame #1: 0x0000000800c1930a libncursesw.so.9`delay_output_sp + 234 > frame #2: 0x0000000800c19b81 libncursesw.so.9`tputs_sp + 1377 > frame #3: 0x0000000800c19cfb libncursesw.so.9`tputs + 123 > frame #4: 0x0000000800702dbc libtextstyle.so.0`___lldb_unnamed_symbol149$$libtextstyle.so.0 + 92 > frame #5: 0x00000008007037ff libtextstyle.so.0`___lldb_unnamed_symbol152$$libtextstyle.so.0 + 943 > frame #6: 0x00000008007030cf libtextstyle.so.0`___lldb_unnamed_symbol151$$libtextstyle.so.0 + 543 > frame #7: 0x0000000800700d00 libtextstyle.so.0`___lldb_unnamed_symbol125$$libtextstyle.so.0 + 32 Either bison has to tell libtextstyle to initialize, or libtextstyle has to know when to initialize ncurses. For the latter, term_ostream_create calls setupterm, which interestingly enough tries to recover from an error by calling the terminfo functions (which could still fail): if (setupterm (term, fd, &err) || err == 1) { /* Retrieve particular values depending on the terminal type. */ stream->max_colors = tigetnum ("colors"); stream->no_color_video = tigetnum ("ncv"); setupterm could fail for instance if there's no terminal description corresponding to your $TERM variable. If that happens, then the SCREEN pointer passed to tputs_sp might be NULL, or cur_term might be NULL. In ncurses, the corresponding null-pointer checks are done with HasTInfoTerminal: NCURSES_EXPORT(int) NCURSES_SP_NAME(delay_output) (NCURSES_SP_DCLx int ms) { T((T_CALLED("delay_output(%p,%d)"), (void *) SP_PARM, ms)); if (!HasTInfoTerminal(SP_PARM)) returnCode(ERR); if (no_pad_char) { NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); napms(ms); } else { > frame #8: 0x0000000000407295 bison`___lldb_unnamed_symbol160$$bison + 1669 > frame #9: 0x0000000000407d75 bison`___lldb_unnamed_symbol177$$bison + 149 > frame #10: 0x000000000040805d bison`___lldb_unnamed_symbol181$$bison + 109 > frame #11: 0x000000000042803f bison`___lldb_unnamed_symbol403$$bison + 7679 > frame #12: 0x000000000042e9c8 bison`___lldb_unnamed_symbol459$$bison + 56 > frame #13: 0x0000000000403743 bison`___lldb_unnamed_symbol130$$bison + 291 > frame #14: 0x0000000000403be0 bison`___lldb_unnamed_symbol130$$bison + 1472 > (lldb) > > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" -- Thomas E. Dickey https://invisible-island.net ftp://ftp.invisible-island.net --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQTFIEjAwHSP7iJ9R6JwI1Pg9+SO2wUCYGJjVwAKCRBwI1Pg9+SO 2xjxAKCnspXrCCex3ItxOfqGM8ik4OrHCACgjAsel8TXIOskJw5XZ8vcCi3ICpk= =U0vt -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2--