Re: funny pathname lookups from the compiler

2019-08-20 Thread Dimitry Andric
On 20 Aug 2019, at 20:24, Mateusz Guzik  wrote:
> 
> Interested parties can collect this on their own:
> 
> dtrace -n 'vfs:namei:lookup:entry /execname == "ld.lld" || execname ==
> "cc"/ { @[stringof(arg1)] = count(); }'
> 
> and cc hello.c or similar elsewhere.
> 
> Full list is here:
> http://dpaste.com/2YM1R41
> 
> Highlights of fishy entries for me:
>  /proc/self/fd 1
>  /etc/SuSE-release 3
>  /etc/alpine-release   3
>  /etc/arch-release 3
>  /etc/debian_version   3
>  /etc/exherbo-release  3
>  /etc/gentoo-release   3
>  /etc/lsb-release  3
>  /etc/malloc.conf  3
>  /etc/redhat-release   3
> 
> I don't know this code but I strongly suspect most of this can be easily
> ifdef-ed out. The first one perhaps can be disabled with a switch to
> configure.
> 
> None of this is a significant problem of course, but it does look like a
> waste.

Yes, it is an annoying detail of the Distro class in
contrib/llvm/tools/clang/lib/Driver/Distro.cpp, where it is trying to
look up the "distro", since Linux makes that so very very easy. :-)

I would recommend filing an upstream bug report at
https://bugs.llvm.org/, and/or submit a patch at
https://reviews.llvm.org/.

-Dimitry



signature.asc
Description: Message signed with OpenPGP


funny pathname lookups from the compiler

2019-08-20 Thread Mateusz Guzik
Interested parties can collect this on their own:

dtrace -n 'vfs:namei:lookup:entry /execname == "ld.lld" || execname ==
"cc"/ { @[stringof(arg1)] = count(); }'

and cc hello.c or similar elsewhere.

Full list is here:
http://dpaste.com/2YM1R41

Highlights of fishy entries for me:
  /proc/self/fd 1
  /etc/SuSE-release 3
  /etc/alpine-release   3
  /etc/arch-release 3
  /etc/debian_version   3
  /etc/exherbo-release  3
  /etc/gentoo-release   3
  /etc/lsb-release  3
  /etc/malloc.conf  3
  /etc/redhat-release   3

I don't know this code but I strongly suspect most of this can be easily
ifdef-ed out. The first one perhaps can be disabled with a switch to
configure.

None of this is a significant problem of course, but it does look like a
waste.

-- 
Mateusz Guzik 
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


panic... r350849M panic: ng_snd_item: 42 != 1414

2019-08-20 Thread Larry Rosenman

the M is a patch from rrs@ for the previous crash on m_pullup.

Ideas?  I have a core.


Unread portion of the kernel message buffer:
panic: ng_snd_item: 42 != 1414
cpuid = 0
time = 1566303841
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 
0xfe01265c0400

vpanic() at vpanic+0x19d/frame 0xfe01265c0450
panic() at panic+0x43/frame 0xfe01265c04b0
ng_snd_item() at ng_snd_item+0x455/frame 0xfe01265c04f0
ng_ether_output() at ng_ether_output+0x5e/frame 0xfe01265c0520
ether_output() at ether_output+0x665/frame 0xfe01265c05c0
arpintr() at arpintr+0xfe3/frame 0xfe01265c0780
netisr_dispatch_src() at netisr_dispatch_src+0x89/frame 
0xfe01265c07f0

ether_demux() at ether_demux+0x13b/frame 0xfe01265c0820
ng_ether_rcv_upper() at ng_ether_rcv_upper+0x95/frame 0xfe01265c0840
ng_apply_item() at ng_apply_item+0xf9/frame 0xfe01265c08c0
ng_snd_item() at ng_snd_item+0x2af/frame 0xfe01265c0900
ng_apply_item() at ng_apply_item+0xf9/frame 0xfe01265c0980
ng_snd_item() at ng_snd_item+0x2af/frame 0xfe01265c09c0
ng_ether_input() at ng_ether_input+0x4c/frame 0xfe01265c09f0
ether_nh_input() at ether_nh_input+0x2cd/frame 0xfe01265c0a40
netisr_dispatch_src() at netisr_dispatch_src+0x89/frame 
0xfe01265c0ab0

