NetBSD Problem Report #59035

From martin@duskware.de  Tue Jan 28 11:20:46 2025
Return-Path: <martin@duskware.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)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id AEE101A923A
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 28 Jan 2025 11:20:46 +0000 (UTC)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: new named(8) crashes at startup on evbarmv5
X-Send-Pr-Version: 3.95

>Number:         59035
>Category:       bin
>Synopsis:       new named(8) crashes at startup on evbarmv5
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 28 11:25:00 +0000 2025
>Last-Modified:  Sun Feb 16 07:30:01 +0000 2025
>Originator:     Martin Husemann
>Release:        NetBSD 10.99.12
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD unpluged.duskware.de 10.99.12 NetBSD 10.99.12 (UNPLUGED) #621: Tue Jan 28 10:16:08 CET 2025 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/evbarm/compile/UNPLUGED evbarm
Architecture: earmv5
Machine: evbarm
>Description:

After updating to todays -current the named on this machine does not start
any more.

gdb named named.core 
GNU gdb (GDB) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "armv7--netbsdelf-eabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from named...
Reading symbols from /usr/libdata/debug//usr/sbin/named.debug...
[New process 351]
[New process 1383]
[New process 292]
[New process 1437]
Core was generated by `named'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000504c0 in compat_futex_noasync (uaddr=0xbb2952a8, op=-1169994232, val=256, timeout=<optimized out>, 
    uaddr2=0x4, val3=0)
    at /work/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/compat_futex.c:71

unfortunately it can't backtrace from there.

(gdb) info reg
r0             0xbb514040          3142664256
r1             0xbbd40208          3151233544
r2             0x10000             65536
r3             0x0                 0
r4             0xbb2952a8          3140047528
r5             0x100               256
r6             0x40                64
r7             0xbbd40208          3151233544
r8             0xba434e08          3124973064
r9             0xbb2c253c          3140232508
r10            0xbb2c2658          3140232792
r11            0x0                 0
r12            0x920f0             598256
sp             0xbfffe688          0xbfffe688
lr             0x504c0             328896
pc             0x504c0             0x504c0 <compat_futex_noasync+184>
cpsr           0x20000010          536870928
Dump of assembler code for function compat_futex_noasync:
   0x00050408 <+0>:     push    {r4, r5, r6, r7, r8, r9, lr}
   0x0005040c <+4>:     ldr     r9, [pc, #332]  @ 0x50560 <compat_futex_noasync+344>
   0x00050410 <+8>:     sub     sp, sp, #12
   0x00050414 <+12>:    cmp     r3, #0
   0x00050418 <+16>:    ldr     r12, [sp, #40]  @ 0x28
   0x0005041c <+20>:    add     r9, pc, r9
   0x00050420 <+24>:    bne     0x50540 <compat_futex_noasync+312>
   0x00050424 <+28>:    cmp     r12, #0
   0x00050428 <+32>:    bne     0x50520 <compat_futex_noasync+280>
   0x0005042c <+36>:    ldr     r3, [sp, #44]   @ 0x2c
   0x00050430 <+40>:    cmp     r3, #0
   0x00050434 <+44>:    bne     0x50500 <compat_futex_noasync+248>
   0x00050438 <+48>:    mov     r4, r0
   0x0005043c <+52>:    mov     r8, r1
   0x00050440 <+56>:    mov     r5, r2
   0x00050444 <+60>:    bl      0x108f4 <__sync_synchronize@plt>
   0x00050448 <+64>:    ldr     r3, [pc, #276]  @ 0x50564 <compat_futex_noasync+348>
   0x0005044c <+68>:    ldr     r6, [r9, r3]
   0x00050450 <+72>:    mov     r0, r6
   0x00050454 <+76>:    bl      0xf250 <__libc_mutex_lock@plt>
   0x00050458 <+80>:    subs    r7, r0, #0
   0x0005045c <+84>:    bne     0x504f4 <compat_futex_noasync+236>
   0x00050460 <+88>:    cmp     r8, #0
   0x00050464 <+92>:    beq     0x504b4 <compat_futex_noasync+172>
   0x00050468 <+96>:    cmp     r8, #1
   0x0005046c <+100>:   bne     0x504a0 <compat_futex_noasync+152>
   0x00050470 <+104>:   ldr     r3, [pc, #240]  @ 0x50568 <compat_futex_noasync+352>
   0x00050474 <+108>:   ldr     r3, [r9, r3]
   0x00050478 <+112>:   mov     r0, r3
   0x0005047c <+116>:   str     r3, [sp, #4]
   0x00050480 <+120>:   bl      0x10f30 <__libc_cond_broadcast@plt>
   0x00050484 <+124>:   mov     r0, r6
   0x00050488 <+128>:   bl      0x117f4 <__libc_mutex_unlock@plt>
   0x0005048c <+132>:   subs    r4, r0, #0
   0x00050490 <+136>:   bne     0x504e4 <compat_futex_noasync+220>
   0x00050494 <+140>:   mov     r0, r7
   0x00050498 <+144>:   add     sp, sp, #12
   0x0005049c <+148>:   pop     {r4, r5, r6, r7, r8, r9, pc}
   0x000504a0 <+152>:   bl      0xebd8 <__errno@plt>
   0x000504a4 <+156>:   mov     r3, #22
   0x000504a8 <+160>:   mvn     r7, #0
   0x000504ac <+164>:   str     r3, [r0]
   0x000504b0 <+168>:   b       0x50484 <compat_futex_noasync+124>
   0x000504b4 <+172>:   ldr     r3, [r4]
   0x000504b8 <+176>:   cmp     r5, r3
   0x000504bc <+180>:   bne     0x50484 <compat_futex_noasync+124>
=> 0x000504c0 <+184>:   ldr     r3, [pc, #160]  @ 0x50568 <compat_futex_noasync+352>
   0x000504c4 <+188>:   ldr     r8, [r9, r3]
   0x000504c8 <+192>:   mov     r1, r6
   0x000504cc <+196>:   mov     r0, r8
   0x000504d0 <+200>:   bl      0x10ea0 <__libc_cond_wait@plt>
   0x000504d4 <+204>:   ldr     r3, [r4]
   0x000504d8 <+208>:   cmp     r3, r5
   0x000504dc <+212>:   beq     0x504c8 <compat_futex_noasync+192>
   0x000504e0 <+216>:   b       0x50484 <compat_futex_noasync+124>
   0x000504e4 <+220>:   bl      0xebd8 <__errno@plt>
   0x000504e8 <+224>:   str     r4, [r0]
   0x000504ec <+228>:   mvn     r7, #0
   0x000504f0 <+232>:   b       0x50494 <compat_futex_noasync+140>
   0x000504f4 <+236>:   bl      0xebd8 <__errno@plt>
   0x000504f8 <+240>:   str     r7, [r0]
   0x000504fc <+244>:   b       0x504ec <compat_futex_noasync+228>
   0x00050500 <+248>:   ldr     r3, [pc, #100]  @ 0x5056c <compat_futex_noasync+356>
   0x00050504 <+252>:   ldr     r2, [pc, #100]  @ 0x50570 <compat_futex_noasync+360>
   0x00050508 <+256>:   ldr     r0, [pc, #100]  @ 0x50574 <compat_futex_noasync+364>
   0x0005050c <+260>:   mov     r1, #51 @ 0x33
   0x00050510 <+264>:   add     r3, pc, r3
   0x00050514 <+268>:   add     r2, pc, r2
   0x00050518 <+272>:   add     r0, pc, r0
   0x0005051c <+276>:   bl      0x10984 <__assert13@plt>
   0x00050520 <+280>:   ldr     r3, [pc, #80]   @ 0x50578 <compat_futex_noasync+368>
   0x00050524 <+284>:   ldr     r2, [pc, #80]   @ 0x5057c <compat_futex_noasync+372>
   0x00050528 <+288>:   ldr     r0, [pc, #80]   @ 0x50580 <compat_futex_noasync+376>
   0x0005052c <+292>:   mov     r1, #50 @ 0x32
   0x00050530 <+296>:   add     r3, pc, r3
   0x00050534 <+300>:   add     r2, pc, r2
   0x00050538 <+304>:   add     r0, pc, r0
   0x0005053c <+308>:   bl      0x10984 <__assert13@plt>
   0x00050540 <+312>:   ldr     r3, [pc, #60]   @ 0x50584 <compat_futex_noasync+380>
   0x00050544 <+316>:   ldr     r2, [pc, #60]   @ 0x50588 <compat_futex_noasync+384>
   0x00050548 <+320>:   ldr     r0, [pc, #60]   @ 0x5058c <compat_futex_noasync+388>
   0x0005054c <+324>:   mov     r1, #49 @ 0x31
   0x00050550 <+328>:   add     r3, pc, r3
   0x00050554 <+332>:   add     r2, pc, r2
   0x00050558 <+336>:   add     r0, pc, r0
   0x0005055c <+340>:   bl      0x10984 <__assert13@plt>
   0x00050560 <+344>:   muleq   r4, r4, r2
   0x00050564 <+348>:   strdeq  r0, [r0], -r12
   0x00050568 <+352>:   ldrdeq  r0, [r0], -r8
   0x0005056c <+356>:   andeq   r8, r2, r12, ror r4
   0x00050570 <+360>:   andeq   r4, r3, r8, lsl #19
   0x00050574 <+364>:   andeq   r8, r2, r4, lsl r4
   0x00050578 <+368>:   andeq   r8, r2, r4, asr r4
   0x0005057c <+372>:   andeq   r4, r3, r8, ror #18
   0x00050580 <+376>:   strdeq  r8, [r2], -r4
   0x00050584 <+380>:   ldrdeq  r8, [r2], -r0
   0x00050588 <+384>:   andeq   r4, r3, r8, asr #18
   0x0005058c <+388>:   ldrdeq  r8, [r2], -r4
End of assembler dump.


>How-To-Repeat:
not quite sure, evbearmv5 specific?

>Fix:
n/a

>Audit-Trail:
From: Christos Zoulas <christos@zoulas.com>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: bin/59035: new named(8) crashes at startup on evbarmv5
Date: Tue, 28 Jan 2025 18:18:03 -0500

 --Apple-Mail=_8FD8957E-16BF-4232-850A-E68F2B9AC06E
 Content-Type: multipart/alternative;
 	boundary="Apple-Mail=_F2896C6F-CE9F-4AF4-A9F7-20BEC905BDEA"


 --Apple-Mail=_F2896C6F-CE9F-4AF4-A9F7-20BEC905BDEA
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=utf-8

 For the source:

        switch (op) {
         case FUTEX_WAIT:
                 /*
                  * Wait until *uaddr is changed to something else than =
 "val".
                  * Comparing *uaddr content against val figures out =
 which
                  * thread has been awakened.
                  */
                 while (CMM_LOAD_SHARED(*uaddr) =3D=3D val)
                         pthread_cond_wait(&__urcu_compat_futex_cond,
                                 &__urcu_compat_futex_lock);

 This instruction is:

  .LBE2: =20
         .loc 1 71 34 is_stmt 0 view .LVU35
         cmp     r5, r3
         bne     .L13
         ldr     r3, .L29+8
         ldr     r8, [r9, r3]
 .LVL14:=20
 .L10:
         .loc 1 72 4 is_stmt 1 view .LVU36
         mov     r1, r6
         mov     r0, r8
         bl      __libc_cond_wait(PLT)
 .LVL15:=20

 and

 .L29:  =20
         .word   _GLOBAL_OFFSET_TABLE_-(.LPIC9+8)
         .word   __urcu_compat_futex_lock(GOT)
         .word   __urcu_compat_futex_cond(GOT)
         .word   .LC3-(.LPIC6+8)
         .word   .LANCHOR0-(.LPIC7+8)
         .word   .LC1-(.LPIC8+8)
         .word   .LC2-(.LPIC3+8)
         .word   .LANCHOR0-(.LPIC4+8)
         .word   .LC1-(.LPIC5+8)
         .word   .LC0-(.LPIC0+8)
         .word   .LANCHOR0-(.LPIC1+8)
         .word   .LC1-(.LPIC2+8)
         .cfi_endproc

 So it is loading __urcu_compat_futex_cond from the GOT and crashing?

 Best,

 christos

 > On Jan 28, 2025, at 6:25=E2=80=AFAM, martin@netbsd.org =
 <martin@NetBSD.org> wrote:
 >=20
 >> Number:         59035
 >> Category:       bin
 >> Synopsis:       new named(8) crashes at startup on evbarmv5
 >> Confidential:   no
 >> Severity:       critical
 >> Priority:       high
 >> Responsible:    bin-bug-people
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Tue Jan 28 11:25:00 +0000 2025
 >> Originator:     Martin Husemann
 >> Release:        NetBSD 10.99.12
 >> Organization:
 > The NetBSD Foundation, Inc.
 >> Environment:
 > System: NetBSD unpluged.duskware.de 10.99.12 NetBSD 10.99.12 =
 (UNPLUGED) #621: Tue Jan 28 10:16:08 CET 2025 =
 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/evbarm/comp=
 ile/UNPLUGED evbarm
 > Architecture: earmv5
 > Machine: evbarm
 >> Description:
 >=20
 > After updating to todays -current the named on this machine does not =
 start
 > any more.
 >=20
 > gdb named named.core=20
 > GNU gdb (GDB) 15.1
 > Copyright (C) 2024 Free Software Foundation, Inc.
 > License GPLv3+: GNU GPL version 3 or later =
 <http://gnu.org/licenses/gpl.html>
 > This is free software: you are free to change and redistribute it.
 > There is NO WARRANTY, to the extent permitted by law.
 > Type "show copying" and "show warranty" for details.
 > This GDB was configured as "armv7--netbsdelf-eabihf".
 > Type "show configuration" for configuration details.
 > For bug reporting instructions, please see:
 > <https://www.gnu.org/software/gdb/bugs/>.
 > Find the GDB manual and other documentation resources online at:
 >    <http://www.gnu.org/software/gdb/documentation/>.
 >=20
 > For help, type "help".
 > Type "apropos word" to search for commands related to "word"...
 > Reading symbols from named...
 > Reading symbols from /usr/libdata/debug//usr/sbin/named.debug...
 > [New process 351]
 > [New process 1383]
 > [New process 292]
 > [New process 1437]
 > Core was generated by `named'.
 > Program terminated with signal SIGSEGV, Segmentation fault.
 > #0  0x000504c0 in compat_futex_noasync (uaddr=3D0xbb2952a8, =
 op=3D-1169994232, val=3D256, timeout=3D<optimized out>,=20
 >    uaddr2=3D0x4, val3=3D0)
 >    at =
 /work/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/com=
 pat_futex.c:71
 >=20
 > unfortunately it can't backtrace from there.
 >=20
 > (gdb) info reg
 > r0             0xbb514040          3142664256
 > r1             0xbbd40208          3151233544
 > r2             0x10000             65536
 > r3             0x0                 0
 > r4             0xbb2952a8          3140047528
 > r5             0x100               256
 > r6             0x40                64
 > r7             0xbbd40208          3151233544
 > r8             0xba434e08          3124973064
 > r9             0xbb2c253c          3140232508
 > r10            0xbb2c2658          3140232792
 > r11            0x0                 0
 > r12            0x920f0             598256
 > sp             0xbfffe688          0xbfffe688
 > lr             0x504c0             328896
 > pc             0x504c0             0x504c0 <compat_futex_noasync+184>
 > cpsr           0x20000010          536870928
 > Dump of assembler code for function compat_futex_noasync:
 >   0x00050408 <+0>:     push    {r4, r5, r6, r7, r8, r9, lr}
 >   0x0005040c <+4>:     ldr     r9, [pc, #332]  @ 0x50560 =
 <compat_futex_noasync+344>
 >   0x00050410 <+8>:     sub     sp, sp, #12
 >   0x00050414 <+12>:    cmp     r3, #0
 >   0x00050418 <+16>:    ldr     r12, [sp, #40]  @ 0x28
 >   0x0005041c <+20>:    add     r9, pc, r9
 >   0x00050420 <+24>:    bne     0x50540 <compat_futex_noasync+312>
 >   0x00050424 <+28>:    cmp     r12, #0
 >   0x00050428 <+32>:    bne     0x50520 <compat_futex_noasync+280>
 >   0x0005042c <+36>:    ldr     r3, [sp, #44]   @ 0x2c
 >   0x00050430 <+40>:    cmp     r3, #0
 >   0x00050434 <+44>:    bne     0x50500 <compat_futex_noasync+248>
 >   0x00050438 <+48>:    mov     r4, r0
 >   0x0005043c <+52>:    mov     r8, r1
 >   0x00050440 <+56>:    mov     r5, r2
 >   0x00050444 <+60>:    bl      0x108f4 <__sync_synchronize@plt>
 >   0x00050448 <+64>:    ldr     r3, [pc, #276]  @ 0x50564 =
 <compat_futex_noasync+348>
 >   0x0005044c <+68>:    ldr     r6, [r9, r3]
 >   0x00050450 <+72>:    mov     r0, r6
 >   0x00050454 <+76>:    bl      0xf250 <__libc_mutex_lock@plt>
 >   0x00050458 <+80>:    subs    r7, r0, #0
 >   0x0005045c <+84>:    bne     0x504f4 <compat_futex_noasync+236>
 >   0x00050460 <+88>:    cmp     r8, #0
 >   0x00050464 <+92>:    beq     0x504b4 <compat_futex_noasync+172>
 >   0x00050468 <+96>:    cmp     r8, #1
 >   0x0005046c <+100>:   bne     0x504a0 <compat_futex_noasync+152>
 >   0x00050470 <+104>:   ldr     r3, [pc, #240]  @ 0x50568 =
 <compat_futex_noasync+352>
 >   0x00050474 <+108>:   ldr     r3, [r9, r3]
 >   0x00050478 <+112>:   mov     r0, r3
 >   0x0005047c <+116>:   str     r3, [sp, #4]
 >   0x00050480 <+120>:   bl      0x10f30 <__libc_cond_broadcast@plt>
 >   0x00050484 <+124>:   mov     r0, r6
 >   0x00050488 <+128>:   bl      0x117f4 <__libc_mutex_unlock@plt>
 >   0x0005048c <+132>:   subs    r4, r0, #0
 >   0x00050490 <+136>:   bne     0x504e4 <compat_futex_noasync+220>
 >   0x00050494 <+140>:   mov     r0, r7
 >   0x00050498 <+144>:   add     sp, sp, #12
 >   0x0005049c <+148>:   pop     {r4, r5, r6, r7, r8, r9, pc}
 >   0x000504a0 <+152>:   bl      0xebd8 <__errno@plt>
 >   0x000504a4 <+156>:   mov     r3, #22
 >   0x000504a8 <+160>:   mvn     r7, #0
 >   0x000504ac <+164>:   str     r3, [r0]
 >   0x000504b0 <+168>:   b       0x50484 <compat_futex_noasync+124>
 >   0x000504b4 <+172>:   ldr     r3, [r4]
 >   0x000504b8 <+176>:   cmp     r5, r3
 >   0x000504bc <+180>:   bne     0x50484 <compat_futex_noasync+124>
 > =3D> 0x000504c0 <+184>:   ldr     r3, [pc, #160]  @ 0x50568 =
 <compat_futex_noasync+352>
 >   0x000504c4 <+188>:   ldr     r8, [r9, r3]
 >   0x000504c8 <+192>:   mov     r1, r6
 >   0x000504cc <+196>:   mov     r0, r8
 >   0x000504d0 <+200>:   bl      0x10ea0 <__libc_cond_wait@plt>
 >   0x000504d4 <+204>:   ldr     r3, [r4]
 >   0x000504d8 <+208>:   cmp     r3, r5
 >   0x000504dc <+212>:   beq     0x504c8 <compat_futex_noasync+192>
 >   0x000504e0 <+216>:   b       0x50484 <compat_futex_noasync+124>
 >   0x000504e4 <+220>:   bl      0xebd8 <__errno@plt>
 >   0x000504e8 <+224>:   str     r4, [r0]
 >   0x000504ec <+228>:   mvn     r7, #0
 >   0x000504f0 <+232>:   b       0x50494 <compat_futex_noasync+140>
 >   0x000504f4 <+236>:   bl      0xebd8 <__errno@plt>
 >   0x000504f8 <+240>:   str     r7, [r0]
 >   0x000504fc <+244>:   b       0x504ec <compat_futex_noasync+228>
 >   0x00050500 <+248>:   ldr     r3, [pc, #100]  @ 0x5056c =
 <compat_futex_noasync+356>
 >   0x00050504 <+252>:   ldr     r2, [pc, #100]  @ 0x50570 =
 <compat_futex_noasync+360>
 >   0x00050508 <+256>:   ldr     r0, [pc, #100]  @ 0x50574 =
 <compat_futex_noasync+364>
 >   0x0005050c <+260>:   mov     r1, #51 @ 0x33
 >   0x00050510 <+264>:   add     r3, pc, r3
 >   0x00050514 <+268>:   add     r2, pc, r2
 >   0x00050518 <+272>:   add     r0, pc, r0
 >   0x0005051c <+276>:   bl      0x10984 <__assert13@plt>
 >   0x00050520 <+280>:   ldr     r3, [pc, #80]   @ 0x50578 =
 <compat_futex_noasync+368>
 >   0x00050524 <+284>:   ldr     r2, [pc, #80]   @ 0x5057c =
 <compat_futex_noasync+372>
 >   0x00050528 <+288>:   ldr     r0, [pc, #80]   @ 0x50580 =
 <compat_futex_noasync+376>
 >   0x0005052c <+292>:   mov     r1, #50 @ 0x32
 >   0x00050530 <+296>:   add     r3, pc, r3
 >   0x00050534 <+300>:   add     r2, pc, r2
 >   0x00050538 <+304>:   add     r0, pc, r0
 >   0x0005053c <+308>:   bl      0x10984 <__assert13@plt>
 >   0x00050540 <+312>:   ldr     r3, [pc, #60]   @ 0x50584 =
 <compat_futex_noasync+380>
 >   0x00050544 <+316>:   ldr     r2, [pc, #60]   @ 0x50588 =
 <compat_futex_noasync+384>
 >   0x00050548 <+320>:   ldr     r0, [pc, #60]   @ 0x5058c =
 <compat_futex_noasync+388>
 >   0x0005054c <+324>:   mov     r1, #49 @ 0x31
 >   0x00050550 <+328>:   add     r3, pc, r3
 >   0x00050554 <+332>:   add     r2, pc, r2
 >   0x00050558 <+336>:   add     r0, pc, r0
 >   0x0005055c <+340>:   bl      0x10984 <__assert13@plt>
 >   0x00050560 <+344>:   muleq   r4, r4, r2
 >   0x00050564 <+348>:   strdeq  r0, [r0], -r12
 >   0x00050568 <+352>:   ldrdeq  r0, [r0], -r8
 >   0x0005056c <+356>:   andeq   r8, r2, r12, ror r4
 >   0x00050570 <+360>:   andeq   r4, r3, r8, lsl #19
 >   0x00050574 <+364>:   andeq   r8, r2, r4, lsl r4
 >   0x00050578 <+368>:   andeq   r8, r2, r4, asr r4
 >   0x0005057c <+372>:   andeq   r4, r3, r8, ror #18
 >   0x00050580 <+376>:   strdeq  r8, [r2], -r4
 >   0x00050584 <+380>:   ldrdeq  r8, [r2], -r0
 >   0x00050588 <+384>:   andeq   r4, r3, r8, asr #18
 >   0x0005058c <+388>:   ldrdeq  r8, [r2], -r4
 > End of assembler dump.
 >=20
 >=20
 >> How-To-Repeat:
 > not quite sure, evbearmv5 specific?
 >=20
 >> Fix:
 > n/a


 --Apple-Mail=_F2896C6F-CE9F-4AF4-A9F7-20BEC905BDEA
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/html;
 	charset=utf-8

 <html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
 charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
 -webkit-nbsp-mode: space; line-break: after-white-space;"><div>For the =
 source:</div><div><br></div><div><div>&nbsp; &nbsp; &nbsp; &nbsp;switch =
 (op) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; case =
 FUTEX_WAIT:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp; /*</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp; &nbsp;* Wait until *uaddr is changed to something else than =
 "val".</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp;* Comparing *uaddr content against val figures out =
 which</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp;* thread has been awakened.</div><div>&nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (CMM_LOAD_SHARED(*uaddr) =3D=3D =
 val)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 <font color=3D"#ff2600">&nbsp; &nbsp; &nbsp; &nbsp; =
 pthread_cond_wait(&amp;__urcu_compat_futex_cond,</font></div><div>&nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &amp;__urcu_compat_futex_lock);</div></div><div><br></div>This =
 instruction is:<div><br></div><div>&nbsp;.LBE2: &nbsp;<div>&nbsp; &nbsp; =
 &nbsp; &nbsp; .loc 1 71 34 is_stmt 0 view .LVU35</div><div>&nbsp; &nbsp; =
 &nbsp; &nbsp; cmp &nbsp; &nbsp; r5, r3</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; bne &nbsp; &nbsp; .L13</div><div>&nbsp; &nbsp; &nbsp; &nbsp;<font =
 color=3D"#ff2600"> ldr &nbsp; &nbsp; r3, .L29+8</font></div><div>&nbsp; =
 &nbsp; &nbsp; &nbsp; ldr &nbsp; &nbsp; r8, [r9, =
 r3]</div><div>.LVL14:&nbsp;</div><div>.L10:</div><div>&nbsp; &nbsp; =
 &nbsp; &nbsp; .loc 1 72 4 is_stmt 1 view .LVU36</div><div>&nbsp; &nbsp; =
 &nbsp; &nbsp; mov &nbsp; &nbsp; r1, r6</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; mov &nbsp; &nbsp; r0, r8</div><div>&nbsp; &nbsp; &nbsp; &nbsp; bl =
 &nbsp; &nbsp; =
 &nbsp;__libc_cond_wait(PLT)</div><div>.LVL15:&nbsp;</div><div><br></div><d=
 iv>and</div><div><br></div><div><div>.L29: &nbsp;&nbsp;</div><div>&nbsp; =
 &nbsp; &nbsp; &nbsp; .word &nbsp; =
 _GLOBAL_OFFSET_TABLE_-(.LPIC9+8)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; =
 .word &nbsp; __urcu_compat_futex_lock(GOT)</div><div>&nbsp; &nbsp; =
 &nbsp; &nbsp;<font color=3D"#ff2600"> .word &nbsp; =
 __urcu_compat_futex_cond(GOT)</font></div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; .word &nbsp; .LC3-(.LPIC6+8)</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; .word &nbsp; .LANCHOR0-(.LPIC7+8)</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; .word &nbsp; .LC1-(.LPIC8+8)</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; .word &nbsp; .LC2-(.LPIC3+8)</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; .word &nbsp; .LANCHOR0-(.LPIC4+8)</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; .word &nbsp; .LC1-(.LPIC5+8)</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; .word &nbsp; .LC0-(.LPIC0+8)</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; .word &nbsp; .LANCHOR0-(.LPIC1+8)</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; .word &nbsp; .LC1-(.LPIC2+8)</div><div>&nbsp; &nbsp; &nbsp; =
 &nbsp; .cfi_endproc</div></div><div><br></div><div>So it is loading =
 __urcu_compat_futex_cond from the GOT and =
 crashing?</div><div><br></div><div>Best,</div><div><br></div><div>christos=
 </div><div><br><blockquote type=3D"cite"><div>On Jan 28, 2025, at =
 6:25=E2=80=AFAM, martin@netbsd.org &lt;martin@NetBSD.org&gt; =
 wrote:</div><br class=3D"Apple-interchange-newline"><div><div><blockquote =
 type=3D"cite">Number: =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;59035<br>Category: =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bin<br>Synopsis: =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new named(8) crashes at startup on =
 evbarmv5<br>Confidential: &nbsp;&nbsp;no<br>Severity: =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;critical<br>Priority: =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;high<br>Responsible: =
 &nbsp;&nbsp;&nbsp;bin-bug-people<br>State: =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;open<br>Class: =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sw-bug<br>Submitter-=
 Id: &nbsp;&nbsp;net<br>Arrival-Date: &nbsp;&nbsp;Tue Jan 28 11:25:00 =
 +0000 2025<br>Originator: &nbsp;&nbsp;&nbsp;&nbsp;Martin =
 Husemann<br>Release: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NetBSD =
 10.99.12<br>Organization:<br></blockquote>The NetBSD Foundation, =
 Inc.<br><blockquote type=3D"cite">Environment:<br></blockquote>System: =
 NetBSD unpluged.duskware.de 10.99.12 NetBSD 10.99.12 (UNPLUGED) #621: =
 Tue Jan 28 10:16:08 CET 2025 =
 martin@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/evbarm/comp=
 ile/UNPLUGED evbarm<br>Architecture: earmv5<br>Machine: =
 evbarm<br><blockquote type=3D"cite">Description:<br></blockquote><br>After=
  updating to todays -current the named on this machine does not =
 start<br>any more.<br><br>gdb named named.core <br>GNU gdb (GDB) =
 15.1<br>Copyright (C) 2024 Free Software Foundation, Inc.<br>License =
 GPLv3+: GNU GPL version 3 or later =
 &lt;http://gnu.org/licenses/gpl.html&gt;<br>This is free software: you =
 are free to change and redistribute it.<br>There is NO WARRANTY, to the =
 extent permitted by law.<br>Type "show copying" and "show warranty" for =
 details.<br>This GDB was configured as =
 "armv7--netbsdelf-eabihf".<br>Type "show configuration" for =
 configuration details.<br>For bug reporting instructions, please =
 see:<br>&lt;https://www.gnu.org/software/gdb/bugs/&gt;.<br>Find the GDB =
 manual and other documentation resources online at:<br> =
 &nbsp;&nbsp;&nbsp;&lt;http://www.gnu.org/software/gdb/documentation/&gt;.<=
 br><br>For help, type "help".<br>Type "apropos word" to search for =
 commands related to "word"...<br>Reading symbols from =
 named...<br>Reading symbols from =
 /usr/libdata/debug//usr/sbin/named.debug...<br>[New process 351]<br>[New =
 process 1383]<br>[New process 292]<br>[New process 1437]<br>Core was =
 generated by `named'.<br>Program terminated with signal SIGSEGV, =
 Segmentation fault.<br>#0 &nbsp;0x000504c0 in compat_futex_noasync =
 (uaddr=3D0xbb2952a8, op=3D-1169994232, val=3D256, timeout=3D&lt;optimized =
 out&gt;, <br> &nbsp;&nbsp;&nbsp;uaddr2=3D0x4, val3=3D0)<br> =
 &nbsp;&nbsp;&nbsp;at =
 /work/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/com=
 pat_futex.c:71<br><br>unfortunately it can't backtrace from =
 there.<br><br>(gdb) info reg<br>r0 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 bb514040 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3142664256<br>r1 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 bbd40208 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3151233544<br>r2 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 10000 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;65=
 536<br>r3 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 0 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
 bsp;&nbsp;&nbsp;&nbsp;0<br>r4 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 bb2952a8 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3140047528<br>r5 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 100 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
 bsp;&nbsp;256<br>r6 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 40 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
 bsp;&nbsp;&nbsp;64<br>r7 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 bbd40208 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3151233544<br>r8 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 ba434e08 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3124973064<br>r9 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 bb2c253c =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3140232508<br>r10 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0xbb2c26=
 58 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3140232792<br>r11 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x0 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
 bsp;&nbsp;&nbsp;&nbsp;0<br>r12 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x920f0 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;59=
 8256<br>sp =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 bfffe688 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0xbfffe688<br>lr =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 504c0 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;32=
 8896<br>pc =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 504c0 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x=
 504c0 &lt;compat_futex_noasync+184&gt;<br>cpsr =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x20000010 =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;536870928<br>Dump =
 of assembler code for function compat_futex_noasync:<br> =
 &nbsp;&nbsp;0x00050408 &lt;+0&gt;: &nbsp;&nbsp;&nbsp;&nbsp;push =
 &nbsp;&nbsp;&nbsp;{r4, r5, r6, r7, r8, r9, lr}<br> =
 &nbsp;&nbsp;0x0005040c &lt;+4&gt;: &nbsp;&nbsp;&nbsp;&nbsp;ldr =
 &nbsp;&nbsp;&nbsp;&nbsp;r9, [pc, #332] &nbsp;@ 0x50560 =
 &lt;compat_futex_noasync+344&gt;<br> &nbsp;&nbsp;0x00050410 &lt;+8&gt;: =
 &nbsp;&nbsp;&nbsp;&nbsp;sub &nbsp;&nbsp;&nbsp;&nbsp;sp, sp, #12<br> =
 &nbsp;&nbsp;0x00050414 &lt;+12&gt;: &nbsp;&nbsp;&nbsp;cmp =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, #0<br> &nbsp;&nbsp;0x00050418 &lt;+16&gt;: =
 &nbsp;&nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r12, [sp, #40] &nbsp;@ =
 0x28<br> &nbsp;&nbsp;0x0005041c &lt;+20&gt;: &nbsp;&nbsp;&nbsp;add =
 &nbsp;&nbsp;&nbsp;&nbsp;r9, pc, r9<br> &nbsp;&nbsp;0x00050420 =
 &lt;+24&gt;: &nbsp;&nbsp;&nbsp;bne &nbsp;&nbsp;&nbsp;&nbsp;0x50540 =
 &lt;compat_futex_noasync+312&gt;<br> &nbsp;&nbsp;0x00050424 &lt;+28&gt;: =
 &nbsp;&nbsp;&nbsp;cmp &nbsp;&nbsp;&nbsp;&nbsp;r12, #0<br> =
 &nbsp;&nbsp;0x00050428 &lt;+32&gt;: &nbsp;&nbsp;&nbsp;bne =
 &nbsp;&nbsp;&nbsp;&nbsp;0x50520 &lt;compat_futex_noasync+280&gt;<br> =
 &nbsp;&nbsp;0x0005042c &lt;+36&gt;: &nbsp;&nbsp;&nbsp;ldr =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, [sp, #44] &nbsp;&nbsp;@ 0x2c<br> =
 &nbsp;&nbsp;0x00050430 &lt;+40&gt;: &nbsp;&nbsp;&nbsp;cmp =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, #0<br> &nbsp;&nbsp;0x00050434 &lt;+44&gt;: =
 &nbsp;&nbsp;&nbsp;bne &nbsp;&nbsp;&nbsp;&nbsp;0x50500 =
 &lt;compat_futex_noasync+248&gt;<br> &nbsp;&nbsp;0x00050438 &lt;+48&gt;: =
 &nbsp;&nbsp;&nbsp;mov &nbsp;&nbsp;&nbsp;&nbsp;r4, r0<br> =
 &nbsp;&nbsp;0x0005043c &lt;+52&gt;: &nbsp;&nbsp;&nbsp;mov =
 &nbsp;&nbsp;&nbsp;&nbsp;r8, r1<br> &nbsp;&nbsp;0x00050440 &lt;+56&gt;: =
 &nbsp;&nbsp;&nbsp;mov &nbsp;&nbsp;&nbsp;&nbsp;r5, r2<br> =
 &nbsp;&nbsp;0x00050444 &lt;+60&gt;: &nbsp;&nbsp;&nbsp;bl =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x108f4 &lt;__sync_synchronize@plt&gt;<br> =
 &nbsp;&nbsp;0x00050448 &lt;+64&gt;: &nbsp;&nbsp;&nbsp;ldr =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, [pc, #276] &nbsp;@ 0x50564 =
 &lt;compat_futex_noasync+348&gt;<br> &nbsp;&nbsp;0x0005044c &lt;+68&gt;: =
 &nbsp;&nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r6, [r9, r3]<br> =
 &nbsp;&nbsp;0x00050450 &lt;+72&gt;: &nbsp;&nbsp;&nbsp;mov =
 &nbsp;&nbsp;&nbsp;&nbsp;r0, r6<br> &nbsp;&nbsp;0x00050454 &lt;+76&gt;: =
 &nbsp;&nbsp;&nbsp;bl &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0xf250 =
 &lt;__libc_mutex_lock@plt&gt;<br> &nbsp;&nbsp;0x00050458 &lt;+80&gt;: =
 &nbsp;&nbsp;&nbsp;subs &nbsp;&nbsp;&nbsp;r7, r0, #0<br> =
 &nbsp;&nbsp;0x0005045c &lt;+84&gt;: &nbsp;&nbsp;&nbsp;bne =
 &nbsp;&nbsp;&nbsp;&nbsp;0x504f4 &lt;compat_futex_noasync+236&gt;<br> =
 &nbsp;&nbsp;0x00050460 &lt;+88&gt;: &nbsp;&nbsp;&nbsp;cmp =
 &nbsp;&nbsp;&nbsp;&nbsp;r8, #0<br> &nbsp;&nbsp;0x00050464 &lt;+92&gt;: =
 &nbsp;&nbsp;&nbsp;beq &nbsp;&nbsp;&nbsp;&nbsp;0x504b4 =
 &lt;compat_futex_noasync+172&gt;<br> &nbsp;&nbsp;0x00050468 &lt;+96&gt;: =
 &nbsp;&nbsp;&nbsp;cmp &nbsp;&nbsp;&nbsp;&nbsp;r8, #1<br> =
 &nbsp;&nbsp;0x0005046c &lt;+100&gt;: &nbsp;&nbsp;bne =
 &nbsp;&nbsp;&nbsp;&nbsp;0x504a0 &lt;compat_futex_noasync+152&gt;<br> =
 &nbsp;&nbsp;0x00050470 &lt;+104&gt;: &nbsp;&nbsp;ldr =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, [pc, #240] &nbsp;@ 0x50568 =
 &lt;compat_futex_noasync+352&gt;<br> &nbsp;&nbsp;0x00050474 =
 &lt;+108&gt;: &nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r3, [r9, r3]<br> =
 &nbsp;&nbsp;0x00050478 &lt;+112&gt;: &nbsp;&nbsp;mov =
 &nbsp;&nbsp;&nbsp;&nbsp;r0, r3<br> &nbsp;&nbsp;0x0005047c &lt;+116&gt;: =
 &nbsp;&nbsp;str &nbsp;&nbsp;&nbsp;&nbsp;r3, [sp, #4]<br> =
 &nbsp;&nbsp;0x00050480 &lt;+120&gt;: &nbsp;&nbsp;bl =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x10f30 =
 &lt;__libc_cond_broadcast@plt&gt;<br> &nbsp;&nbsp;0x00050484 =
 &lt;+124&gt;: &nbsp;&nbsp;mov &nbsp;&nbsp;&nbsp;&nbsp;r0, r6<br> =
 &nbsp;&nbsp;0x00050488 &lt;+128&gt;: &nbsp;&nbsp;bl =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x117f4 =
 &lt;__libc_mutex_unlock@plt&gt;<br> &nbsp;&nbsp;0x0005048c &lt;+132&gt;: =
 &nbsp;&nbsp;subs &nbsp;&nbsp;&nbsp;r4, r0, #0<br> &nbsp;&nbsp;0x00050490 =
 &lt;+136&gt;: &nbsp;&nbsp;bne &nbsp;&nbsp;&nbsp;&nbsp;0x504e4 =
 &lt;compat_futex_noasync+220&gt;<br> &nbsp;&nbsp;0x00050494 =
 &lt;+140&gt;: &nbsp;&nbsp;mov &nbsp;&nbsp;&nbsp;&nbsp;r0, r7<br> =
 &nbsp;&nbsp;0x00050498 &lt;+144&gt;: &nbsp;&nbsp;add =
 &nbsp;&nbsp;&nbsp;&nbsp;sp, sp, #12<br> &nbsp;&nbsp;0x0005049c =
 &lt;+148&gt;: &nbsp;&nbsp;pop &nbsp;&nbsp;&nbsp;&nbsp;{r4, r5, r6, r7, =
 r8, r9, pc}<br> &nbsp;&nbsp;0x000504a0 &lt;+152&gt;: &nbsp;&nbsp;bl =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0xebd8 &lt;__errno@plt&gt;<br> =
 &nbsp;&nbsp;0x000504a4 &lt;+156&gt;: &nbsp;&nbsp;mov =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, #22<br> &nbsp;&nbsp;0x000504a8 &lt;+160&gt;: =
 &nbsp;&nbsp;mvn &nbsp;&nbsp;&nbsp;&nbsp;r7, #0<br> =
 &nbsp;&nbsp;0x000504ac &lt;+164&gt;: &nbsp;&nbsp;str =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, [r0]<br> &nbsp;&nbsp;0x000504b0 =
 &lt;+168&gt;: &nbsp;&nbsp;b &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x50484 =
 &lt;compat_futex_noasync+124&gt;<br> &nbsp;&nbsp;0x000504b4 =
 &lt;+172&gt;: &nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r3, [r4]<br> =
 &nbsp;&nbsp;0x000504b8 &lt;+176&gt;: &nbsp;&nbsp;cmp =
 &nbsp;&nbsp;&nbsp;&nbsp;r5, r3<br> &nbsp;&nbsp;0x000504bc &lt;+180&gt;: =
 &nbsp;&nbsp;bne &nbsp;&nbsp;&nbsp;&nbsp;0x50484 =
 &lt;compat_futex_noasync+124&gt;<br>=3D&gt; 0x000504c0 &lt;+184&gt;: =
 &nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r3, [pc, #160] &nbsp;@ 0x50568 =
 &lt;compat_futex_noasync+352&gt;<br> &nbsp;&nbsp;0x000504c4 =
 &lt;+188&gt;: &nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r8, [r9, r3]<br> =
 &nbsp;&nbsp;0x000504c8 &lt;+192&gt;: &nbsp;&nbsp;mov =
 &nbsp;&nbsp;&nbsp;&nbsp;r1, r6<br> &nbsp;&nbsp;0x000504cc &lt;+196&gt;: =
 &nbsp;&nbsp;mov &nbsp;&nbsp;&nbsp;&nbsp;r0, r8<br> =
 &nbsp;&nbsp;0x000504d0 &lt;+200&gt;: &nbsp;&nbsp;bl =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x10ea0 &lt;__libc_cond_wait@plt&gt;<br> =
 &nbsp;&nbsp;0x000504d4 &lt;+204&gt;: &nbsp;&nbsp;ldr =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, [r4]<br> &nbsp;&nbsp;0x000504d8 =
 &lt;+208&gt;: &nbsp;&nbsp;cmp &nbsp;&nbsp;&nbsp;&nbsp;r3, r5<br> =
 &nbsp;&nbsp;0x000504dc &lt;+212&gt;: &nbsp;&nbsp;beq =
 &nbsp;&nbsp;&nbsp;&nbsp;0x504c8 &lt;compat_futex_noasync+192&gt;<br> =
 &nbsp;&nbsp;0x000504e0 &lt;+216&gt;: &nbsp;&nbsp;b =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x50484 =
 &lt;compat_futex_noasync+124&gt;<br> &nbsp;&nbsp;0x000504e4 =
 &lt;+220&gt;: &nbsp;&nbsp;bl &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0xebd8 =
 &lt;__errno@plt&gt;<br> &nbsp;&nbsp;0x000504e8 &lt;+224&gt;: =
 &nbsp;&nbsp;str &nbsp;&nbsp;&nbsp;&nbsp;r4, [r0]<br> =
 &nbsp;&nbsp;0x000504ec &lt;+228&gt;: &nbsp;&nbsp;mvn =
 &nbsp;&nbsp;&nbsp;&nbsp;r7, #0<br> &nbsp;&nbsp;0x000504f0 &lt;+232&gt;: =
 &nbsp;&nbsp;b &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x50494 =
 &lt;compat_futex_noasync+140&gt;<br> &nbsp;&nbsp;0x000504f4 =
 &lt;+236&gt;: &nbsp;&nbsp;bl &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0xebd8 =
 &lt;__errno@plt&gt;<br> &nbsp;&nbsp;0x000504f8 &lt;+240&gt;: =
 &nbsp;&nbsp;str &nbsp;&nbsp;&nbsp;&nbsp;r7, [r0]<br> =
 &nbsp;&nbsp;0x000504fc &lt;+244&gt;: &nbsp;&nbsp;b =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x504ec =
 &lt;compat_futex_noasync+228&gt;<br> &nbsp;&nbsp;0x00050500 =
 &lt;+248&gt;: &nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r3, [pc, #100] =
 &nbsp;@ 0x5056c &lt;compat_futex_noasync+356&gt;<br> =
 &nbsp;&nbsp;0x00050504 &lt;+252&gt;: &nbsp;&nbsp;ldr =
 &nbsp;&nbsp;&nbsp;&nbsp;r2, [pc, #100] &nbsp;@ 0x50570 =
 &lt;compat_futex_noasync+360&gt;<br> &nbsp;&nbsp;0x00050508 =
 &lt;+256&gt;: &nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r0, [pc, #100] =
 &nbsp;@ 0x50574 &lt;compat_futex_noasync+364&gt;<br> =
 &nbsp;&nbsp;0x0005050c &lt;+260&gt;: &nbsp;&nbsp;mov =
 &nbsp;&nbsp;&nbsp;&nbsp;r1, #51 @ 0x33<br> &nbsp;&nbsp;0x00050510 =
 &lt;+264&gt;: &nbsp;&nbsp;add &nbsp;&nbsp;&nbsp;&nbsp;r3, pc, r3<br> =
 &nbsp;&nbsp;0x00050514 &lt;+268&gt;: &nbsp;&nbsp;add =
 &nbsp;&nbsp;&nbsp;&nbsp;r2, pc, r2<br> &nbsp;&nbsp;0x00050518 =
 &lt;+272&gt;: &nbsp;&nbsp;add &nbsp;&nbsp;&nbsp;&nbsp;r0, pc, r0<br> =
 &nbsp;&nbsp;0x0005051c &lt;+276&gt;: &nbsp;&nbsp;bl =
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x10984 &lt;__assert13@plt&gt;<br> =
 &nbsp;&nbsp;0x00050520 &lt;+280&gt;: &nbsp;&nbsp;ldr =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, [pc, #80] &nbsp;&nbsp;@ 0x50578 =
 &lt;compat_futex_noasync+368&gt;<br> &nbsp;&nbsp;0x00050524 =
 &lt;+284&gt;: &nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r2, [pc, #80] =
 &nbsp;&nbsp;@ 0x5057c &lt;compat_futex_noasync+372&gt;<br> =
 &nbsp;&nbsp;0x00050528 &lt;+288&gt;: &nbsp;&nbsp;ldr =
 &nbsp;&nbsp;&nbsp;&nbsp;r0, [pc, #80] &nbsp;&nbsp;@ 0x50580 =
 &lt;compat_futex_noasync+376&gt;<br> &nbsp;&nbsp;0x0005052c =
 &lt;+292&gt;: &nbsp;&nbsp;mov &nbsp;&nbsp;&nbsp;&nbsp;r1, #50 @ 0x32<br> =
 &nbsp;&nbsp;0x00050530 &lt;+296&gt;: &nbsp;&nbsp;add =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, pc, r3<br> &nbsp;&nbsp;0x00050534 =
 &lt;+300&gt;: &nbsp;&nbsp;add &nbsp;&nbsp;&nbsp;&nbsp;r2, pc, r2<br> =
 &nbsp;&nbsp;0x00050538 &lt;+304&gt;: &nbsp;&nbsp;add =
 &nbsp;&nbsp;&nbsp;&nbsp;r0, pc, r0<br> &nbsp;&nbsp;0x0005053c =
 &lt;+308&gt;: &nbsp;&nbsp;bl &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x10984 =
 &lt;__assert13@plt&gt;<br> &nbsp;&nbsp;0x00050540 &lt;+312&gt;: =
 &nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r3, [pc, #60] &nbsp;&nbsp;@ =
 0x50584 &lt;compat_futex_noasync+380&gt;<br> &nbsp;&nbsp;0x00050544 =
 &lt;+316&gt;: &nbsp;&nbsp;ldr &nbsp;&nbsp;&nbsp;&nbsp;r2, [pc, #60] =
 &nbsp;&nbsp;@ 0x50588 &lt;compat_futex_noasync+384&gt;<br> =
 &nbsp;&nbsp;0x00050548 &lt;+320&gt;: &nbsp;&nbsp;ldr =
 &nbsp;&nbsp;&nbsp;&nbsp;r0, [pc, #60] &nbsp;&nbsp;@ 0x5058c =
 &lt;compat_futex_noasync+388&gt;<br> &nbsp;&nbsp;0x0005054c =
 &lt;+324&gt;: &nbsp;&nbsp;mov &nbsp;&nbsp;&nbsp;&nbsp;r1, #49 @ 0x31<br> =
 &nbsp;&nbsp;0x00050550 &lt;+328&gt;: &nbsp;&nbsp;add =
 &nbsp;&nbsp;&nbsp;&nbsp;r3, pc, r3<br> &nbsp;&nbsp;0x00050554 =
 &lt;+332&gt;: &nbsp;&nbsp;add &nbsp;&nbsp;&nbsp;&nbsp;r2, pc, r2<br> =
 &nbsp;&nbsp;0x00050558 &lt;+336&gt;: &nbsp;&nbsp;add =
 &nbsp;&nbsp;&nbsp;&nbsp;r0, pc, r0<br> &nbsp;&nbsp;0x0005055c =
 &lt;+340&gt;: &nbsp;&nbsp;bl &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0x10984 =
 &lt;__assert13@plt&gt;<br> &nbsp;&nbsp;0x00050560 &lt;+344&gt;: =
 &nbsp;&nbsp;muleq &nbsp;&nbsp;r4, r4, r2<br> &nbsp;&nbsp;0x00050564 =
 &lt;+348&gt;: &nbsp;&nbsp;strdeq &nbsp;r0, [r0], -r12<br> =
 &nbsp;&nbsp;0x00050568 &lt;+352&gt;: &nbsp;&nbsp;ldrdeq &nbsp;r0, [r0], =
 -r8<br> &nbsp;&nbsp;0x0005056c &lt;+356&gt;: &nbsp;&nbsp;andeq =
 &nbsp;&nbsp;r8, r2, r12, ror r4<br> &nbsp;&nbsp;0x00050570 &lt;+360&gt;: =
 &nbsp;&nbsp;andeq &nbsp;&nbsp;r4, r3, r8, lsl #19<br> =
 &nbsp;&nbsp;0x00050574 &lt;+364&gt;: &nbsp;&nbsp;andeq &nbsp;&nbsp;r8, =
 r2, r4, lsl r4<br> &nbsp;&nbsp;0x00050578 &lt;+368&gt;: =
 &nbsp;&nbsp;andeq &nbsp;&nbsp;r8, r2, r4, asr r4<br> =
 &nbsp;&nbsp;0x0005057c &lt;+372&gt;: &nbsp;&nbsp;andeq &nbsp;&nbsp;r4, =
 r3, r8, ror #18<br> &nbsp;&nbsp;0x00050580 &lt;+376&gt;: =
 &nbsp;&nbsp;strdeq &nbsp;r8, [r2], -r4<br> &nbsp;&nbsp;0x00050584 =
 &lt;+380&gt;: &nbsp;&nbsp;ldrdeq &nbsp;r8, [r2], -r0<br> =
 &nbsp;&nbsp;0x00050588 &lt;+384&gt;: &nbsp;&nbsp;andeq &nbsp;&nbsp;r4, =
 r3, r8, asr #18<br> &nbsp;&nbsp;0x0005058c &lt;+388&gt;: =
 &nbsp;&nbsp;ldrdeq &nbsp;r8, [r2], -r4<br>End of assembler =
 dump.<br><br><br><blockquote =
 type=3D"cite">How-To-Repeat:<br></blockquote>not quite sure, evbearmv5 =
 specific?<br><br><blockquote =
 type=3D"cite">Fix:<br></blockquote>n/a<br></div></div></blockquote></div><=
 br></div></body></html>=

 --Apple-Mail=_F2896C6F-CE9F-4AF4-A9F7-20BEC905BDEA--

 --Apple-Mail=_8FD8957E-16BF-4232-850A-E68F2B9AC06E
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
 	filename=signature.asc
 Content-Type: application/pgp-signature;
 	name=signature.asc
 Content-Description: Message signed with OpenPGP

 -----BEGIN PGP SIGNATURE-----
 Comment: GPGTools - http://gpgtools.org

 iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCZ5llqwAKCRBxESqxbLM7
 OimCAJ0X4t9TDg0u09bAGBRxC3cObahR7wCeKGMZnbUqkhKByCcZjP/J+J49JyA=
 =S4x8
 -----END PGP SIGNATURE-----

 --Apple-Mail=_8FD8957E-16BF-4232-850A-E68F2B9AC06E--

From: Martin Husemann <martin@duskware.de>
To: Christos Zoulas <christos@zoulas.com>
Cc: gnats-bugs@netbsd.org
Subject: Re: bin/59035: new named(8) crashes at startup on evbarmv5
Date: Wed, 29 Jan 2025 13:08:35 +0100

 I ran it from gdb with -f and get this backtrace:

 (gdb) bt -full
 #0  _cds_wfcq_enqueue (new_tail=0xbb2952a8, tail=0x100, head=...)
     at /work/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/include/urcu/static/wfcqueue.h:217
 No locals.
 #1  _call_rcu (crdp=0x100, func=0xbbd40208 <dispatch_destroy_rcu>, head=0xbb2952a8)
     at /work/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/urcu-call-rcu-impl.h:705
 No locals.
 #2  urcu_memb_call_rcu (head=0xbb2952a8, func=0xbbd40208 <dispatch_destroy_rcu>)
     at /work/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/urcu-call-rcu-impl.h:732
         crdp = 0x100
 #3  0xbbd42168 in dispentry_destroy (resp=0xbb1009a8)
     at /work/src/external/mpl/bind/lib/libdns/../../dist/lib/dns/dispatch.c:445
         disp = 0x0
         disp = <optimized out>
 #4  dns_dispentry_unref (ptr=0xbb1009a8) at /work/src/external/mpl/bind/lib/libdns/../../dist/lib/dns/dispatch.c:453
 No locals.
 #5  0xbbd437cc in send_done (handle=<optimized out>, result=ISC_R_SUCCESS, cbarg=<optimized out>)
     at /work/src/external/mpl/bind/lib/libdns/../../dist/lib/dns/dispatch.c:2092
         resp = 0x0
         disp = <optimized out>
 #6  0xbbbe4434 in isc___nm_connectcb (arg=0xbb27ec48)
     at /work/src/external/mpl/bind/lib/libisc/../../dist/lib/isc/netmgr/netmgr.c:1841
         uvreq = 0xbb27ec48
 #7  isc__nm_sendcb (sock=0xba434e08, uvreq=0xbb27ec48, eresult=ISC_R_SUCCESS, async=<optimized out>)
     at /work/src/external/mpl/bind/lib/libisc/../../dist/lib/isc/netmgr/netmgr.c:1910
 No locals.
 #8  0xbbc06a28 in uv__udp_run_completed (handle=0xba434fc0) at /work/src/external/mit/libuv/lib/../dist/src/unix/udp.c:157
         req = 0xbb27ecc8
         q = 0xbb27ecf0
         __func__ = "uv__udp_run_completed"
 #9  0xbbc0de48 in uv__run_pending (loop=loop@entry=0xbb2c2518) at /work/src/external/mit/libuv/lib/../dist/src/unix/core.c:810
         q = <optimized out>
         pq = {0xba435384, 0xba435704}
         w = <optimized out>
 #10 0xbbc0e2b4 in uv_run (loop=0xbb2c2518, mode=UV_RUN_DEFAULT) at /work/src/external/mit/libuv/lib/../dist/src/unix/core.c:411
         timeout = <optimized out>
         r = <optimized out>
         can_sleep = <optimized out>
 #11 0xbbbf6e94 in loop_thread (arg=0xbb2c2508) at /work/src/external/mpl/bind/lib/libisc/../../dist/lib/isc/loop.c:329
         loop = 0xbb2c2508
         loopmgr = 0xbb2940c8
         helper = 0xbb2c2a08

 crdp=0x100 and tail=0x100 look like strange pointers.

 Martin

From: Tobias Nygren <tnn@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/59035: new named(8) crashes at startup on evbarmv5
Date: Fri, 14 Feb 2025 21:34:33 +0100

 Reproducable on aarch64 as well. "named -g" core dumps immediately[1].
 On aarch64 I found that I can paper over the crash with this patch.

 --- external/lgpl2/userspace-rcu/lib/liburcu-memb/Makefile	17 Jan 2025 16:07:27 -0000	1.1
 +++ external/lgpl2/userspace-rcu/lib/liburcu-memb/Makefile	14 Feb 2025 20:31:37 -0000
 @@ -8,4 +8,6 @@ CPPFLAGS+=-DRCU_MEMBARRIER

  SRCS+= urcu.c urcu-pointer.c compat_arch.c compat_futex.c

 +COPTS.urcu.c+=-O0
 +
  .include <bsd.lib.mk>


 [1]
 Thread 7 "isc-loop-0005" received signal SIGSEGV, Segmentation fault.
 [Switching to LWP 24143 of process 3105]
 _cds_wfcq_enqueue (new_tail=0xf011f2ca6130, tail=0x1, head=...)
     at /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/include/urcu/static/wfcqueue.h:217
 217		return ___cds_wfcq_append(head, tail, new_tail, new_tail);
 (gdb) bt
 #0  _cds_wfcq_enqueue (new_tail=0xf011f2ca6130, tail=0x1, head=...)
     at /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/include/urcu/static/wfcqueue.h:217
 #1  _call_rcu (head=head@entry=0xf011f2ca6130, func=<optimized out>, crdp=0x1)
     at /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/urcu-call-rcu-impl.h:705
 #2  0x000000000f37f628 in urcu_memb_call_rcu (head=head@entry=0xf011f2ca6130, func=func@entry=0xf011f85d7960 <dispentry_destroy_rcu>)
     at /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/urcu-call-rcu-impl.h:732
 #3  0x0000f011f85d981c in dispentry_destroy (resp=0xf011f2ca6010) at /usr/src/external/mpl/bind/lib/libdns/../../dist/lib/dns/dispatch.c:447
 #4  dns_dispentry_unref (ptr=0xf011f2ca6010) at /usr/src/external/mpl/bind/lib/libdns/../../dist/lib/dns/dispatch.c:453
 #5  0x0000f011f85da4c0 in udp_recv (handle=0xf011f2e0b010, eresult=ISC_R_SUCCESS, region=0xf011f37cdb70, arg=<optimized out>)
     at /usr/src/external/mpl/bind/lib/libdns/../../dist/lib/dns/dispatch.c:628
 #6  0x0000f011f84438f0 in isc.nm_readcb () from /usr/lib/libisc.so.23
 #7  0x0000f011f842d8bc in isc.nm_udp_read_cb () from /usr/lib/libisc.so.23
 #8  0x0000f011f8462b80 in ?? () from /usr/lib/libisc.so.23
 #9  0x0000f011f846203c in uv.io_poll () from /usr/lib/libisc.so.23
 #10 0x0000f011f846a2a0 in uv_run () from /usr/lib/libisc.so.23
 #11 0x0000f011f8454b0c in ?? () from /usr/lib/libisc.so.23
 #12 0x0000f011f8459eec in ?? () from /usr/lib/libisc.so.23
 #13 0x0000f011f824dad4 in ?? () from /usr/lib/libpthread.so.1
 #14 0x0000f011f75e26a0 in __mknod50 () from /usr/lib/libc.so.12

From: Tobias Nygren <tnn@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/59035: new named(8) crashes at startup on evbarmv5
Date: Fri, 14 Feb 2025 22:00:12 +0100

 There is a GCC warning about an out of bounds write which only appears at -O0.
 Maybe related.

 In file included from /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/include/urcu/uatomic/aarch64.h:31,
                  from /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/include/urcu/uatomic.h:85,
                  from /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/include/urcu/static/wfcqueue.h:21,
                  from /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/include/urcu/wfcqueue.h:177,
                  from /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/urcu.c:30:
 In function '_uatomic_add_return',
     inlined from 'wait_defer' at /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/urcu-defer-impl.h:169:2:
 /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/include/urcu/uatomic/generic.h:301:24: error: '__sync_add_and_fetch_8' writing 8 bytes into a region of size 4 overflows the destination [-Werror=stringop-overflow=]
   301 |                 return __sync_add_and_fetch_8((uint64_t *) addr, val);
       |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 In file included from /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/urcu.c:558:
 /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/urcu-defer-impl.h: In function 'wait_defer':
 /usr/src/external/lgpl2/userspace-rcu/lib/liburcu-memb/../../dist/src/urcu-defer-impl.h:109:16: note: destination object 'defer_thread_futex' of size 4
   109 | static int32_t defer_thread_futex;
       |                ^~~~~~~~~~~~~~~~~~
 cc1: all warnings being treated as errors

From: Tobias Nygren <tnn@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: Martin Husemann <martin@NetBSD.org>
Subject: Re: bin/59035: new named(8) crashes at startup on evbarmv5
Date: Sun, 16 Feb 2025 00:42:31 +0100

 Something might be going awry with liburcu's ELF constructors
 when it is linked into named as a static library. The
 thread_call_rcu_data pointer which is supposed to be inited by the
 constructor contains apparent garbage at startup.

 The easiest workaround seems to be to remove the constructor.
 I think this is safe because rcu_register_thread calls rcu_init
 regardless ...

 Martin, does this help on earmv5?
 (May be need to clean obj/external/{lgpl2,mpl} manually)

 --- external/lgpl2/userspace-rcu/dist/src/urcu.c	17 Jan 2025 16:00:50 -0000	1.1.1.1
 +++ external/lgpl2/userspace-rcu/dist/src/urcu.c	15 Feb 2025 23:38:07 -0000
 @@ -83,7 +83,7 @@ static int urcu_memb_has_sys_membarrier_
  int urcu_memb_has_sys_membarrier = 0;
  #endif

 -void __attribute__((constructor)) rcu_init(void);
 +void rcu_init(void);
  #endif

  #if defined(RCU_MB)

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-2025 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.