2023-06-28 12:09:11

by Michal Kubecek

[permalink] [raw]
Subject: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

Hello,

this morning, mainline kernel builds started to fail on my desktop like
this:

mike@lion:~/work/git/kernel-upstream> mkdir /srv/ram/kobj
mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj defconfig >/dev/null
mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj all >/dev/null
net/ipv4/netfilter/iptable_nat.o: warning: objtool: mmap fail reloc
net/netfilter/xt_mark.o: warning: objtool: mmap fail reloc
net/netfilter/xt_nat.o: warning: objtool: mmap fail reloc
net/netfilter/xt_LOG.o: warning: objtool: mmap fail reloc
net/netfilter/xt_MASQUERADE.o: warning: objtool: mmap fail reloc
net/netfilter/nf_log_syslog.o: warning: objtool: mmap fail reloc
net/netfilter/xt_addrtype.o: warning: objtool: mmap fail reloc
fs/efivarfs/efivarfs.o: warning: objtool: mmap fail reloc
drivers/thermal/intel/x86_pkg_temp_thermal.o: warning: objtool: mmap fail reloc
vmlinux.o: warning: objtool: mmap fail reloc
incomplete ORC unwind tables in file: vmlinux
Failed to sort kernel tables
make[2]: *** [/home/mike/work/git/kernel-upstream/scripts/Makefile.vmlinux:35: vmlinux] Error 1
make[2]: *** Deleting file 'vmlinux'
make[1]: *** [/home/mike/work/git/kernel-upstream/Makefile:1256: vmlinux] Error 2
make: *** [Makefile:226: __sub-make] Error 2

I bisected the failure to commit

eb0481bbc4ce ("objtool: Fix reloc_hash size")

I also tried gcc11 and building on a normal filesystem (rather than
tmpfs) but the result is still the same. Different configurations (e.g.
allmodconfig) only show more modules with "mmap fail reloc". The machine
has 64 GB of RAM and both ulimit -m and ulimit -v show "unlimited".
Anything idea what else I should try?

Michal Kubecek


Attachments:
(No filename) (1.73 kB)
signature.asc (499.00 B)
Download all attachments

2023-06-28 15:49:25

by Josh Poimboeuf

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Wed, Jun 28, 2023 at 01:58:25PM +0200, Michal Kubecek wrote:
> Hello,
>
> this morning, mainline kernel builds started to fail on my desktop like
> this:
>
> mike@lion:~/work/git/kernel-upstream> mkdir /srv/ram/kobj
> mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj defconfig >/dev/null
> mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj all >/dev/null
> net/ipv4/netfilter/iptable_nat.o: warning: objtool: mmap fail reloc
> net/netfilter/xt_mark.o: warning: objtool: mmap fail reloc
> net/netfilter/xt_nat.o: warning: objtool: mmap fail reloc
> net/netfilter/xt_LOG.o: warning: objtool: mmap fail reloc
> net/netfilter/xt_MASQUERADE.o: warning: objtool: mmap fail reloc
> net/netfilter/nf_log_syslog.o: warning: objtool: mmap fail reloc
> net/netfilter/xt_addrtype.o: warning: objtool: mmap fail reloc
> fs/efivarfs/efivarfs.o: warning: objtool: mmap fail reloc
> drivers/thermal/intel/x86_pkg_temp_thermal.o: warning: objtool: mmap fail reloc
> vmlinux.o: warning: objtool: mmap fail reloc
> incomplete ORC unwind tables in file: vmlinux
> Failed to sort kernel tables
> make[2]: *** [/home/mike/work/git/kernel-upstream/scripts/Makefile.vmlinux:35: vmlinux] Error 1
> make[2]: *** Deleting file 'vmlinux'
> make[1]: *** [/home/mike/work/git/kernel-upstream/Makefile:1256: vmlinux] Error 2
> make: *** [Makefile:226: __sub-make] Error 2
>
> I bisected the failure to commit
>
> eb0481bbc4ce ("objtool: Fix reloc_hash size")
>
> I also tried gcc11 and building on a normal filesystem (rather than
> tmpfs) but the result is still the same. Different configurations (e.g.
> allmodconfig) only show more modules with "mmap fail reloc". The machine
> has 64 GB of RAM and both ulimit -m and ulimit -v show "unlimited".
> Anything idea what else I should try?
>
> Michal Kubecek

