Bug 1183213

Summary: System cannot boot after upgrade from Leap: Synchronous Exception at 0x00000000BF5AD6A8
Product: [openSUSE] openSUSE Tumbleweed Reporter: Guillaume GARDET <guillaume.gardet>
Component: BootloaderAssignee: Gary Ching-Pang Lin <glin>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: acarvajal, fcrozat, glin, guillaume.gardet, hluo, jlee, llzhao, lpechacek, mchang, mlin, msuchanek, riafarov, richard.fan
Version: Current   
Target Milestone: ---   
Hardware: aarch64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: Yes
Marketing QA Status: --- IT Deployment: ---
Bug Depends on: 1182776    
Bug Blocks:    

Description Guillaume GARDET 2021-03-09 08:23:22 UTC
+++ This bug was initially created as a clone of Bug #1182776 +++

On Tumbleweed, upgrade tests are failing in grub: 
https://openqa.opensuse.org/tests/1661285#step/grub_test/322

Log:
**************************************************
[0m[30m[47mWelcome to GRUB!


[0m[37m[40mPlease press 't' to show the boot menu on this console

Unloading driver at 0x000B834F000


Synchronous Exception at 0x00000000BF5AD6A8
AllocatePool: failed to allocate 472 bytes
ASSERT [HiiDatabase] /home/abuild/rpmbuild/BUILD/edk2-edk2-stable202011/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c(1686): Cell != ((void *) 0)
**************************************************

This is very similar to Bug #1182776 from SLE15-SP3.
Comment 1 Guillaume GARDET 2021-03-09 09:27:25 UTC
https://build.opensuse.org/request/show/877920 should fix it.
Comment 2 Guillaume GARDET 2021-03-10 07:35:18 UTC
The new shim has been added to :Factory:ARM, but this has no effect on the problem of upgrade scenario. It seems the shim is no installed at all. Should grub require shim now? Or do we need an additional fix for Grub?

Please note that this problem also happens when a fresh installation is performed from USB:
https://openqa.opensuse.org/tests/1663259#step/grub_test/5
Comment 3 Gary Ching-Pang Lin 2021-03-10 08:29:31 UTC
I didn't see my patch in openSUSE:Factory:ARM
https://build.opensuse.org/package/show/openSUSE:Factory:ARM/shim
Comment 4 Guillaume GARDET 2021-03-10 08:37:24 UTC
(In reply to Gary Ching-Pang Lin from comment #3)
> I didn't see my patch in openSUSE:Factory:ARM
> https://build.opensuse.org/package/show/openSUSE:Factory:ARM/shim

shim-bsc1182776-fix-crash-at-exit.patch was there. 
Verified with changes log from https://openqa.opensuse.org/snapshot-changes/opensuse-aarch64/Tumbleweed/diff/20210308 :
==== shim ====

- Add shim-bsc1182776-fix-crash-at-exit.patch to fix the potential
  crash at Exit() (bsc#1182776)

The overlay points to Staging:H/shim which has been merged few minutes ago and thus now points to shim from ring, which will take time to update.
Anyway, the overlay must now be removed and the openQA test included your fix.
Comment 5 Gary Ching-Pang Lin 2021-03-10 08:52:34 UTC
Per my test for bsc#1182776, the crash was gone after the shim patch was applied. If it didn't work, then we're probably hit by another bug :(
Comment 6 Guillaume GARDET 2021-03-10 09:10:03 UTC
(In reply to Gary Ching-Pang Lin from comment #5)
> Per my test for bsc#1182776, the crash was gone after the shim patch was
> applied. If it didn't work, then we're probably hit by another bug :(

The only problem is with the "Boot from hard disk" menu entry.

zdup-Leap-15.2-gnome@aarch64: https://openqa.opensuse.org/tests/1662594#step/setup_zdup/4
performs the following:
1. boot from tested ISO and select "Boot from hard disk"
2. fail to boot on older Leap 15.2 image

Also as per comment 2:
> Please note that this problem also happens when a fresh installation is performed from USB:
> https://openqa.opensuse.org/tests/1663259#step/grub_test/5

It fails to "Boot from hard disk" from a fresh installation as well.

But booting from hard disk _directly_ is fine.
Comment 7 Gary Ching-Pang Lin 2021-03-10 09:28:53 UTC
(In reply to Guillaume GARDET from comment #6)
> (In reply to Gary Ching-Pang Lin from comment #5)
> > Per my test for bsc#1182776, the crash was gone after the shim patch was
> > applied. If it didn't work, then we're probably hit by another bug :(
> 
> The only problem is with the "Boot from hard disk" menu entry.
> 
> zdup-Leap-15.2-gnome@aarch64:
> https://openqa.opensuse.org/tests/1662594#step/setup_zdup/4
> performs the following:
> 1. boot from tested ISO and select "Boot from hard disk"
> 2. fail to boot on older Leap 15.2 image
> 
> Also as per comment 2:
> > Please note that this problem also happens when a fresh installation is performed from USB:
> > https://openqa.opensuse.org/tests/1663259#step/grub_test/5
> 
> It fails to "Boot from hard disk" from a fresh installation as well.
> 
> But booting from hard disk _directly_ is fine.

So did bsc#1182776. The "Boot from hard disk" option is now replaced with a single "exit" to make the firmware try the next boot option, so it doesn't really boot the disk at all...
Comment 8 Michael Chang 2021-03-10 09:32:37 UTC
Probably the installation iso required a renew for the shim update ? It was release two days ago (20210308) but Gary's fix was submitted yesterday.
Comment 9 Guillaume GARDET 2021-03-10 09:52:48 UTC
(In reply to Michael Chang from comment #8)
> Probably the installation iso required a renew for the shim update ? It was
> release two days ago (20210308) but Gary's fix was submitted yesterday.

No, the ISO should have it already (snapshot number is always behind, due to the build time required to finish all the build in project).
Comment 10 Gary Ching-Pang Lin 2021-03-11 03:08:01 UTC
I figured out that the following patch was missing.

https://github.com/rhboot/shim/commit/b5e10f70c7a495dc1788e3604803ee633f1e5f76

Without the patch, the cleanup in unhook_exit() won't be invoked if Secure Boot was disabled.

Will backport the patch.
Comment 12 Guillaume GARDET 2021-04-08 13:12:01 UTC
This is fixed now.