Re: objtool crash processing drivers/gpu/drm/vmwgfx/vmwgfx_msg.o
From: Josh Poimboeuf
Date: Thu Mar 27 2025 - 23:57:57 EST
On Thu, Mar 27, 2025 at 05:41:18PM +0100, Ingo Molnar wrote:
>
> * Arnd Bergmann <arnd@xxxxxxxx> wrote:
>
> > I saw this on one randconfig build failing today with yesterday's
> > next-20250326 (with a couple of patches on top), using gcc-14.2
> > and the attached config I assume this is a rare configuration:
> >
> > ./tools/objtool/objtool --hacks=jump_label --hacks=noinstr --sls --stackval --static-call --uaccess --module drivers/gpu/drm/vmwgfx/vmwgfx_msg.o
> > Segmentation fault
> >
> > I have not tried to analyze it any further, but I would guess that
> > this is a rare configuration, not a recent regression.
>
> I can reproduce this now too, not with a randconfig but with a distro
> DEB package build:
Thanks, I was able to reproduce with both configs. The below fixes it,
which then results in another warning:
drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool: vmw_recv_msg.cold+0x0: unreachable instruction
drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool: vmw_recv_msg.cold+0x3: unreachable instruction
drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool: vmw_recv_msg.cold+0x6: skipping duplicate warning(s)
Which is another easy fix. I'll send patches.
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 3bf29923d5c0..29de1709ea00 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -4037,7 +4037,7 @@ static bool ignore_unreachable_insn(struct objtool_file *file, struct instructio
* It may also insert a UD2 after calling a __noreturn function.
*/
prev_insn = prev_insn_same_sec(file, insn);
- if (prev_insn->dead_end &&
+ if (prev_insn && prev_insn->dead_end &&
(insn->type == INSN_BUG ||
(insn->type == INSN_JUMP_UNCONDITIONAL &&
insn->jump_dest && insn->jump_dest->type == INSN_BUG)))