ether_input() at ether_input+0x48/frame 0xfe01265c0ad0
bce_intr() at bce_intr+0x697/frame 0xfe01265c0b50
ithread_loop() at ithread_loop+0x187/frame 0xfe01265c0bb0
fork_exit() at fork_exit+0x84/frame 0xfe01265c0bf0
fork_trampoline() at fork_trampoline+0xe/frame 0xfe01265c0bf0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
Uptime: 19h52m2s
Dumping 27502 out of 131026 
MB:..1%..11%..21%..31%..41%..51%..61%..71%..81%..91%


__curthread () at /usr/src/sys/amd64/include/pcpu.h:246
246 __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" 
(OFFSETOF_CURTHREAD));

(kgdb) #0  __curthread () at /usr/src/sys/amd64/include/pcpu.h:246
#1  doadump (textdump=1) at /usr/src/sys/kern/kern_shutdown.c:392
#2  0x804bb950 in kern_reboot (howto=260)
at /usr/src/sys/kern/kern_shutdown.c:479
#3  0x804bbdc9 in vpanic (fmt=, ap=out>)

at /usr/src/sys/kern/kern_shutdown.c:905
#4  0x804bbb03 in panic (fmt=)
at /usr/src/sys/kern/kern_shutdown.c:832
#5  0x828e1515 in ng_snd_item (item=0xf81769193580, flags=0)
at /usr/src/sys/netgraph/ng_base.c:2252
#6  0x828f2c2e in ng_ether_output (ifp=,
mp=0xfe01265c0578) at /usr/src/sys/netgraph/ng_ether.c:294
#7  0x805c9975 in ether_output (ifp=0xf80122488000,
m=0xf818181a8b00, dst=0xfe01265c0740, ro=)
at /usr/src/sys/net/if_ethersubr.c:430
#8  0x805e2e43 in in_arpinput (m=)
at /usr/src/sys/netinet/if_ether.c:1152
#9  arpintr (m=0xf818181a8b00) at 
/usr/src/sys/netinet/if_ether.c:749

#10 0x805d4959 in netisr_dispatch_src (proto=4,
source=, m=) at 
/usr/src/sys/net/netisr.c:1123
#11 0x805c9c3b in ether_demux (ifp=0xf80122488000, 
m=)

at /usr/src/sys/net/if_ethersubr.c:913
#12 0x828f3045 in ng_ether_rcv_upper (hook=,
item=) at /usr/src/sys/netgraph/ng_ether.c:741
#13 0x828e1639 in ng_apply_item (node=0xf801c6ae3c00,
item=0xf81769193580, rw=0) at 
/usr/src/sys/netgraph/ng_base.c:2403

#14 0x828e136f in ng_snd_item (item=0xf81769193580, flags=0)
at /usr/src/sys/netgraph/ng_base.c:2320
#15 0x828e1639 in ng_apply_item (node=0xf810410a0400,
item=0xf81769193580, rw=0) at 
/usr/src/sys/netgraph/ng_base.c:2403

#16 0x828e136f in ng_snd_item (item=0xf81769193580, flags=0)
at /usr/src/sys/netgraph/ng_base.c:2320
#17 0x828f2cbc in ng_ether_input (ifp=,
mp=0xfe01265c0a18) at /usr/src/sys/netgraph/ng_ether.c:255
#18 0x805cae8d in ether_input_internal (ifp=0xf80122488000,
m=0xf818181a8b00) at /usr/src/sys/net/if_ethersubr.c:654
#19 ether_nh_input (m=) at 
/usr/src/sys/net/if_ethersubr.c:735

#20 0x805d4959 in netisr_dispatch_src (proto=5,
source=, m=) at 
/usr/src/sys/net/netisr.c:1123

#21 0x805ca078 in ether_input (ifp=0xf80122488000, m=0x0)
at /usr/src/sys/net/if_ethersubr.c:823
#22 0x8272f877 in bce_rx_intr (sc=)
at /usr/src/sys/dev/bce/if_bce.c:6848
#23 bce_intr (xsc=0xfe013abc2000) at 
/usr/src/sys/dev/bce/if_bce.c:8017
#24 0x80484997 in intr_event_execute_handlers (p=out>,

