NetBSD Problem Report #57241

From martin@aprisoft.de  Wed Feb 22 11:47:49 2023
Return-Path: <martin@aprisoft.de>
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 ADDE51A9239
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 22 Feb 2023 11:47:49 +0000 (UTC)
Message-Id: <20230222114740.6FE405CC81D@emmas.aprisoft.de>
Date: Wed, 22 Feb 2023 12:47:40 +0100 (CET)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: mips64el--netbsd-objcopy core dumps randomly
X-Send-Pr-Version: 3.95

>Number:         57241
>Category:       toolchain
>Synopsis:       mips64el--netbsd-objcopy core dumps randomly
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 22 11:50:00 +0000 2023
>Closed-Date:    
>Last-Modified:  Thu Sep 14 05:09:58 +0000 2023
>Originator:     Martin Husemann
>Release:        NetBSD 10.99.2
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD martins.aprisoft.de 10.99.2 NetBSD 10.99.2 (GENERIC) #159: Tue Feb 21 15:27:55 CET 2023 martin@martins.aprisoft.de:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:

Since the switch to binutils 2.39 we see regular objcopy crashes in
the evbmips-mips64el build:

/home/builds/ab/HEAD/evbmips-mips64el/202302201820Z-tools/bin/mips64el--netbsd-objcopy: libdwarf.so.2.0.debug: section `.note.netbsd.pax' can't be allocated in segment 0
LOAD: .MIPS.abiflags .reginfo .dynamic .hash .dynsym .dynstr .gnu.version .gnu.version_r .rel.dyn .init .text .MIPS.stubs .fini .rodata .eh_frame_hdr .eh_frame .note.netbsd.ident .note.netbsd.pax
[1]   Bus error (core dumped) /home/builds/ab/HEAD/evbmips-mips64el/20230220...
--- /home/builds/ab/HEAD/evbmips-mips64el/202302201820Z-dest/usr/bin/netstat ---
*** Failed target: /home/builds/ab/HEAD/evbmips-mips64el/202302201820Z-dest/usr/bin/netstat
*** Failed commands:
	${_MKTARGET_INSTALL}
	=> @# "install " /home/builds/ab/HEAD/evbmips-mips64el/202302201820Z-dest/usr/bin/netstat
	${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}  ${STRIPFLAG} ${.ALLSRC} ${.TARGET}
	=> /home/builds/ab/HEAD/evbmips-mips64el/202302201820Z-tools/bin/mips64el--netbsd-install -U -M /home/builds/ab/HEAD/evbmips-mips64el/202302201820Z-dest/METALOG -D /home/builds/ab/HEAD/evbmips-mips64el/202302201820Z-dest -h sha256 -N /home/source/ab/HEAD/src/etc -c  -r -o root -g kmem -m 2555   netstat /home/builds/ab/HEAD/evbmips-mips64el/202302201820Z-dest/usr/bin/netstat
*** [/home/builds/ab/HEAD/evbmips-mips64el/202302201820Z-dest/usr/bin/netstat] Error code 138
nbmake[6]: stopped in /home/source/ab/HEAD/src/usr.bin/netstat

It does not happen on every build, but quite often.

>How-To-Repeat:
s/a

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: toolchain/57241: mips64el--netbsd-objcopy core dumps randomly
Date: Wed, 22 Feb 2023 09:51:29 -0500

 This comes from:

                if (!ELF_SECTION_IN_SEGMENT_1 (this_hdr, p, check_vma, 0)
                    && !ELF_TBSS_SPECIAL (this_hdr, p))
                  {
                    _bfd_error_handler
                      /* xgettext:c-format */
                      (_("%pB: section `%pA' can't be allocated in segment 
 %d"),
                       abfd, sec, j);
                    print_segment_map (m);
                  }


 instrumenting the macro ELF_SECTION_IN_SEGMENT_1 is "mission difficult". 
 Perhaps check ELF_TBSS_SPECIAL first :-)

 christos

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/57241: binutils crashes for some builds
Date: Wed, 8 Mar 2023 15:15:05 +0100

 Examing this a bit closer the build cluster gets two core dumps
 during a failed build, one is from the host ld,
 GNU ld (NetBSD Binutils nb1) 2.31.1, and it is quite low on usable information:

 Reading symbols from ld...
 Reading symbols from /usr/libdata/debug//usr/bin/ld.debug...
 [New process 1]
 Core was generated by `ld'.
 Program terminated with signal SIGSEGV, Segmentation fault.
 #0  0x0000000000430e81 in ?? ()
 (gdb) bt
 #0  0x0000000000430e81 in ?? ()
 #1  0x0000000000000000 in ?? ()
 (gdb) info reg
 rax            0x1e484ef           31753455
 rbx            0x63426a            6505066
 rcx            0x0                 0
 rdx            0x100000            1048576
 rsi            0x63426a            6505066
 rdi            0x68                104
 rbp            0x9                 0x9
 rsp            0x7f7fff4293a0      0x7f7fff4293a0
 r8             0x0                 0
 r9             0x0                 0
 r10            0xb0200000000       12103217840128
 r11            0x0                 0
 r12            0x6769752           108435282
 r13            0x63426a            6505066
 r14            0x68                104
 r15            0x0                 0
 rip            0x430e81            0x430e81
 eflags         0x10202             [ IF RF ]
 cs             0x47                71
 ss             0x3f                63
 ds             0x23                35
 es             0x23                35
 fs             0x0                 0
 gs             0x0                 0
 fs_base        <unavailable>
 gs_base        <unavailable>

 The other assumed from objcopy (but I didn't have the exact objdump binary
 around any more):

 warning: exec file is newer than core file.
 [New process 1]
 Core was generated by `mips64el--netbsd'.
 Program terminated with signal SIGBUS, Bus error.
 #0  0x0000000000409c81 in setup_section (
     ibfd=<error reading variable: Cannot access memory at address 0x884a8f2a>, 
     isection=<error reading variable: Cannot access memory at address 0x884a8f22>, 
     obfdarg=<error reading variable: Cannot access memory at address 0x884a8f1a>)
     at /home/source/ab/HEAD/src/tools/binutils/../../external/gpl3/binutils/dist/binutils/objcopy.c:4042
 4042          flags = check_new_section_flags (flags, obfd, name);
 (gdb) bt
 #0  0x0000000000409c81 in setup_section (
     ibfd=<error reading variable: Cannot access memory at address 0x884a8f2a>, 
     isection=<error reading variable: Cannot access memory at address 0x884a8f22>, 
     obfdarg=<error reading variable: Cannot access memory at address 0x884a8f1a>)
     at /home/source/ab/HEAD/src/tools/binutils/../../external/gpl3/binutils/dist/binutils/objcopy.c:4042
 Backtrace stopped: Cannot access memory at address 0x884a8fba
 (gdb) info reg
 rax            0xf764327d          4150538877
 rbx            0x91ba1316          2444890902
 rcx            0x20                32
 rdx            0xc44d9cab          3293420715
 rsi            0x75a6bf2e3b00      129359032498944
 rdi            0xfe4c0ff2          4266397682
 rbp            0x884a8fb2          0x884a8fb2
 rsp            0x7f7fff76c5d8      0x7f7fff76c5d8
 r8             0xfe10f7cb          4262524875
 r9             0x884a8fb2          2286587826
 r10            0xfe10f7cb          4262524875
 r11            0x49d73267          1238839911
 r12            0x6a2ff5ba          1781527994
 r13            0xdb0254c5          3674363077
 r14            0x7f7fff76c808      140187723548680
 r15            0x75a6bf0f7000      129359030480896
 rip            0x409c81            0x409c81 <setup_section+246>
 eflags         0x10283             [ CF SF IF RF ]
 cs             0x47                71
 ss             0x3f                63
 ds             0x23                35
 es             0x23                35
 fs             0x0                 0
 gs             0x0                 0
 fs_base        <unavailable>
 gs_base        <unavailable>

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/57241: binutils crashes for some builds
Date: Sun, 12 Mar 2023 14:35:05 +0100

 Here is another core dump that makes a bit more sense but still fails
 to give enough data:

 Reading symbols from 202303071400Z-tools/bin/mips64el--netbsd-objcopy...
 [New process 1]
 Core was generated by `mips64el--netbsd'.
 Program terminated with signal SIGBUS, Bus error.
 #0  0x000000000040c631 in copy_main (argc=0, argv=0x0)
     at /home/source/ab/HEAD/src/tools/binutils/../../external/gpl3/binutils/dist/binutils/objcopy.c:5443
 5443              change_start = change_section_address;
 #0  0x000000000040c631 in copy_main (argc=0, argv=0x0)
     at /home/source/ab/HEAD/src/tools/binutils/../../external/gpl3/binutils/dist/binutils/objcopy.c:5443
 #1  0x000000000040c758 in copy_main (argc=0, argv=0x0)
     at /home/source/ab/HEAD/src/tools/binutils/../../external/gpl3/binutils/dist/binutils/objcopy.c:5482
 #2  0x000000000040cbd8 in copy_main (argc=1, argv=0x7f7fe1a05224)
     at /home/source/ab/HEAD/src/tools/binutils/../../external/gpl3/binutils/dist/binutils/objcopy.c:5617
 #3  0x00000000004049b5 in filter_symbols (abfd=0x7f7fff53c4c0, 
     obfd=0x7f7fe1a00c40, osyms=0x1, isyms=0x7f7fe1a01d99, symcount=0)
     at /home/source/ab/HEAD/src/tools/binutils/../../external/gpl3/binutils/dist/binutils/objcopy.c:1688
 #4  0x000000000040448e in filter_symbols (abfd=0x2c334df2, obfd=0x640d16c8, 
     osyms=0xffffffffffffffff, isyms=0x3ea, symcount=4307852197889)
     at /home/source/ab/HEAD/src/tools/binutils/../../external/gpl3/binutils/dist/binutils/objcopy.c:1560
 #5  0x00000000004038ea in add_specific_symbols (
     filename=0x246 <error: Cannot access memory at address 0x246>, 
     htab=0x7f7fe1a0082d, buffer_p=0x1)
     at /home/source/ab/HEAD/src/tools/binutils/../../external/gpl3/binutils/dist
 #6  0x0000000000402eed in parse_flags (s=0x0)
     at /home/source/ab/HEAD/src/tools/binutils/../../external/gpl3/binutils/dist/binutils/objcopy.c:802

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57241 CVS commit: src/share/mk
Date: Sun, 12 Mar 2023 17:22:47 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Mar 12 17:22:47 UTC 2023

 Modified Files:
 	src/share/mk: bsd.own.mk

 Log Message:
 PR 57241: switch mips64el back to old binutils for now


 To generate a diff of this commit:
 cvs rdiff -u -r1.1307 -r1.1308 src/share/mk/bsd.own.mk

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

From: "Rin Okuyama" <rin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57241 CVS commit: src/external/gpl3/binutils
Date: Thu, 24 Aug 2023 06:14:57 +0000

 Module Name:	src
 Committed By:	rin
 Date:		Thu Aug 24 06:14:57 UTC 2023

 Modified Files:
 	src/external/gpl3/binutils/lib/libbfd/arch/mips64eb: bfd.h config.h
 	src/external/gpl3/binutils/lib/libbfd/arch/mips64el: bfd.h defs.mk
 	src/external/gpl3/binutils/lib/libiberty/arch/mips64eb: config.h
 	    defs.mk
 	src/external/gpl3/binutils/lib/libiberty/arch/mips64el: defs.mk
 	src/external/gpl3/binutils/lib/libopcodes/arch/mips64eb: config.h
 	src/external/gpl3/binutils/usr.bin/common/arch/mips64eb: config.h
 	src/external/gpl3/binutils/usr.bin/gas/arch/mips64eb: config.h
 	src/external/gpl3/binutils/usr.bin/gas/arch/mips64el: config.h
 	src/external/gpl3/binutils/usr.bin/ld/arch/mips64eb: config.h
 	src/external/gpl3/binutils/usr.bin/ld/arch/mips64el: defs.mk
 	    ldemul-list.h

 Log Message:
 binutils: mknative mips64e[bl] correctly

 The previous version was very broken; SIZEOF_* seem like LP64, even
 though this should be, and had been configured for n32 userland.

 May fix random build failures reported as PR toolchain/57241.

 XXX
 There still remain oddies. mknative again soon with update for
 configure scripts.


 To generate a diff of this commit:
 cvs rdiff -u -r1.13 -r1.14 \
     src/external/gpl3/binutils/lib/libbfd/arch/mips64eb/bfd.h
 cvs rdiff -u -r1.11 -r1.12 \
     src/external/gpl3/binutils/lib/libbfd/arch/mips64eb/config.h
 cvs rdiff -u -r1.13 -r1.14 \
     src/external/gpl3/binutils/lib/libbfd/arch/mips64el/bfd.h
 cvs rdiff -u -r1.11 -r1.12 \
     src/external/gpl3/binutils/lib/libbfd/arch/mips64el/defs.mk
 cvs rdiff -u -r1.11 -r1.12 \
     src/external/gpl3/binutils/lib/libiberty/arch/mips64eb/config.h \
     src/external/gpl3/binutils/lib/libiberty/arch/mips64eb/defs.mk
 cvs rdiff -u -r1.8 -r1.9 \
     src/external/gpl3/binutils/lib/libiberty/arch/mips64el/defs.mk
 cvs rdiff -u -r1.11 -r1.12 \
     src/external/gpl3/binutils/lib/libopcodes/arch/mips64eb/config.h
 cvs rdiff -u -r1.13 -r1.14 \
     src/external/gpl3/binutils/usr.bin/common/arch/mips64eb/config.h
 cvs rdiff -u -r1.10 -r1.11 \
     src/external/gpl3/binutils/usr.bin/gas/arch/mips64eb/config.h
 cvs rdiff -u -r1.10 -r1.11 \
     src/external/gpl3/binutils/usr.bin/gas/arch/mips64el/config.h
 cvs rdiff -u -r1.13 -r1.14 \
     src/external/gpl3/binutils/usr.bin/ld/arch/mips64eb/config.h
 cvs rdiff -u -r1.10 -r1.11 \
     src/external/gpl3/binutils/usr.bin/ld/arch/mips64el/defs.mk
 cvs rdiff -u -r1.5 -r1.6 \
     src/external/gpl3/binutils/usr.bin/ld/arch/mips64el/ldemul-list.h

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

From: "Rin Okuyama" <rin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/57241 CVS commit: src/share/mk
Date: Thu, 24 Aug 2023 06:18:07 +0000

 Module Name:	src
 Committed By:	rin
 Date:		Thu Aug 24 06:18:07 UTC 2023

 Modified Files:
 	src/share/mk: bsd.own.mk

 Log Message:
 bsd.own.mk: Switch mips64e[bl] to binutils 2.39 again

 Potential fix for PR toolchain/57241 has been committed.
 Let us see whether this works fine or not.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1358 -r1.1359 src/share/mk/bsd.own.mk

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

State-Changed-From-To: open->analyzed
State-Changed-By: rin@NetBSD.org
State-Changed-When: Thu, 24 Aug 2023 06:23:10 +0000
State-Changed-Why:
Potential fix committed. Let's see if the problem occur again on
periodic snapshot builds.


State-Changed-From-To: analyzed->open
State-Changed-By: rin@NetBSD.org
State-Changed-When: Thu, 14 Sep 2023 05:09:58 +0000
State-Changed-Why:
Same problem observed again. Let me examine for a while...


>Unformatted:

NetBSD Home
NetBSD PR Database Search

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