grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: backtrace command broken on x86_64-efi in QEMU


From: Glenn Washburn
Subject: Re: backtrace command broken on x86_64-efi in QEMU
Date: Tue, 18 Jul 2023 16:30:44 -0500

On Mon, 17 Jul 2023 23:19:23 -0500
Oskari Pirhonen <xxc3ncoredxx@gmail.com> wrote:

> On Mon, Jul 17, 2023 at 16:07:09 -0500, Glenn Washburn wrote:
> > I haven't run this on real hardware, but I would guess it would exhibit
> > the same behavior. Here's the output I get:
> > 
> > grub> insmod backtrace
> > grub> backtrace
> > 0x41: 0x0 (0x0,0x0,0x0)
> > Invalid stack frame at 0x41 (0xc00002)
> > 
> 
> I rebooted into the GRUB console on my machine and ran the same set of
> commands. It seems to just hang. I left it for about 10 minutes before I
> force rebooted.

Thanks for verifying this on real hardware. To be clear, you get no
output and it just hangs, or you get the output above and then it
hangs?

It doesn't hang in QEMU (maybe just by chance). I initially thought this
was partially related to this code not taking stack smashing
instrumentation into account. But it doesn't look like GCC is
instrumenting any of those module functions, and I got similar behavior
when built without stack smashing support. I think the root issue as
I'm seeing it is that %rbp is being used by GCC as a general register,
not as the base pointer for a frame, but this code assumes it does.

I'm guessing that for you grub_backtrace_pointer() was called with a
NULL argument (%rbp was 0) or something else random that caused a
read fault which is not handled by GRUB.

> 
> Running 2.12~rc1 on x86_64-efi installed through Gentoo.

Out of curiosity, what configure options is Gentoo building GRUB with?

Glenn




reply via email to

[Prev in Thread] Current Thread [Next in Thread]