ie=) at /usr/src/sys/kern/kern_intr.c:1148
#25 ithread_execute_handlers (p=, ie=)
at /usr/src/sys/kern/kern_intr.c:1161
#26 ithread_loop (arg=) at 
/usr/src/sys/kern/kern_intr.c:1241

#27 0x80481544 in fork_exit (
callout=0x80484810 , arg=0xf81058226460,
frame=0xfe01265c0c00) at /usr/src/sys/kern/kern_fork.c:1057
#28 
(kgdb)

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-642-9640 E-Mail: l...@lerctr.org
US Mail: 5708 Sabbia Dr, Round Rock, TX 78665-2106

Re: r351247: buildkernel failure: error: use of undeclared identifier 'miibus_statchg_XXXX

2019-08-20 Thread David Wolfskill
On Tue, Aug 20, 2019 at 08:47:04AM +0200, O. Hartmann wrote:
> Recent CURRENT (r351247) fails to buildkernel due to a compilation error,
> pointing to an mii issue.
> 
> For almost every mii-related if_ the compiler drops an error like:
> ...
> Seems the subfolder for USB NICs is missing something?
> 
> Kind regards,
> 
> oh
> 

I also encountered this, while attempting an update from r351211 to
r351245.

In looking over the files that were updated, I note

/usr/src/sys/dev/usb/net/usb_ethernet.h

the last update for which is:


r351244 | stevek | 2019-08-19 18:06:43 -0700 (Mon, 19 Aug 2019) | 18 lines

usb_ethernet.h includes a number of mii headers, but only does so in
order to have struct mii_data available. However, it only really needs
a forward declaration of struct mii_data for use in pointer form for
the return type of a function prototype.

Custom kernel configuration that have usb and fdt enabled, but no miibus,
end up with compilation failures because miibus_if.h will not get
generated.

Due to the above, the following changes have been made to usb_ethernet.h:
 * remove the inclusion of mii headers
 * forward-declare struct mii_data
 * include net/ifq.h to satify the need for complete struct ifqueue

Reviewed by:ian
Obtained from:  Juniper Networks, Inc.
Differential Revision:  https://reviews.freebsd.org/D21293



(and, given the context, seems likely related to the observed issue).

I have attached a Meta data file.

Peace,
david
-- 
David H. Wolfskill  da...@catwhisker.org
What, exactly, is the contribution of "health insurance" to health care?

See http://www.catwhisker.org/~david/publickey.gpg for my public key.
# Meta data file 
/common/S4/obj/usr/src/amd64.amd64/sys/GENERIC/modules/usr/src/sys/modules/usb/aue/if_aue.o.meta
CMD cc -target x86_64-unknown-freebsd13.0 
--sysroot=/common/S4/obj/usr/src/amd64.amd64/tmp 
-B/common/S4/obj/usr/src/amd64.amd64/tmp/usr/bin  -O2 -pipe  
-fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -DKLD_TIED -nostdinc   
-DHAVE_KERNEL_OPTION_HEADERS -include 
/common/S4/obj/usr/src/amd64.amd64/sys/GENERIC/opt_global.h -I. -I/usr/src/sys 
-I/usr/src/sys/contrib/ck/include -fno-common -g -fno-omit-frame-pointer 
-mno-omit-leaf-frame-pointer 
-fdebug-prefix-map=./machine=/usr/src/sys/amd64/include 
-fdebug-prefix-map=./x86=/usr/src/sys/x86/include 
-I/common/S4/obj/usr/src/amd64.amd64/sys/GENERIC -mcmodel=kernel 
-mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables 
-ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls 
-Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ 
-Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas 
-Wno-error-tautological-compare -Wno-error-empty-body 
-Wno-error-parentheses-equality -Wno-error-unused-function 
-Wno-error-pointer-sign -Wno-error-shift-negative-value 
-Wno-address-of-packed-member -Wno-format-zero-length  -mno-aes -mno-avx  
-std=iso9899:1999 -c /usr/src/sys/dev/usb/net/if_aue.c -o if_aue.o
CMD ctfconvert -L VERSION -g if_aue.o
CWD 
/common/S4/obj/usr/src/amd64.amd64/sys/GENERIC/modules/usr/src/sys/modules/usb/aue
TARGET if_aue.o
-- command output --
/usr/src/sys/dev/usb/net/if_aue.c:197:8: error: unknown type name 
'miibus_readreg_t'
static miibus_readreg_t aue_miibus_readreg;
   ^
