From: Jiri Olsa <jolsa@redhat.com>
To: Veronika Kabatova <vkabatov@redhat.com>,
Andrii Nakryiko <andriin@fb.com>,
Alexei Starovoitov <ast@kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: bpf <bpf@vger.kernel.org>
Subject: Re: Build failures: unresolved symbol vfs_getattr
Date: Mon, 14 Sep 2020 20:25:13 +0200 [thread overview]
Message-ID: <20200914182513.GK1714160@krava> (raw)
In-Reply-To: <748495289.11017858.1600094916732.JavaMail.zimbra@redhat.com>
On Mon, Sep 14, 2020 at 10:48:36AM -0400, Veronika Kabatova wrote:
>
> Hello,
>
> we tested the bpf-next tree with CKI and ran across build failures. The
> important part of the build log is:
>
> 00:18:05 GEN .version
> 00:18:05 CHK include/generated/compile.h
> 00:18:05 LD vmlinux.o
> 00:18:27 MODPOST vmlinux.symvers
> 00:18:27 MODINFO modules.builtin.modinfo
> 00:18:27 GEN modules.builtin
> 00:18:27 LD .tmp_vmlinux.btf
> 00:18:42 BTF .btf.vmlinux.bin.o
> 00:19:13 LD .tmp_vmlinux.kallsyms1
> 00:19:19 KSYM .tmp_vmlinux.kallsyms1.o
> 00:19:22 LD .tmp_vmlinux.kallsyms2
> 00:19:25 KSYM .tmp_vmlinux.kallsyms2.o
> 00:19:28 LD vmlinux
> 00:19:40 BTFIDS vmlinux
> 00:19:40 FAILED unresolved symbol vfs_getattr
> 00:19:40 make[2]: *** [Makefile:1167: vmlinux] Error 255
> 00:19:40 make[1]: *** [scripts/Makefile.package:109: targz-pkg] Error 2
> 00:19:40 make: *** [Makefile:1528: targz-pkg] Error 2
hi,
it looks like broken BTF data to me, I checked that build
and found we have multiple records for functions, like
for filp_close:
[23381] FUNC_PROTO '(anon)' ret_type_id=19 vlen=2
'(anon)' type_id=464
'id' type_id=960
[23382] FUNC 'filp_close' type_id=23381 linkage=static
[33073] FUNC_PROTO '(anon)' ret_type_id=19 vlen=2
'filp' type_id=464
'id' type_id=960
[33074] FUNC 'filp_close' type_id=33073 linkage=static
or vfs_getattr:
[33513] FUNC_PROTO '(anon)' ret_type_id=19 vlen=4
'path' type_id=741
'stat' type_id=1095
'request_mask' type_id=29
'query_flags' type_id=8
[33514] FUNC 'vfs_getattr' type_id=33513 linkage=static
[1094] FUNC_PROTO '(anon)' ret_type_id=19 vlen=4
'(anon)' type_id=741
'(anon)' type_id=1095
'(anon)' type_id=29
'(anon)' type_id=8
[35099] FUNC 'vfs_getattr' type_id=1094 linkage=static
and because we go through all BTF data until we resolve all we have,
the doubled funcs will screw our internal counter and we skip a function
the change below will workaround that, but I think we should fail in
this case.. if I'm not missing something 2 FUNC records for one function
in BTF data
$ pahole --version
v1.17
HEAD is 2bab48c5b Merge branch 'improve-bpf-tcp-cc-init'
thoughts? thanks
jirka
---
diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c
index dfa540d8a02d..a33e56553e52 100644
--- a/tools/bpf/resolve_btfids/main.c
+++ b/tools/bpf/resolve_btfids/main.c
@@ -525,7 +525,7 @@ static int symbols_resolve(struct object *obj)
}
id = btf_id__find(root, str);
- if (id) {
+ if (id && !id->id) {
id->id = type_id;
(*nr)--;
}
next prev parent reply other threads:[~2020-09-14 18:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1723352278.11013122.1600093319730.JavaMail.zimbra@redhat.com>
2020-09-14 14:48 ` Build failures: unresolved symbol vfs_getattr Veronika Kabatova
2020-09-14 18:25 ` Jiri Olsa [this message]
2020-09-14 22:26 ` Andrii Nakryiko
2020-09-15 7:30 ` Jiri Olsa
2020-09-15 12:17 ` Jiri Olsa
2020-09-16 9:06 ` Jiri Olsa
2020-10-16 21:38 ` Jiri Olsa
2020-10-21 19:42 ` Jiri Olsa
2020-10-22 20:00 ` Andrii Nakryiko
2020-10-23 5:36 ` Jiri Olsa
2020-10-23 6:58 ` Jiri Olsa
2020-10-23 18:22 ` Andrii Nakryiko
2020-10-23 20:17 ` Jiri Olsa
2020-10-23 20:32 ` Andrii Nakryiko
2020-10-23 20:45 ` Jiri Olsa
2020-10-23 22:02 ` Andrii Nakryiko
2020-10-26 10:14 ` Jiri Olsa
2020-10-26 22:06 ` Andrii Nakryiko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200914182513.GK1714160@krava \
--to=jolsa@redhat.com \
--cc=acme@redhat.com \
--cc=andriin@fb.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=vkabatov@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).