Re: objtool crashes on clang output (drivers/hwmon/pmbus/adm1275.o)

From: Arnd Bergmann
Date: Fri Jul 12 2019 - 03:51:57 EST


On Thu, Jul 11, 2019 at 11:29 PM Arnd Bergmann <arnd@xxxxxxxx> wrote:
>
> On Thu, Jul 11, 2019 at 11:05 PM 'Jann Horn' via Clang Built Linux
> <clang-built-linux@xxxxxxxxxxxxxxxx> wrote:
> > I was playing around with building the kernel with LLVM a few months
> > ago and used this local patch, but didn't get around to submitting
> > upstream because I couldn't reproduce the problem for some reason. I
> > think the warnings you're getting sound like what I saw back then:
> > https://gist.github.com/thejh/0434662728afb95d72455bf30ece5817
> >
> > Quoting the commit message from that patch:
> >
> > ====
> > With clang from git master, code can be generated where a function contains
> > two indirect jump instructions that use the same switch table. To deal with
> > this case and similar ones properly, convert the switch table parsing to
> > use two passes:
> > ====
> >
> > Does that sound like what you're seeing?
>
> Yes, that is exactly right, and your patch seems to address the problem
> for the cases I tried so far (will know more after a night of randconfig
> testing).

I no longer see any of the "can't find switch jump table" in last
nights randconfig
builds. I do see one other rare warning, see attached object file:

fs/reiserfs/do_balan.o: warning: objtool: replace_key()+0x158: stack
state mismatch: cfa1=7+40 cfa2=7+56
fs/reiserfs/do_balan.o: warning: objtool: balance_leaf()+0x2791: stack
state mismatch: cfa1=7+176 cfa2=7+192
fs/reiserfs/ibalance.o: warning: objtool: balance_internal()+0xe8f:
stack state mismatch: cfa1=7+240 cfa2=7+248
fs/reiserfs/ibalance.o: warning: objtool:
internal_move_pointers_items()+0x36f: stack state mismatch: cfa1=7+152
cfa2=7+144
fs/reiserfs/lbalance.o: warning: objtool:
leaf_cut_from_buffer()+0x58b: stack state mismatch: cfa1=7+128
cfa2=7+112
fs/reiserfs/lbalance.o: warning: objtool:
leaf_copy_boundary_item()+0x7a9: stack state mismatch: cfa1=7+104
cfa2=7+96
fs/reiserfs/lbalance.o: warning: objtool:
leaf_copy_items_entirely()+0x3d2: stack state mismatch: cfa1=7+120
cfa2=7+128

I suspect this comes from the calls to the __reiserfs_panic() noreturn function,
but have not actually looked at the object file.

Arnd

Attachment: lbalance.o
Description: application/object