Re: Panic, CURRENT, yesterday

2022-02-09 Thread Larry Rosenman

On 02/08/2022 1:51 pm, Larry Rosenman wrote:

I got the following last night while doing a poudriere run as well as
a full bacula backup:

borg.lerctr.org dumped core - see /var/crash/vmcore.0

Mon Feb  7 23:05:48 CST 2022

FreeBSD borg.lerctr.org 14.0-CURRENT FreeBSD 14.0-CURRENT #54
ler/freebsd-main-changes-n252969-5e5fd0c788c: Sat Feb  5 14:48:30 CST
2022
r...@borg.lerctr.org:/usr/obj/usr/src/amd64.amd64/sys/LER-MINIMAL
amd64

panic: ng_snd_item: 42 != 290


Another one today:
❯ more /var/crash/core.txt.1
borg.lerctr.org dumped core - see /var/crash/vmcore.1

Wed Feb  9 19:30:43 CST 2022

FreeBSD borg.lerctr.org 14.0-CURRENT FreeBSD 14.0-CURRENT #54 
ler/freebsd-main-changes-n252969-5e5fd0c788c: Sat Feb  5 14:48:30 CST 
2022 
r...@borg.lerctr.org:/usr/obj/usr/src/amd64.amd64/sys/LER-MINIMAL  amd64


panic: ng_snd_item: 42 != 1414

GNU gdb (GDB) 11.2 [GDB v11.2 for FreeBSD]
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 


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 "x86_64-portbld-freebsd14.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /boot/kernel/kernel...
Reading symbols from /usr/lib/debug//boot/kernel/kernel.debug...

Unread portion of the kernel message buffer:
panic: ng_snd_item: 42 != 1414
cpuid = 0
time = 1644455454
KDB: stack backtrace:
#0 0x80515fc5 at kdb_backtrace+0x65
#1 0x804cbaef at vpanic+0x17f
#2 0x804cb8c3 at panic+0x43
#3 0x82c765b7 at ng_snd_item+0x587
#4 0x82c8f263 at ng_ether_output+0xb3
#5 0x805e0c1d at ether_output+0x6cd
#6 0x805f6251 at arpintr+0xd71
#7 0x805e5587 at netisr_dispatch_src+0x97
#8 0x805e0f1e at ether_demux+0x14e
#9 0x82c8f89c at ng_ether_rcv_upper+0x12c
#10 0x82c76dab at ng_apply_item+0x7eb
#11 0x82c7638d at ng_snd_item+0x35d
#12 0x82c76dab at ng_apply_item+0x7eb
#13 0x82c7638d at ng_snd_item+0x35d
#14 0x82c8f33f at ng_ether_input+0x9f
#15 0x805e21d7 at ether_nh_input+0x217
#16 0x805e5587 at netisr_dispatch_src+0x97
#17 0x805e138d at ether_input+0x5d
Uptime: 1d20h10m31s
Dumping 28528 out of 131023 
MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91%


__curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:55
55  __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" 
(offsetof(struct pcpu,

(kgdb) #0  __curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:55
#1  doadump (textdump=)
at /usr/src/sys/kern/kern_shutdown.c:399
#2  0x804cb6ff in kern_reboot (howto=260)
at /usr/src/sys/kern/kern_shutdown.c:487
#3  0x804cbb5e in vpanic (fmt=0x82c7fd98 "%s: %d != %d",
ap=) at /usr/src/sys/kern/kern_shutdown.c:920
#4  0x804cb8c3 in panic (fmt=)
at /usr/src/sys/kern/kern_shutdown.c:844
#5  0x82c765b7 in ng_snd_item (item=0xf8132d74f880, flags=0)
at /usr/src/sys/netgraph/ng_base.c:2256
#6  0x82c8f263 in ng_ether_output (ifp=,
ifp@entry=,
mp=0xfe02ba63f868,
mp@entry=)
at /usr/src/sys/netgraph/ng_ether.c:294
#7  0x805e0c1d in ether_output (ifp=0xf80114a43000,
m=0xf81f8203e600, dst=, ro=)
at /usr/src/sys/net/if_ethersubr.c:427
#8  0x805f6251 in in_arpinput (m=0xf81f8203e600)
at /usr/src/sys/netinet/if_ether.c:1129
#9  arpintr (m=0xf81f8203e600,
m@entry=)
at /usr/src/sys/netinet/if_ether.c:739
#10 0x805e5587 in netisr_dispatch_src (proto=4,
source=source@entry=0, m=0xf81f8203e600)
at /usr/src/sys/net/netisr.c:1153
#11 0x805e58df in netisr_dispatch (proto=,
m=) at /usr/src/sys/net/netisr.c:1244
#12 0x805e0f1e in ether_demux (ifp=ifp@entry=0xf80114a43000,
m=, m@entry=0xf81f8203e600)
at /usr/src/sys/net/if_ethersubr.c:926
#13 0x82c8f89c in ng_ether_rcv_upper (hook=,
hook@entry=,
item=0xf8132d74f880,
item@entry=)
at /usr/src/sys/netgraph/ng_ether.c:742
#14 0x82c76dab in ng_apply_item 
(node=node@entry=0xf812992fe600,

item=item@entry=0xf8132d74f880, rw=0)
at /usr/src/sys/netgraph/ng_base.c:2406
#15 0x82c7638d in ng_snd_item (item=0xf8132d74f880,
item@entry=, 
flags=0,