/usr/src/sys/dev/usb/net/if_aue.c:198:8: error: unknown type name 
'miibus_writereg_t'
static miibus_writereg_t aue_miibus_writereg;
   ^
/usr/src/sys/dev/usb/net/if_aue.c:199:8: error: unknown type name 
'miibus_statchg_t'
static miibus_statchg_t aue_miibus_statchg;
   ^
/usr/src/sys/dev/usb/net/if_aue.c:262:2: error: use of undeclared identifier 
'miibus_readreg_desc'
DEVMETHOD(miibus_readreg, aue_miibus_readreg),
^
/usr/src/sys/sys/bus.h:751:19: note: expanded from macro 'DEVMETHOD'
#define DEVMETHOD   KOBJMETHOD
^
/usr/src/sys/sys/kobj.h:100:5: note: expanded from macro 'KOBJMETHOD'
{ &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
   ^
:176:1: note: expanded from here
miibus_readreg_desc
^
/usr/src/sys/dev/usb/net/if_aue.c:262:2: error: expected expression
/usr/src/sys/sys/bus.h:751:19: note: expanded from macro 'DEVMETHOD'
#define DEVMETHOD   KOBJMETHOD
^
/usr/src/sys/sys/kobj.h:100:52: note: expanded from macro 'KOBJMETHOD'
{ &NAME##_desc, (kobjop_t) (1 ? FUNC : (NAME##_t *)NULL) }
  ^
/usr/src/sys/dev/usb/net/if_aue.c:262:2: error: use of undeclared identifier 
'miibus_readreg_t'
/usr/src/sys/sys/bus.h:751:19: note: expanded from macro 'DEVMETHOD'
#define DEVMETHOD   KOBJMETHOD
^
/usr/src/sys/sys/kobj.h

r351247: buildkernel failure: error: use of undeclared identifier 'miibus_statchg_XXXX

2019-08-20 Thread O. Hartmann
Recent CURRENT (r351247) fails to buildkernel due to a compilation error,
pointing to an mii issue.

For almost every mii-related if_ the compiler drops an error like:

[...]
Building
/usr/obj/usr/src/amd64.amd64/sys/WOTAN/modules/usr/src/sys/modules/usb/udl/udl.ko
===> usb/uether (all) Building
/usr/obj/usr/src/amd64.amd64/sys/WOTAN/modules/usr/src/sys/modules/usb/uether/uether.ko
===> usb/aue (all) Building
/usr/obj/usr/src/amd64.amd64/sys/WOTAN/modules/usr/src/sys/modules/usb/aue/if_aue.o
/usr/src/sys/dev/usb/net/if_aue.c:197:8: error: unknown type name
'miibus_readreg_t' static miibus_readreg_t aue_miibus_readreg; ^
/usr/src/sys/dev/usb/net/if_aue.c:198:8: error: unknown type name
'miibus_writereg_t' static miibus_writereg_t aue_miibus_writereg;
   ^
/usr/src/sys/dev/usb/net/if_aue.c:199:8: error: unknown type name
'miibus_statchg_t' static miibus_statchg_t aue_miibus_statchg;
   ^
/usr/src/sys/dev/usb/net/if_aue.c:262:2: error: use of undeclared identifier
'miibus_readreg_desc' DEVMETHOD(miibus_readreg, aue_miibus_readreg),
^
/usr/src/sys/sys/bus.h:751:19: note: expanded from macro 'DEVMETHOD'
#define DEVMETHOD   KOBJMETHOD
[...]


Seems the subfolder for USB NICs is missing something?

Kind regards,

oh


___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"