Re: [BUG] -next objtool build failure (bisected)
From: Paul E. McKenney
Date: Tue Oct 15 2024 - 15:00:11 EST
On Tue, Oct 15, 2024 at 01:45:07PM -0500, Josh Poimboeuf wrote:
> On Tue, Oct 15, 2024 at 11:10:11AM -0700, Paul E. McKenney wrote:
> > Hello!
> >
> > The next-20241011 release gets me build errors like the following:
> >
> > vmlinux.o: warning: objtool: fetch_item() falls through to next function
> >
> > Bisection leads me here:
> >
> > 61595012f280 ("HID: simplify code in fetch_item()")
> >
> > This diff looks inoffensive to me, but I get this error on this commit
> > and not on its predecessor.
> >
> > This build failure happens on quite a few different kernel configurations.
> > I bisected using this particular reproducer:
> >
> > tools/testing/selftests/rcutorture/bin/kvm.sh --allcpus --buildonly --configs SRCU-T
>
> The problem is likely this:
>
> + default:
> + unreachable();
>
> The unreachable() annotation by itself produces undefined behavior, as
> it will just fall off the edge of the function if the default case is
> ever executed.
>
> Better to do
>
> default:
> BUG();
>
> which makes the behavior defined.
And this fixes things for me, thank you!
Thanx, Paul