flags@entry=)
at /usr/src/sys/netgraph/ng_base.c:2323
#16 0x82c76dab in ng_apply_item 
(node=node@entry=0xf8040b1eda00,

item=item@entry=0xf8132d74f880, rw=0)
at /usr/src/sys/netgraph/ng_base.c:2406
#17 0x82c7638d in

Re: fd7daa727126 breaks buildkernel when KERN_TLS is not defined

2022-02-09 Thread tuexen
> On 9. Feb 2022, at 11:43, Gary Jennejohn  wrote:
> 
> Commit fd7daa727126 to /usr/src/sys/netinet/tcp_usrreq.c breaks buildkernel
> when KERN_TLS is not defined.
Fixed in 
https://cgit.FreeBSD.org/src/commit/?id=528c76492402d9be8ec83a0a769f0d70e2a32f61

Thanks for reporting.

Best regards
Michael
> This patch fixes it for me:
> 
> --- tcp_usrreq.c.orig 2022-02-09 10:25:46.851034000 +
> +++ tcp_usrreq.c  2022-02-09 10:30:27.541058000 +
> @@ -2119,12 +2119,12 @@
> int
> tcp_default_ctloutput(struct inpcb *inp, struct sockopt *sopt)
> {
> - struct socket *so = inp->inp_socket;
>   struct tcpcb *tp = intotcpcb(inp);
>   int error, opt, optval;
>   u_int   ui;
>   struct  tcp_info ti;
> #ifdef KERN_TLS
> + struct socket *so = inp->inp_socket;
>   struct tls_enable tls;
> #endif
>   char*pbuf, buf[TCP_LOG_ID_LEN];
> @@ -2136,7 +2136,9 @@
>   INP_WLOCK_ASSERT(inp);
>   KASSERT((inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) == 0,
>   ("inp_flags == %x", inp->inp_flags));
> +#ifdef KERN_TLS
>   KASSERT(so != NULL, ("inp_socket == NULL"));
> +#endif
> 
>   switch (sopt->sopt_level) {
> #ifdef INET6
> 
> -- 
> Gary Jennejohn
> 




Re: buildworld failed

2022-02-09 Thread George Abdelmalik

On 8/2/22 15:45, Warner Losh wrote:



On Tue, Feb 8, 2022 at 3:43 AM George Abdelmalik  
wrote:



On 7/2/22 03:50, qroxana wrote:



I know running make install for
/usr/src/tools/build/test-includes can fix this,
but this still fails on a newly installed 14.0-CURRENT.

--- test-includes ---
cd /usr/src/tools/build/test-includes; MACHINE_ARCH=aarch64 
MACHINE=arm64  CPUTYPE= CC="cc -target
aarch64-unknown-freebsd14.0
--sysroot=/usr/obj/usr/src/arm64.aarch64/tmp
-B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin -target
aarch64-unknown-freebsd14.0
--sysroot=/usr/obj/usr/src/arm64.aarch64/tmp
-B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin" CXX="c++  -target
aarch64-unknown-freebsd14.0
--sysroot=/usr/obj/usr/src/arm64.aarch64/tmp
-B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin -target
aarch64-unknown-freebsd14.0
--sysroot=/usr/obj/usr/src/arm64.aarch64/tmp
-B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin" CPP="cpp -target
aarch64-unknown-freebsd14.0
--sysroot=/usr/obj/usr/src/arm64.aarch64/tmp
-B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin -target
aarch64-unknown-freebsd14.0
--sysroot=/usr/obj/usr/src/arm64.aarch64/tmp
-B/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin" AS="as" AR="ar"
ELFCTL="elfctl" LD="ld" LLVM_LINK="" NM=nm OBJCOPY="objcopy"
RANLIB=ranlib STRINGS=  SIZE="size" STRIPBIN="strip" 
INSTALL="install -U"

PATH=/usr/obj/usr/src/arm64.aarch64/tmp/bin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/libexec::/usr/obj/usr/src/arm64.aarch64/tmp/bin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/usr/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/sbin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/bin:/usr/obj/usr/src/arm64.aarch64/tmp/legacy/usr/libexec::/sbin:/bin:/usr/sbin:/usr/bin
SYSROOT=/usr/obj/usr/src/arm64.aarch64/tmp make
DESTDIR=/usr/obj/usr/src/arm64.aarch64/tmp test-includes
--- sys/abi_compat.c ---
--- sys/acct.c ---
--- sys/acl.c ---
--- sys/aio.c ---
--- sys/abi_compat.c ---
echo "#include " > sys/abi_compat.c
sh: cannot create sys/abi_compat.c: No such file or directory
*** [sys/abi_compat.c] Error code 2

make[4]: stopped in /usr/src/tools/build/test-includes
--- sys/acct.c ---
echo "#include " > sys/acct.c
sh: cannot create sys/acct.c: No such file or directory
*** [sys/acct.c] Error code 2

make[4]: stopped in /usr/src/tools/build/test-includes
--- sys/aio.c ---
echo "#include " > sys/aio.c
sh: cannot create sys/aio.c: No such file or directory
*** [sys/aio.c] Error code 2

make[4]: stopped in /usr/src/tools/build/test-includes
--- sys/acl.c ---
echo "#include " > sys/acl.c
sh: cannot create sys/acl.c: No such file or directory
*** [sys/acl.c] Error code 2



Same here for me for the past couple of weeks. Haven't been able
to identify why it fails. My hunch was that a particular objdir
wasn't being created. As a workaround I edited the Makefile.inc1
to remove the test-includes command (line 1128 I think).

I'd really like to understand why this error comes about. If
someone has any insights, please share them :)

What build options are you using?  this is the test to make sure that 
files can be included on their own.


Warner



Hi Warner,

My make.conf contains:

# make.conf(5) to use when building world.
MALLOC_PRODUCTION=


My src.conf contains:

## src.conf(5) to use when building world.
WITHOUT_IPFILTER=
WITHOUT_PF=
WITHOUT_PPP=
WITHOUT_LPR=
WITHOUT_NIS=
WITHOUT_LIB32=
WITHOUT_HYPERV=
WITHOUT_APM=
WITHOUT_ATM=
WITHOUT_FINGER=
WITHOUT_FLOPPY=
WITHOUT_RADIUS_SUPPORT=
WITHOUT_DEBUG_FILES=
WITHOUT_TESTS=


The build command is:

env MAKEOBJDIRPREFIX=$HOME/obj \
    make -j2 \
    -DNO_CLEAN \
    __MAKE_CONF=$HOME/make.conf \
    SRCCONF=$HOME/src.conf \
    TARGET=amd64 \
    TARGET_ARCH=amd64 \
    CPUTYPE= \
    buildworld


Perhaps the issue is that I first build the toolchain as a separate step 
prior to invoking buildworld, that command is:


    env MAKEOBJDIRPREFIX=$HOME/obj \
    make -j2 \
    __MAKE_CONF=$HOME/make.conf \
    SRCCONF=$HOME/src.conf \
    TARGET=amd64 \
    TARGET_ARCH=amd64 \
    toolchain

Thanks for your interest,
George.


Re: test-includes breaks buildworld when WITHOUT_PF is set in src.conf

2022-02-09 Thread Gary Jennejohn
On Wed, 09 Feb 2022 11:08:44 +0100
Kristof Provost  wrote:

> On 9 Feb 2022, at 10:57, Gary Jennejohn wrote:
> > test-includes uses pf.h when checking usage of pfvar.h.
> >
> > But, these lines in include/Makefile remove pf.h when WITHOUT_PF is
> > set in src.conf:
> >
> > .if ${MK_PF} != "no"
> >  INCSGROUPS+=   PF
> > .endif
> >
> > This breaks buildworld.  The error message:
> >
> > In file included from net_pfvar.c:1:
> > /usr/obj/usr/src/amd64.amd64/tmp/usr/include/net/pfvar.h:65:10: fatal error:
> > 'netpfil/pf/pf.h' file not found
> > #include 
> >  ^
> > 1 error generated.
> > --- net_pfvar.o ---
> > *** [net_pfvar.o] Error code 1
> >
> > make[3]: stopped in /usr/src/tools/build/test-includes
> > .ERROR_TARGET='net_pfvar.o'
> >
> > Removing the .if/.endif fixes it for me, although there may be a better
> > way to avoid the error.
> >  
> Warner's working on a better fix. See https://reviews.freebsd.org/D34009 for 
> the discussion.
> 

Thanks for the info.

-- 
Gary Jennejohn



fd7daa727126 breaks buildkernel when KERN_TLS is not defined

2022-02-09 Thread Gary Jennejohn
Commit fd7daa727126 to /usr/src/sys/netinet/tcp_usrreq.c breaks buildkernel
when KERN_TLS is not defined.

This patch fixes it for me:

--- tcp_usrreq.c.orig   2022-02-09 10:25:46.851034000 +
+++ tcp_usrreq.c2022-02-09 10:30:27.541058000 +
@@ -2119,12 +2119,12 @@
 int
 tcp_default_ctloutput(struct inpcb *inp, struct sockopt *sopt)
 {
-   struct socket *so = inp->inp_socket;
struct tcpcb *tp = intotcpcb(inp);
int error, opt, optval;
u_int   ui;
struct  tcp_info ti;
 #ifdef KERN_TLS
+   struct socket *so = inp->inp_socket;
struct tls_enable tls;
 #endif
char*pbuf, buf[TCP_LOG_ID_LEN];
@@ -2136,7 +2136,9 @@
INP_WLOCK_ASSERT(inp);
KASSERT((inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) == 0,
("inp_flags == %x", inp->inp_flags));
+#ifdef KERN_TLS
KASSERT(so != NULL, ("inp_socket == NULL"));
+#endif
 
switch (sopt->sopt_level) {
 #ifdef INET6

-- 
Gary Jennejohn



Re: test-includes breaks buildworld when WITHOUT_PF is set in src.conf

2022-02-09 Thread Kristof Provost
On 9 Feb 2022, at 10:57, Gary Jennejohn wrote:
> test-includes uses pf.h when checking usage of pfvar.h.
>
> But, these lines in include/Makefile remove pf.h when WITHOUT_PF is
> set in src.conf:
>
> .if ${MK_PF} != "no"
>  INCSGROUPS+=   PF
> .endif
>
> This breaks buildworld.  The error message:
>
> In file included from net_pfvar.c:1:
> /usr/obj/usr/src/amd64.amd64/tmp/usr/include/net/pfvar.h:65:10: fatal error:
> 'netpfil/pf/pf.h' file not found
> #include 
>  ^
> 1 error generated.
> --- net_pfvar.o ---
> *** [net_pfvar.o] Error code 1
>
> make[3]: stopped in /usr/src/tools/build/test-includes
> .ERROR_TARGET='net_pfvar.o'
>
> Removing the .if/.endif fixes it for me, although there may be a better
> way to avoid the error.
>
Warner’s working on a better fix. See https://reviews.freebsd.org/D34009 for 
the discussion.

Kristof



test-includes breaks buildworld when WITHOUT_PF is set in src.conf

2022-02-09 Thread Gary Jennejohn
test-includes uses pf.h when checking usage of pfvar.h.

But, these lines in include/Makefile remove pf.h when WITHOUT_PF is
set in src.conf:

.if ${MK_PF} != "no"
 INCSGROUPS+=   PF
.endif

This breaks buildworld.  The error message:

In file included from net_pfvar.c:1:
/usr/obj/usr/src/amd64.amd64/tmp/usr/include/net/pfvar.h:65:10: fatal error:
'netpfil/pf/pf.h' file not found
#include 
 ^
1 error generated.
--- net_pfvar.o ---
*** [net_pfvar.o] Error code 1

make[3]: stopped in /usr/src/tools/build/test-includes
.ERROR_TARGET='net_pfvar.o'

Removing the .if/.endif fixes it for me, although there may be a better
way to avoid the error.

-- 
Gary Jennejohn