selftests/bpf: test_maps: libbpf: Error loading .BTF into kernel: -22. Failed to load SK_SKB verdict prog
Subsystems (4)
test_maps fails consistently on x86-64 5.4.y (5.4.31 and defconfig + tools/testing/selftests/bpf/config in this case) and dumps this output:
~/linux/tools/testing/selftests/bpf$ sudo ./test_maps
libbpf: Error loading BTF: Invalid argument(22)
libbpf: magic: 0xeb9f
version: 1
flags: 0x0hdr_len: 24type_off: 0type_len: 780str_off: 780str_len: 854btf_total_size: 1658
[1] PTR (anon) type_id=2
[2] STRUCT __sk_buff size=176 vlen=31
len type_id=3 bits_offset=0 pkt_type type_id=3 bits_offset=32 mark type_id=3 bits_offset=64 queue_mapping type_id=3 bits_offset=96 protocol type_id=3 bits_offset=128 vlan_present type_id=3 bits_offset=160 vlan_tci type_id=3 bits_offset=192 vlan_proto type_id=3 bits_offset=224 priority type_id=3 bits_offset=256 ingress_ifindex type_id=3 bits_offset=288 ifindex type_id=3 bits_offset=320 tc_index type_id=3 bits_offset=352 cb type_id=5 bits_offset=384 hash type_id=3 bits_offset=544 tc_classid type_id=3 bits_offset=576 data type_id=3 bits_offset=608 data_end type_id=3 bits_offset=640 napi_id type_id=3 bits_offset=672 family type_id=3 bits_offset=704 remote_ip4 type_id=3 bits_offset=736 local_ip4 type_id=3 bits_offset=768 remote_ip6 type_id=7 bits_offset=800 local_ip6 type_id=7 bits_offset=928 remote_port type_id=3 bits_offset=1056 local_port type_id=3 bits_offset=1088 data_meta type_id=3 bits_offset=1120 (anon) type_id=8 bits_offset=1152 tstamp type_id=10 bits_offset=1216 wire_len type_id=3 bits_offset=1280 gso_segs type_id=3 bits_offset=1312 (anon) type_id=12 bits_offset=1344
[3] TYPEDEF __u32 type_id=4
[4] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none)
[5] ARRAY (anon) type_id=3 index_type_id=6 nr_elems=5
[6] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none)
[7] ARRAY (anon) type_id=3 index_type_id=6 nr_elems=4
[8] UNION (anon) size=8 vlen=1
flow_keys type_id=9 bits_offset=0
[9] PTR (anon) type_id=23
[10] TYPEDEF __u64 type_id=11
[11] INT long long unsigned int size=8 bits_offset=0 nr_bits=64 encoding=(none)
[12] UNION (anon) size=8 vlen=1
sk type_id=13 bits_offset=0
[13] PTR (anon) type_id=24
[14] FUNC_PROTO (anon) return=15 args=(1 skb)
[15] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
[16] FUNC bpf_prog1 type_id=14 vlen != 0
libbpf: Error loading .BTF into kernel: -22.
libbpf: Error loading BTF: Invalid argument(22)
libbpf: magic: 0xeb9f
version: 1
flags: 0x0hdr_len: 24type_off: 0type_len: 440str_off: 440str_len: 564btf_total_size: 1028
[1] PTR (anon) type_id=2
[2] STRUCT sk_msg_md size=72 vlen=10
(anon) type_id=3 bits_offset=0 (anon) type_id=5 bits_offset=64 family type_id=6 bits_offset=128 remote_ip4 type_id=6 bits_offset=160 local_ip4 type_id=6 bits_offset=192 remote_ip6 type_id=8 bits_offset=224 local_ip6 type_id=8 bits_offset=352 remote_port type_id=6 bits_offset=480 local_port type_id=6 bits_offset=512 size type_id=6 bits_offset=544
[3] UNION (anon) size=8 vlen=1
data type_id=4 bits_offset=0
[4] PTR (anon) type_id=0
[5] UNION (anon) size=8 vlen=1
data_end type_id=4 bits_offset=0
[6] TYPEDEF __u32 type_id=7
[7] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none)
[8] ARRAY (anon) type_id=6 index_type_id=9 nr_elems=4
[9] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none)
[10] FUNC_PROTO (anon) return=11 args=(1 msg)
[11] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
[12] FUNC bpf_prog1 type_id=10 vlen != 0
libbpf: Error loading .BTF into kernel: -22.
libbpf: Error loading BTF: Invalid argument(22)
libbpf: magic: 0xeb9f
version: 1
flags: 0x0hdr_len: 24type_off: 0type_len: 1300str_off: 1300str_len: 907btf_total_size: 2231
[1] STRUCT (anon) size=32 vlen=4
type type_id=2 bits_offset=0
max_entries type_id=6 bits_offset=64
key_size type_id=8 bits_offset=128
value_size type_id=8 bits_offset=192
[2] PTR (anon) type_id=4
[3] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
[4] ARRAY (anon) type_id=3 index_type_id=5 nr_elems=15
[5] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none)
[6] PTR (anon) type_id=7
[7] ARRAY (anon) type_id=3 index_type_id=5 nr_elems=20
[8] PTR (anon) type_id=9
[9] ARRAY (anon) type_id=3 index_type_id=5 nr_elems=4
[10] VAR sock_map_rx type_id=1 linkage=1
[11] STRUCT (anon) size=32 vlen=4
type type_id=2 bits_offset=0
max_entries type_id=6 bits_offset=64
key_size type_id=8 bits_offset=128
value_size type_id=8 bits_offset=192
[12] VAR sock_map_tx type_id=11 linkage=1
[13] STRUCT (anon) size=32 vlen=4
type type_id=2 bits_offset=0
max_entries type_id=6 bits_offset=64
key_size type_id=8 bits_offset=128
value_size type_id=8 bits_offset=192
[14] VAR sock_map_msg type_id=13 linkage=1
[15] STRUCT (anon) size=32 vlen=4
type type_id=16 bits_offset=0 max_entries type_id=6 bits_offset=64 key type_id=18 bits_offset=128 value type_id=18 bits_offset=192
[16] PTR (anon) type_id=17
[17] ARRAY (anon) type_id=3 index_type_id=5 nr_elems=2
[18] PTR (anon) type_id=3
[19] VAR sock_map_break type_id=15 linkage=1
[20] PTR (anon) type_id=21
[21] STRUCT __sk_buff size=176 vlen=31
len type_id=22 bits_offset=0 pkt_type type_id=22 bits_offset=32 mark type_id=22 bits_offset=64 queue_mapping type_id=22 bits_offset=96 protocol type_id=22 bits_offset=128 vlan_present type_id=22 bits_offset=160 vlan_tci type_id=22 bits_offset=192 vlan_proto type_id=22 bits_offset=224 priority type_id=22 bits_offset=256 ingress_ifindex type_id=22 bits_offset=288 ifindex type_id=22 bits_offset=320 tc_index type_id=22 bits_offset=352 cb type_id=24 bits_offset=384 hash type_id=22 bits_offset=544 tc_classid type_id=22 bits_offset=576 data type_id=22 bits_offset=608 data_end type_id=22 bits_offset=640 napi_id type_id=22 bits_offset=672 family type_id=22 bits_offset=704 remote_ip4 type_id=22 bits_offset=736 local_ip4 type_id=22 bits_offset=768 remote_ip6 type_id=25 bits_offset=800 local_ip6 type_id=25 bits_offset=928 remote_port type_id=22 bits_offset=1056 local_port type_id=22 bits_offset=1088 data_meta type_id=22 bits_offset=1120 (anon) type_id=26 bits_offset=1152 tstamp type_id=28 bits_offset=1216 wire_len type_id=22 bits_offset=1280 gso_segs type_id=22 bits_offset=1312 (anon) type_id=30 bits_offset=1344
[22] TYPEDEF __u32 type_id=23
[23] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none)
[24] ARRAY (anon) type_id=22 index_type_id=5 nr_elems=5
[25] ARRAY (anon) type_id=22 index_type_id=5 nr_elems=4
[26] UNION (anon) size=8 vlen=1
flow_keys type_id=27 bits_offset=0
[27] PTR (anon) type_id=41
[28] TYPEDEF __u64 type_id=29
[29] INT long long unsigned int size=8 bits_offset=0 nr_bits=64 encoding=(none)
[30] UNION (anon) size=8 vlen=1
sk type_id=31 bits_offset=0
[31] PTR (anon) type_id=42
[32] FUNC_PROTO (anon) return=3 args=(20 skb)
[33] FUNC bpf_prog2 type_id=32 vlen != 0
libbpf: Error loading .BTF into kernel: -22.
Failed to load SK_SKB verdict prog
~/linux/tools/testing/selftests/bpf$ find . -name sockmap_\*prog.o ./sockmap_verdict_prog.o
./sockmap_tcp_msg_prog.o./alu32/sockmap_verdict_prog.o ./alu32/sockmap_tcp_msg_prog.o ./alu32/sockmap_parse_prog.o
./sockmap_parse_prog.o
$ dpkg -l | grep clang ii clang 1:10.0-50~exp1 amd64 C, C++ and Objective-C compiler (LLVM based) ii clang-10 1:10.0.0-2ubuntu2 amd64 C, C++ and Objective-C compiler ii libclang-common-10-dev 1:10.0.0-2ubuntu2 amd64 Clang library - Common development package ii libclang-cpp10 1:10.0.0-2ubuntu2 amd64 C++ interface to the Clang library ii libclang1-10 1:10.0.0-2ubuntu2 amd64 C interface to the Clang library
Full log of "TARGETS=bpf run_tests" is available here: https://paste.ubuntu.com/p/MTkWD63Zgc/
Signature · 2 lines
bye, p.
Quoted 10 lines · Paolo Pisati
test_mapsfails consistently on x86-64 5.4.y (5.4.31 and defconfig +tools/testing/selftests/bpf/configin this case) and dumps this output:~/linux/tools/testing/selftests/bpf$ sudo ./test_maps
libbpf: Error loading BTF: Invalid argument(22)
libbpf: magic:0xeb9f
libbpf: Error loading .BTF into kernel: -22.
libbpf: Error loading BTF: Invalid argument(22)
libbpf: magic:0xeb9f
Quoted 2 lines
libbpf: Error loading .BTF into kernel: -22.
Failed to loadSK_SKBverdict prog
I've been trying to reproduce on the latest bpf tree and couldn't. Does it reproduce for you on the latest?