Dwarves Archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>, Hao Luo <haoluo@google.com>,
	dwarves@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>
Subject: Re: btf_encoder: error: found variable in CU that has void type
Date: Mon, 26 Oct 2020 14:42:00 -0700	[thread overview]
Message-ID: <CAEf4BzYvSNHbdAm=9SNsuOM1wgQtg5v9rz24PjyGWr-8QOkbjQ@mail.gmail.com> (raw)
In-Reply-To: <20201026202239.GF2449445@kernel.org>

On Mon, Oct 26, 2020 at 1:22 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> Em Mon, Oct 26, 2020 at 05:10:06PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Now with a correct subject :-)
> >
> > Em Mon, Oct 26, 2020 at 04:58:30PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > Hi guys,
> > >
> > >     I just stumbled on this, investigating... This is with what is
> > > in the tmp branch at
> > > git://git.kernel.org/pub/scm/devel/pahole/pahole.git.
> > >
> > > error: found variable in CU '/home/acme/git/linux/security/selinux/hooks.c' that has void type
> > > Encountered error while encoding BTF.
> > >   LD      .tmp_vmlinux.kallsyms1
> > >   KSYMS   .tmp_vmlinux.kallsyms1.S
> > >   AS      .tmp_vmlinux.kallsyms1.S
> > >   LD      .tmp_vmlinux.kallsyms2
> > >   KSYMS   .tmp_vmlinux.kallsyms2.S
> > >   AS      .tmp_vmlinux.kallsyms2.S
> > >   LD      vmlinux
> > >   BTFIDS  vmlinux
> > > FAILED: load BTF from vmlinux: Unknown error -2make[1]: *** [/home/acme/git/linux/Makefile:1164: vmlinux] Error 255
> > > make[1]: Leaving directory '/home/acme/git/build/v5.10.0-rc1+'
> > > make: *** [Makefile:185: __sub-make] Error 2
> >
> > It is something recent:
> >
> > c815d26689313d8d7 (Hao Luo                  2020-08-24 17:45:23 -0700 440)              if (var->ip.tag.type == 0) {
> > 2e719cca667212840 (Andrii Nakryiko          2020-10-08 16:39:57 -0700 441)                      fprintf(stderr, "error: found variable in CU '%s' that has void type\n",
> > 2e719cca667212840 (Andrii Nakryiko          2020-10-08 16:39:57 -0700 442)                              cu->name);
> > f3d9054ba8ff1df0f (Hao Luo                  2020-07-08 13:44:10 -0700 443)                      if (force)
> > f3d9054ba8ff1df0f (Hao Luo                  2020-07-08 13:44:10 -0700 444)                              continue;
> > f3d9054ba8ff1df0f (Hao Luo                  2020-07-08 13:44:10 -0700 445)                      err = -1;
> > f3d9054ba8ff1df0f (Hao Luo                  2020-07-08 13:44:10 -0700 446)                      break;
>
> Printing the variable name and address gives:
>
>   LD      .tmp_vmlinux.btf
>   BTF     .btf.vmlinux.bin.o
> error: found variable "(null)" (addr: 0xffffffff82f4e260) in CU '/home/acme/git/linux/security/selinux/hooks.c' that has void type
> Encountered error while encoding BTF.
>
> Unsure if this is related:
>
> [root@five ~]# gcc --version | head -1
> gcc (GCC) 10.2.1 20200723 (Red Hat 10.2.1-1)
> [root@five ~]#
>
> [acme@five linux]$ readelf -sw ../build/v5.9.0+/vmlinux | grep ffffffff82f4e260
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
> readelf: ../build/v5.9.0+/vmlinux: Error: LEB value too large
>
> <SNIP lots more such lines>
>

Don't know what this is, but what Hao proposed (to check everything
only after we make sure that the variable has a proper per-CPU symbol
in ELF) would eliminate all that, so I think we should do just that.

But I'm surprised I didn't see any of those issues in my kernel
configurations and environment (though I use GCC 8, still, so that
might explain).


> - Arnaldo

      reply	other threads:[~2020-10-26 21:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 20:10 btf_encoder: error: found variable in CU that has void type Arnaldo Carvalho de Melo
2020-10-26 20:22 ` Arnaldo Carvalho de Melo
2020-10-26 21:42   ` Andrii Nakryiko [this message]

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='CAEf4BzYvSNHbdAm=9SNsuOM1wgQtg5v9rz24PjyGWr-8QOkbjQ@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=acme@kernel.org \
    --cc=andrii@kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=haoluo@google.com \
    --cc=jolsa@kernel.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).