NetBSD Problem Report #56179

From cjep@netbsd.org  Sun May 16 12:41:41 2021
Return-Path: <cjep@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 070B61A9264
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 16 May 2021 12:41:41 +0000 (UTC)
Message-Id: <20210516124139.469021A9287@mollari.NetBSD.org>
Date: Sun, 16 May 2021 12:41:39 +0000 (UTC)
From: cjep@netbsd.org
Reply-To: cjep@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: build.sh fails on OpenBSD 6.9 #1 - nbmakeinfo seg faults
X-Send-Pr-Version: 3.95

>Number:         56179
>Category:       toolchain
>Synopsis:       build.sh fails on OpenBSD 6.9 #1 - nbmakeinfo seg faults
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    cjep
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 16 12:45:00 +0000 2021
>Closed-Date:    Mon Jun 07 20:36:24 +0000 2021
>Last-Modified:  Mon Jun 07 20:36:24 +0000 2021
>Originator:     Chris Pinnock
>Release:        NetBSD-current, recent sources as of 16/5/2021
>Organization:
>Environment:

OpenBSD blowfish.home 6.9 GENERIC.MP#473 amd64
OpenBSD clang version 10.0.1 
Target: amd64-unknown-openbsd6.9
Thread model: posix

>Description:
The nbmakeinfo tool produced by build.sh seg faults when building gccint.texi
during the ./build.sh tools phase.

(Output stops around here:
12.2 Class hierarchy of GIMPLE statements
=========================================
)

/home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo --no-split -I . -I /home/cjep/NetBSD-current/src/tools/gcc/../../external/gpl3/gcc/dist/gcc/doc -I /home/cjep/NetBSD-current/src/tools/gcc/../../external/gpl3/gcc/dist/gcc/doc/include -o doc/gccint.info /home/cjep/NetBSD-current/src/tools/gcc/../../external/gpl3/gcc/dist/gcc/doc/gccint.texi

cjep@blowfish% gdb --core=nbmakeinfo.core "/home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo"
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd6.9"...
(no debugging symbols found)

Core was generated by `nbmakeinfo'.
Program terminated with signal 11, Segmentation fault.
(no debugging symbols found)
Loaded symbols for /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
Reading symbols from /usr/lib/libc.so.96.0...done.
Loaded symbols for /usr/lib/libc.so.96.0
Reading symbols from /usr/libexec/ld.so...Error while reading shared library symbols:
Dwarf Error: wrong version in compilation unit header (is 4, should be 2) [in module /usr/libexec/ld.so]
#0  0x0000016615fed6c6 in output_multitable_row ()
  from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
.gdbinit:12: Error in sourced command file:
/home/cjep/NetBSD-current/src/tools/gcc/../../external/gpl3/gcc/dist/gcc/gdbinit.in:311: Error in sourced command file:
Undefined command: "alias".  Try "help".
(gdb) bt
#0  0x0000016615fed6c6 in output_multitable_row ()
  from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#1  0x0000016615fed436 in multitable_item ()
  from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#2  0x0000016615fe0833 in cm_item ()
  from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#3  0x0000016615fe8142 in reader_loop ()
  from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#4  0x0000016615fd5e47 in handle_include ()
  from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#5  0x0000016615fe8142 in reader_loop ()
  from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#6  0x0000016615fec3b2 in convert_from_loaded_file ()
  from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo
#7  0x0000016615fe576f in main ()
  from /home/cjep/src/NetBSD/obj/sparc64/home/cjep/NetBSD-current/src/tooldir.OpenBSD-6.9-amd64/bin/nbmakeinfo


>How-To-Repeat:
Install OpenBSD 6.9
Grab src
./build.sh -U -m amd64 tools

>Fix:

>Release-Note:

>Audit-Trail:
From: "Chris Pinnock" <cjep@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/56179 CVS commit: src/external/gpl2/texinfo/dist/makeinfo
Date: Mon, 7 Jun 2021 20:27:59 +0000

 Module Name:	src
 Committed By:	cjep
 Date:		Mon Jun  7 20:27:59 UTC 2021

 Modified Files:
 	src/external/gpl2/texinfo/dist/makeinfo: multi.c

 Log Message:
 Whilst debugging the nbmakeinfo tool on an OpenBSD box, I noticed
 two changes in OpenBSD's makeinfo sources. One addresses an out of bounds
 access issue and the other an off-by-one issue.

 Fixes PR toolchain/56179. Reviewed by christos.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/texinfo/dist/makeinfo/multi.c

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

Responsible-Changed-From-To: toolchain-manager->cjep
Responsible-Changed-By: cjep@NetBSD.org
Responsible-Changed-When: Mon, 07 Jun 2021 20:36:24 +0000
Responsible-Changed-Why:
Take.


State-Changed-From-To: open->closed
State-Changed-By: cjep@NetBSD.org
State-Changed-When: Mon, 07 Jun 2021 20:36:24 +0000
State-Changed-Why:
A patch found in both mainline texinfo and OpenBSD's tree resolves an
out of bounds access problem that tickles nbmakeinfo when OpenBSD is
the host OS. Patch applied.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.