NetBSD Problem Report #57770

From spz@netbsd.org  Wed Dec 13 10:52:41 2023
Return-Path: <spz@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 A57BE1A9238
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 13 Dec 2023 10:52:41 +0000 (UTC)
Message-Id: <20231213105239.C948E42D34@shadow.netbsd.org>
Date: Wed, 13 Dec 2023 10:52:39 +0000 (UTC)
From: spz@NetBSD.org
Reply-To: spz@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: pkgtools/pbulk-base pbulk-build segfault
X-Send-Pr-Version: 3.95

>Number:         57770
>Category:       pkg
>Synopsis:       pbulk-build segfaults
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 13 10:55:00 +0000 2023
>Originator:     S.P.Zeidler
>Release:        NetBSD 10.0_RC1
>Organization:
The NetBSD Foundation
>Environment:
System: NetBSD shadow.netbsd.org 10.0_RC1 NetBSD 10.0_RC1 (SHADOW) #6: Tue Dec 12 22:32:36 UTC 2023 spz@franklin.NetBSD.org:/home/netbsd/10/amd64/obj/sys/arch/amd64/compile/SHADOW amd64
Architecture: x86_64
Machine: amd64
>Description:
	in chroots of NetBSD 9 or 10, i386 or x86_64, pbulk-build occasionally
	segfaults near the start of processing.
	A bulkbuild-restart typically succeeds.
log:
......................... 19475/19475
Resolving...
Building...
Initialisation complete.
[1107/28960] Starting build of  cwrappers-20220403
[1107/28960] Successfully built cwrappers-20220403
[1108/28960] Starting build of  mktools-20220614
[1108/28960] Successfully built mktools-20220614
[1109/28960] Starting build of  digest-20220214
[1110/28960] Starting build of  osabi-NetBSD-9.0
[1111/28960] Starting build of  zonetab-0
[1112/28960] Starting build of  lockf-1
[1113/28960] Starting build of  bootstrap-mk-files-20230509
[1114/28960] Starting build of  bsdtar-3.4.3
[1115/28960] Starting build of  pkg_tarup-1.9.1
[1116/28960] Starting build of  libfetch-2.39nb2
[1]   Segmentation fault (core dumped) ${pbuild} -r ${loc}/pbuild -I ${pbuild_start_s...

gdb backtrace:
#0  extent_sn_comp (b=0x75406240f580, a=0x1000)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../include/jemalloc/internal/extent_inlines.h:377
#1  extent_snad_comp (b=0x75406240f580, a=0x1000)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../include/jemalloc/internal/extent_inlines.h:411
#2  arena_bin_lower_slab (arena=arena@entry=0x754062400980,
    slab=slab@entry=0x75406240f580, bin=bin@entry=0x754062414020,
    tsdn=0x754062ec0048)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../dist/src/arena.c:1515
#3  0x0000754062701812 in arena_dalloc_bin_locked_impl (
    tsdn=tsdn@entry=0x754062ec0048, arena=arena@entry=0x754062400980,
    slab=0x75406240f580, ptr=<optimized out>, junked=junked@entry=true)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../dist/src/arena.c:1550
#4  0x0000754062702c4b in je_arena_dalloc_bin_junked_locked (
    tsdn=tsdn@entry=0x754062ec0048, arena=arena@entry=0x754062400980,
    extent=<optimized out>, ptr=<optimized out>)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../dist/src/arena.c:1562
#5  0x00007540626afc2a in je_tcache_bin_flush_small (
    tsd=tsd@entry=0x754062ec0048, tcache=tcache@entry=0x754062ec0208,
    tbin=0x754062ec0260, binind=binind@entry=3, rem=100)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../dist/src/tcache.c:149
#6  0x000075406270a982 in tcache_dalloc_small (slow_path=false, binind=3,
    ptr=0x754057a56250, tcache=<optimized out>, tsd=<optimized out>)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../include/jemalloc/internal/tcache_inlines.h:178
#7  arena_dalloc (slow_path=false, alloc_ctx=<synthetic pointer>,
    tcache=<optimized out>, ptr=0x754057a56250, tsdn=<optimized out>)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../include/jemalloc/internal/arena_inlines_b.h:224
#8  idalloctm (slow_path=false, is_internal=false,
    alloc_ctx=<synthetic pointer>, tcache=<optimized out>, ptr=0x754057a56250,
    tsdn=<optimized out>)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../include/jemalloc/internal/jemalloc_internal_inlines_c.h:118
#9  ifree (slow_path=false, tcache=<optimized out>, ptr=0x754057a56250,
    tsd=0x754062ec0048)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../dist/src/jemalloc.c:2255
#10 free (ptr=0x754057a56250)
    at /home/netbsd/9/src/external/bsd/jemalloc/lib/../dist/src/jemalloc.c:2429
#11 0x000000004820372f in kill_peer (arg=arg@entry=0x754057a56250)
    at master.c:87
#12 0x0000000048203638 in assign_job (arg=<optimized out>) at master.c:211
#13 0x0000000048203741 in kill_peer (arg=arg@entry=0x754057a56250)
    at master.c:91
[ master.c:91 kill_peer - master.c:211 assign_job recursion edited out for brevity]
#2191 0x0000000048203741 in kill_peer (arg=arg@entry=0x754057a56250)
    at master.c:91
#2192 0x0000000048203638 in assign_job (arg=<optimized out>) at master.c:211
#2193 0x00000000482041c3 in deferred_read_handler (fd=<optimized out>, arg=0x754057ea7060) at event.c:95
#2194 0x0000000048204971 in event_dispatch () at event.c:360
#2195 0x0000000048203963 in master_mode (master_port=0x7f7fff766037 "127.0.0.12:2002", 
    start_script=0x7f7fff766006 "/usr/pkgbulk/libexec/pbulk/build-client-start") at master.c:322
#2196 0x0000000048204ed2 in main (argc=3, argv=0x7f7fff765a68) at pbuild.c:166


>How-To-Repeat:
	I get it in roughly 1 in 10 pbulk runs on shadow, but have no idea
        what the actual trigger is.
>Fix:
	Fix or workaround would be nice

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.