Interesting. Can you add the below patch and also do:

make net/ipv4/netfilter/iptable_nat.o OBJTOOL_ARGS="--stats"

and report the output?

---8<---

diff --git a/tools/objtool/elf.c b/tools/objtool/elf.c
index d420b5d2e2b6..4d5559ab4668 100644
--- a/tools/objtool/elf.c
+++ b/tools/objtool/elf.c
@@ -81,7 +81,7 @@ static inline void __elf_hash_del(struct elf_hash_node *node,
PROT_READ|PROT_WRITE, \
MAP_PRIVATE|MAP_ANON, -1, 0); \
if (__elf_table(name) == (void *)-1L) { \
- WARN("mmap fail " #name); \
+ perror("mmap " #name); \
__elf_table(name) = NULL; \
} \
__elf_table(name); \

2023-06-28 15:54:26

by Michal Kubecek

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Wed, Jun 28, 2023 at 08:16:54AM -0700, Josh Poimboeuf wrote:
> Interesting. Can you add the below patch and also do:
>
> make net/ipv4/netfilter/iptable_nat.o OBJTOOL_ARGS="--stats"
>
> and report the output?

With these, I get

...
CC [M] net/ipv4/netfilter/iptable_nat.o
nr_sections: 40
section_bits: 10
nr_symbols: 41
symbol_bits: 10
mmap reloc: Invalid argument
make[1]: Leaving directory '/srv/ram/kobj'

Michal


2023-06-28 16:33:23

by Michal Kubecek

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Wed, Jun 28, 2023 at 05:44:32PM +0200, Michal Kubecek wrote:
> On Wed, Jun 28, 2023 at 08:16:54AM -0700, Josh Poimboeuf wrote:
> > Interesting. Can you add the below patch and also do:
> >
> > make net/ipv4/netfilter/iptable_nat.o OBJTOOL_ARGS="--stats"
> >
> > and report the output?
>
> With these, I get
>
> ...
> CC [M] net/ipv4/netfilter/iptable_nat.o
> nr_sections: 40
> section_bits: 10
> nr_symbols: 41
> symbol_bits: 10
> mmap reloc: Invalid argument
> make[1]: Leaving directory '/srv/ram/kobj'

Not sure if it's of any use but I also tried to run it under strace and
the failed mmap() call seems to be

18761 mmap(NULL, 0, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EINVAL (Invalid argument)

Perhaps the problem could be that elf->num_relocs may be zero?

Michal

2023-06-28 17:04:27

by Michal Kubecek

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Wed, Jun 28, 2023 at 06:06:31PM +0200, Michal Kubecek wrote:
> On Wed, Jun 28, 2023 at 05:44:32PM +0200, Michal Kubecek wrote:
> > On Wed, Jun 28, 2023 at 08:16:54AM -0700, Josh Poimboeuf wrote:
> > > Interesting. Can you add the below patch and also do:
> > >
> > > make net/ipv4/netfilter/iptable_nat.o OBJTOOL_ARGS="--stats"
> > >
> > > and report the output?
> >
> > With these, I get
> >
> > ...
> > CC [M] net/ipv4/netfilter/iptable_nat.o
> > nr_sections: 40
> > section_bits: 10
> > nr_symbols: 41
> > symbol_bits: 10
> > mmap reloc: Invalid argument
> > make[1]: Leaving directory '/srv/ram/kobj'
>
> Not sure if it's of any use but I also tried to run it under strace and
> the failed mmap() call seems to be
>
> 18761 mmap(NULL, 0, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EINVAL (Invalid argument)
>
> Perhaps the problem could be that elf->num_relocs may be zero?

I added a printf() and got

size = -4991471925827290382 = 0xbababababababaf2

for the elf_alloc_hash() invocation resulting in failed mmap().

Michal

2023-06-28 17:15:10

by Josh Poimboeuf

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Wed, Jun 28, 2023 at 06:45:54PM +0200, Michal Kubecek wrote:
> On Wed, Jun 28, 2023 at 06:06:31PM +0200, Michal Kubecek wrote:
> > On Wed, Jun 28, 2023 at 05:44:32PM +0200, Michal Kubecek wrote:
> > > On Wed, Jun 28, 2023 at 08:16:54AM -0700, Josh Poimboeuf wrote:
> > > > Interesting. Can you add the below patch and also do:
> > > >
> > > > make net/ipv4/netfilter/iptable_nat.o OBJTOOL_ARGS="--stats"
> > > >
> > > > and report the output?
> > >
> > > With these, I get
> > >
> > > ...
> > > CC [M] net/ipv4/netfilter/iptable_nat.o
> > > nr_sections: 40
> > > section_bits: 10
> > > nr_symbols: 41
> > > symbol_bits: 10
> > > mmap reloc: Invalid argument
> > > make[1]: Leaving directory '/srv/ram/kobj'
> >
> > Not sure if it's of any use but I also tried to run it under strace and
> > the failed mmap() call seems to be
> >
> > 18761 mmap(NULL, 0, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EINVAL (Invalid argument)
> >
> > Perhaps the problem could be that elf->num_relocs may be zero?
>
> I added a printf() and got
>
> size = -4991471925827290382 = 0xbababababababaf2
>
> for the elf_alloc_hash() invocation resulting in failed mmap().

Wut. Can you share the .o file?

--
Josh

2023-06-28 17:37:41

by Michal Kubecek

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Wed, Jun 28, 2023 at 10:05:30AM -0700, Josh Poimboeuf wrote:
> On Wed, Jun 28, 2023 at 06:45:54PM +0200, Michal Kubecek wrote:
> > On Wed, Jun 28, 2023 at 06:06:31PM +0200, Michal Kubecek wrote:
> > > On Wed, Jun 28, 2023 at 05:44:32PM +0200, Michal Kubecek wrote:
> > > > On Wed, Jun 28, 2023 at 08:16:54AM -0700, Josh Poimboeuf wrote:
> > > > > Interesting. Can you add the below patch and also do:
> > > > >
> > > > > make net/ipv4/netfilter/iptable_nat.o OBJTOOL_ARGS="--stats"
> > > > >
> > > > > and report the output?
> > > >
> > > > With these, I get
> > > >
> > > > ...
> > > > CC [M] net/ipv4/netfilter/iptable_nat.o
> > > > nr_sections: 40
> > > > section_bits: 10
> > > > nr_symbols: 41
> > > > symbol_bits: 10
> > > > mmap reloc: Invalid argument
> > > > make[1]: Leaving directory '/srv/ram/kobj'
> > >
> > > Not sure if it's of any use but I also tried to run it under strace and
> > > the failed mmap() call seems to be
> > >
> > > 18761 mmap(NULL, 0, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = -1 EINVAL (Invalid argument)
> > >
> > > Perhaps the problem could be that elf->num_relocs may be zero?
> >
> > I added a printf() and got
> >
> > size = -4991471925827290382 = 0xbababababababaf2
> >
> > for the elf_alloc_hash() invocation resulting in failed mmap().
>
> Wut. Can you share the .o file?

It is at http://www.mk-sys.cz/tmp/iptable_nat.o

I digged some more and my guess is that the problem is that
elf_open_read() does

memset(elf, 0, offsetof(struct elf, sections));

but commit eb0481bbc4ce ("objtool: Fix reloc_hash size") added
num_relocs after sections so that it is not zeroed (0xbabababababababa
is probably some kind of poison).

So I tried

------------------------------------------------------------------------
--- a/tools/objtool/include/objtool/elf.h
+++ b/tools/objtool/include/objtool/elf.h
@@ -84,8 +84,8 @@ struct elf {
bool changed;
char *name;
unsigned int num_files;
- struct list_head sections;
unsigned long num_relocs;
+ struct list_head sections;

int symbol_bits;
int symbol_name_bits;
------------------------------------------------------------------------

and the build succeeds now. But I cannot say if it's enough.

Michal

2023-06-28 18:25:40

by Josh Poimboeuf

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Wed, Jun 28, 2023 at 07:26:59PM +0200, Michal Kubecek wrote:
> I digged some more and my guess is that the problem is that
> elf_open_read() does
>
> memset(elf, 0, offsetof(struct elf, sections));
>
> but commit eb0481bbc4ce ("objtool: Fix reloc_hash size") added
> num_relocs after sections so that it is not zeroed (0xbabababababababa
> is probably some kind of poison).

Argh, that memset() is subtle as heck. Peter, why?!?

--
Josh

2023-06-28 19:45:44

by Peter Zijlstra

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Wed, Jun 28, 2023 at 11:10:19AM -0700, Josh Poimboeuf wrote:
> On Wed, Jun 28, 2023 at 07:26:59PM +0200, Michal Kubecek wrote:
> > I digged some more and my guess is that the problem is that
> > elf_open_read() does
> >
> > memset(elf, 0, offsetof(struct elf, sections));
> >
> > but commit eb0481bbc4ce ("objtool: Fix reloc_hash size") added
> > num_relocs after sections so that it is not zeroed (0xbabababababababa
> > is probably some kind of poison).
>
> Argh, that memset() is subtle as heck. Peter, why?!?

Well, at the time struct elf had a bunch of fairly large hash tables
embedded inside it. memset() on those was a significant performance fail
-- esp. since we called objtool on every .o file.

struct elf {
Elf *elf;
GElf_Ehdr ehdr;
int fd;
char *name;
struct list_head sections;
DECLARE_HASHTABLE(symbol_hash, 20);
DECLARE_HASHTABLE(symbol_name_hash, 20);
DECLARE_HASHTABLE(section_hash, 16);
DECLARE_HASHTABLE(section_name_hash, 16);
DECLARE_HASHTABLE(rela_hash, 20);
};

Those embedded hash-tables have gone away, but apparently someone forgot
about this thing :/

Yes, this can go, struct elf is no longer like that.

2023-07-08 14:30:09

by Thorsten Leemhuis

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On 28.06.23 13:58, Michal Kubecek wrote:
>
> this morning, mainline kernel builds started to fail on my desktop like
> this:
>
> mike@lion:~/work/git/kernel-upstream> mkdir /srv/ram/kobj
> mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj defconfig >/dev/null
> mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj all >/dev/null
> net/ipv4/netfilter/iptable_nat.o: warning: objtool: mmap fail reloc
> net/netfilter/xt_mark.o: warning: objtool: mmap fail reloc
> net/netfilter/xt_nat.o: warning: objtool: mmap fail reloc
> net/netfilter/xt_LOG.o: warning: objtool: mmap fail reloc
> net/netfilter/xt_MASQUERADE.o: warning: objtool: mmap fail reloc
> net/netfilter/nf_log_syslog.o: warning: objtool: mmap fail reloc
> net/netfilter/xt_addrtype.o: warning: objtool: mmap fail reloc
> fs/efivarfs/efivarfs.o: warning: objtool: mmap fail reloc
> drivers/thermal/intel/x86_pkg_temp_thermal.o: warning: objtool: mmap fail reloc
> vmlinux.o: warning: objtool: mmap fail reloc
> incomplete ORC unwind tables in file: vmlinux
> Failed to sort kernel tables
> make[2]: *** [/home/mike/work/git/kernel-upstream/scripts/Makefile.vmlinux:35: vmlinux] Error 1
> make[2]: *** Deleting file 'vmlinux'
> make[1]: *** [/home/mike/work/git/kernel-upstream/Makefile:1256: vmlinux] Error 2
> make: *** [Makefile:226: __sub-make] Error 2
>
> I bisected the failure to commit
>
> eb0481bbc4ce ("objtool: Fix reloc_hash size")
>
> I also tried gcc11 and building on a normal filesystem (rather than
> tmpfs) but the result is still the same. Different configurations (e.g.
> allmodconfig) only show more modules with "mmap fail reloc". The machine
> has 64 GB of RAM and both ulimit -m and ulimit -v show "unlimited".
> Anything idea what else I should try?

Michal, thx for the report. Please correct me if I'm wrong: this as of
now is unfixed, as your patch to fix is afaics wasn't merged yet (at
least I can't see it even in next, but I might be missing something).

Hence adding it to the regression tracking now that the end of the merge
window is near:

#regzbot ^introduced eb0481bbc4ce
#regzbot title objtool: build failure
#regzbot monitor:
https://lore.kernel.org/all/[email protected]/
#regzbot fix: objtool: initialize all of struct elf
#regzbot ignore-activity

Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat)
--
Everything you wanna know about Linux kernel regression tracking:
https://linux-regtracking.leemhuis.info/about/#tldr
That page also explains what to do if mails like this annoy you.

2023-07-09 14:56:51

by Michal Kubecek

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Sat, Jul 08, 2023 at 03:40:50PM +0200, Linux regression tracking (Thorsten Leemhuis) wrote:
> On 28.06.23 13:58, Michal Kubecek wrote:
> >
> > this morning, mainline kernel builds started to fail on my desktop like
> > this:
> >
> > mike@lion:~/work/git/kernel-upstream> mkdir /srv/ram/kobj
> > mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj defconfig >/dev/null
> > mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj all >/dev/null
> > net/ipv4/netfilter/iptable_nat.o: warning: objtool: mmap fail reloc
> > net/netfilter/xt_mark.o: warning: objtool: mmap fail reloc
> > net/netfilter/xt_nat.o: warning: objtool: mmap fail reloc
> > net/netfilter/xt_LOG.o: warning: objtool: mmap fail reloc
> > net/netfilter/xt_MASQUERADE.o: warning: objtool: mmap fail reloc
> > net/netfilter/nf_log_syslog.o: warning: objtool: mmap fail reloc
> > net/netfilter/xt_addrtype.o: warning: objtool: mmap fail reloc
> > fs/efivarfs/efivarfs.o: warning: objtool: mmap fail reloc
> > drivers/thermal/intel/x86_pkg_temp_thermal.o: warning: objtool: mmap fail reloc
> > vmlinux.o: warning: objtool: mmap fail reloc
> > incomplete ORC unwind tables in file: vmlinux
> > Failed to sort kernel tables
> > make[2]: *** [/home/mike/work/git/kernel-upstream/scripts/Makefile.vmlinux:35: vmlinux] Error 1
> > make[2]: *** Deleting file 'vmlinux'
> > make[1]: *** [/home/mike/work/git/kernel-upstream/Makefile:1256: vmlinux] Error 2
> > make: *** [Makefile:226: __sub-make] Error 2
> >
> > I bisected the failure to commit
> >
> > eb0481bbc4ce ("objtool: Fix reloc_hash size")
> >
> > I also tried gcc11 and building on a normal filesystem (rather than
> > tmpfs) but the result is still the same. Different configurations (e.g.
> > allmodconfig) only show more modules with "mmap fail reloc". The machine
> > has 64 GB of RAM and both ulimit -m and ulimit -v show "unlimited".
> > Anything idea what else I should try?
>
> Michal, thx for the report. Please correct me if I'm wrong: this as of
> now is unfixed, as your patch to fix is afaics wasn't merged yet (at
> least I can't see it even in next, but I might be missing something).

Yes, the fix has not been merged yet and current master (commit
1c7873e33645) still shows the issue.

Michal

> Hence adding it to the regression tracking now that the end of the merge
> window is near:
>
> #regzbot ^introduced eb0481bbc4ce
> #regzbot title objtool: build failure
> #regzbot monitor:
> https://lore.kernel.org/all/[email protected]/
> #regzbot fix: objtool: initialize all of struct elf
> #regzbot ignore-activity


Attachments:
(No filename) (2.65 kB)
signature.asc (499.00 B)
Download all attachments

2023-07-10 17:43:21

by Josh Poimboeuf

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Sun, Jul 09, 2023 at 05:09:29PM +0300, Michal Kubecek wrote:
> On Sat, Jul 08, 2023 at 03:40:50PM +0200, Linux regression tracking (Thorsten Leemhuis) wrote:
> > On 28.06.23 13:58, Michal Kubecek wrote:
> > >
> > > this morning, mainline kernel builds started to fail on my desktop like
> > > this:
> > >
> > > mike@lion:~/work/git/kernel-upstream> mkdir /srv/ram/kobj
> > > mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj defconfig >/dev/null
> > > mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj all >/dev/null
> > > net/ipv4/netfilter/iptable_nat.o: warning: objtool: mmap fail reloc
> > > net/netfilter/xt_mark.o: warning: objtool: mmap fail reloc
> > > net/netfilter/xt_nat.o: warning: objtool: mmap fail reloc
> > > net/netfilter/xt_LOG.o: warning: objtool: mmap fail reloc
> > > net/netfilter/xt_MASQUERADE.o: warning: objtool: mmap fail reloc
> > > net/netfilter/nf_log_syslog.o: warning: objtool: mmap fail reloc
> > > net/netfilter/xt_addrtype.o: warning: objtool: mmap fail reloc
> > > fs/efivarfs/efivarfs.o: warning: objtool: mmap fail reloc
> > > drivers/thermal/intel/x86_pkg_temp_thermal.o: warning: objtool: mmap fail reloc
> > > vmlinux.o: warning: objtool: mmap fail reloc
> > > incomplete ORC unwind tables in file: vmlinux
> > > Failed to sort kernel tables
> > > make[2]: *** [/home/mike/work/git/kernel-upstream/scripts/Makefile.vmlinux:35: vmlinux] Error 1
> > > make[2]: *** Deleting file 'vmlinux'
> > > make[1]: *** [/home/mike/work/git/kernel-upstream/Makefile:1256: vmlinux] Error 2
> > > make: *** [Makefile:226: __sub-make] Error 2
> > >
> > > I bisected the failure to commit
> > >
> > > eb0481bbc4ce ("objtool: Fix reloc_hash size")
> > >
> > > I also tried gcc11 and building on a normal filesystem (rather than
> > > tmpfs) but the result is still the same. Different configurations (e.g.
> > > allmodconfig) only show more modules with "mmap fail reloc". The machine
> > > has 64 GB of RAM and both ulimit -m and ulimit -v show "unlimited".
> > > Anything idea what else I should try?
> >
> > Michal, thx for the report. Please correct me if I'm wrong: this as of
> > now is unfixed, as your patch to fix is afaics wasn't merged yet (at
> > least I can't see it even in next, but I might be missing something).
>
> Yes, the fix has not been merged yet and current master (commit
> 1c7873e33645) still shows the issue.

Should be fixed in the tip tree with the following patch:

https://lkml.kernel.org/lkml/168897683429.404.6801969953192508868.tip-bot2@tip-bot2


>
> Michal
>
> > Hence adding it to the regression tracking now that the end of the merge
> > window is near:
> >
> > #regzbot ^introduced eb0481bbc4ce
> > #regzbot title objtool: build failure
> > #regzbot monitor:
> > https://lore.kernel.org/all/[email protected]/
> > #regzbot fix: objtool: initialize all of struct elf
> > #regzbot ignore-activity



--
Josh

2023-07-16 23:42:04

by Michal Kubecek

[permalink] [raw]
Subject: Re: build failure after commit eb0481bbc4ce ("objtool: Fix reloc_hash size")

On Mon, Jul 10, 2023 at 10:16:28AM -0700, Josh Poimboeuf wrote:
> On Sun, Jul 09, 2023 at 05:09:29PM +0300, Michal Kubecek wrote:
> > On Sat, Jul 08, 2023 at 03:40:50PM +0200, Linux regression tracking (Thorsten Leemhuis) wrote:
> > > On 28.06.23 13:58, Michal Kubecek wrote:
> > > >
> > > > this morning, mainline kernel builds started to fail on my desktop like
> > > > this:
> > > >
> > > > mike@lion:~/work/git/kernel-upstream> mkdir /srv/ram/kobj
> > > > mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj defconfig >/dev/null
> > > > mike@lion:~/work/git/kernel-upstream> make -j24 CC=gcc-13 O=/srv/ram/kobj all >/dev/null
> > > > net/ipv4/netfilter/iptable_nat.o: warning: objtool: mmap fail reloc
> > > > net/netfilter/xt_mark.o: warning: objtool: mmap fail reloc
> > > > net/netfilter/xt_nat.o: warning: objtool: mmap fail reloc
> > > > net/netfilter/xt_LOG.o: warning: objtool: mmap fail reloc
> > > > net/netfilter/xt_MASQUERADE.o: warning: objtool: mmap fail reloc
> > > > net/netfilter/nf_log_syslog.o: warning: objtool: mmap fail reloc
> > > > net/netfilter/xt_addrtype.o: warning: objtool: mmap fail reloc
> > > > fs/efivarfs/efivarfs.o: warning: objtool: mmap fail reloc
> > > > drivers/thermal/intel/x86_pkg_temp_thermal.o: warning: objtool: mmap fail reloc
> > > > vmlinux.o: warning: objtool: mmap fail reloc
> > > > incomplete ORC unwind tables in file: vmlinux
> > > > Failed to sort kernel tables
> > > > make[2]: *** [/home/mike/work/git/kernel-upstream/scripts/Makefile.vmlinux:35: vmlinux] Error 1
> > > > make[2]: *** Deleting file 'vmlinux'
> > > > make[1]: *** [/home/mike/work/git/kernel-upstream/Makefile:1256: vmlinux] Error 2
> > > > make: *** [Makefile:226: __sub-make] Error 2
> > > >
> > > > I bisected the failure to commit
> > > >
> > > > eb0481bbc4ce ("objtool: Fix reloc_hash size")
> > > >
> > > > I also tried gcc11 and building on a normal filesystem (rather than
> > > > tmpfs) but the result is still the same. Different configurations (e.g.
> > > > allmodconfig) only show more modules with "mmap fail reloc". The machine
> > > > has 64 GB of RAM and both ulimit -m and ulimit -v show "unlimited".
> > > > Anything idea what else I should try?
> > >
> > > Michal, thx for the report. Please correct me if I'm wrong: this as of
> > > now is unfixed, as your patch to fix is afaics wasn't merged yet (at
> > > least I can't see it even in next, but I might be missing something).
> >
> > Yes, the fix has not been merged yet and current master (commit
> > 1c7873e33645) still shows the issue.
>
> Should be fixed in the tip tree with the following patch:
>
> https://lkml.kernel.org/lkml/168897683429.404.6801969953192508868.tip-bot2@tip-bot2

The fix reached mainline now as

9f71fbcde282 ("objtool: initialize all of struct elf")

and is present in 6.5-rc2 so that it no longer exhibits the issue.

Michal


Attachments:
(No filename) (2.91 kB)
signature.asc (499.00 B)
Download all attachments