[Touch-packages] [Bug 1842320] Re: Can't boot: "error: out of memory." immediately after the grub menu

2022-09-21 Thread Mar Kus
I tested latest daily build 
https://cdimage.ubuntu.com/jammy/daily-live/20220920/jammy-desktop-amd64.iso 
and out of memory stil exist. I hope someone can provide an iso for download 
with a livesystem and install for jammy with changed compression.
Ubuntu 21.10 (out of support) and Fedora 36 works fine.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1842320

Title:
  Can't boot: "error: out of memory." immediately after the grub menu

Status in grub:
  Unknown
Status in OEM Priority Project:
  Triaged
Status in grub2-signed package in Ubuntu:
  Confirmed
Status in initramfs-tools package in Ubuntu:
  Confirmed
Status in linux package in Ubuntu:
  Confirmed

Bug description:
  [Impact]

   * In some cases, if the users’ initramfs grow bigger, then it’ll
  likely not be able to be loaded by grub2.

   * Some real cases from OEM projects:

  In many built-in 4k monitor laptops with nvidia drivers, the u-d-c
  puts the nvidia*.ko to initramfs which grows the initramfs to ~120M.
  Also the gfxpayload=auto will remain to use 4K resolution since it’s
  what EFI POST passed.

  In this case, the grub isn't able to load initramfs because the
  grub_memalign() won't be able to get suitable memory for the larger
  file:

  ```
  #0 grub_memalign (align=1, size=592214020) at ../../../grub-core/kern/mm.c:376
  #1 0x7dd7b074 in grub_malloc (size=592214020) at 
../../../grub-core/kern/mm.c:408
  #2 0x7dd7a2c8 in grub_verifiers_open (io=0x7bc02d80, type=131076)
  at ../../../grub-core/kern/verifiers.c:150
  #3 0x7dd801d4 in grub_file_open (name=0x7bc02f00 
"/boot/initrd.img-5.17.0-1011-oem",
  type=131076) at ../../../grub-core/kern/file.c:121
  #4 0x7bcd5a30 in ?? ()
  #5 0x7fe21247 in ?? ()
  #6 0x7bc030c8 in ?? ()
  #7 0x00017fe21238 in ?? ()
  #8 0x7bcd5320 in ?? ()
  #9 0x7fe21250 in ?? ()
  #10 0x in ?? ()
  ```

  Based on grub_mm_dump, we can see the memory fragment (some parts seem
  likely be used because of 4K resolution?) and doesn’t have available
  contiguous memory for larger file as:

  ```
  grub_real_malloc(...)
  ...
  if (cur->size >= n + extra)
  ```

  Based on UEFI Specification Section 7.2[1] and UEFI driver writers’
  guide 4.2.3[2], we can ask 32bits+ on AllocatePages().

  As most X86_64 platforms should support 64 bits addressing, we should
  extend GRUB_EFI_MAX_USABLE_ADDRESS to 64 bits to get more available
  memory.

   * When users grown the initramfs, then probably will get initramfs
  not found which really annoyed and impact the user experience (system
  not able to boot).

  [Test Plan]

   * detailed instructions how to reproduce the bug:

  1. Any method to grow the initramfs, such as install nvidia-driver.

  2. If developers would like to reproduce, then could dd if=/dev/random
  of=... bs=1M count=500, something like:

  ```
  $ cat /usr/share/initramfs-tools/hooks/zzz-touch-a-file
  #!/bin/sh

  PREREQ=""

  prereqs()
  {
  echo "$PREREQ"
  }

  case $1 in
  # get pre-requisites
  prereqs)
  prereqs
  exit 0
  ;;
  esac

  . /usr/share/initramfs-tools/hook-functions
  dd if=/dev/random of=${DESTDIR}/test-500M bs=1M count=500
  ```

  And then update-initramfs

   * After applying my patches, the issue is gone.

   * I did also test my test grubx64.efi in:

  1. X86_64 qemu with
  1.1. 60M initramfs + 5.15.0-37-generic kernel
  1.2. 565M initramfs + 5.17.0-1011-oem kernel

  2. Amd64 HP mobile workstation with
  2.1. 65M initramfs + 5.15.0-39-generic kernel
  2.2. 771M initramfs + 5.17.0-1011-oem kernel

  All working well.

  [Where problems could occur]

  * The changes almost in i386/efi, thus the impact will be in the i386 / 
x86_64 EFI system.
  The other change is to modify the “grub-core/kern/efi/mm.c” but I use the 
original addressing for “arm/arm64/ia64/riscv32/riscv64”.
  Thus it should not impact them.

  * There is a “#if defined(__x86_64__)” which intent to limit the >
  32bits code in i386 system and also

  ```
   #if defined (__code_model_large__)
  -#define GRUB_EFI_MAX_USABLE_ADDRESS 0x
  +#define GRUB_EFI_MAX_USABLE_ADDRESS __UINTPTR_MAX__
  +#define GRUB_EFI_MAX_ALLOCATION_ADDRESS 0x7fff
   #else
   #define GRUB_EFI_MAX_USABLE_ADDRESS 0x7fff
  +#define GRUB_EFI_MAX_ALLOCATION_ADDRESS 0x3fff
   #endif
  ```

  If everything works as expected, then i386 should working good.

  If not lucky, based on “UEFI writers’ guide”[2], the i386 will get >
  4GB memory region and never be able to access.

  [Other Info]

   * Upstream grub2 bug #61058
  https://savannah.gnu.org/bugs/index.php?61058

   * Test PPA: https://launchpad.net/~os369510/+archive/ubuntu/lp1842320

   * Test grubx64.efi:
  https://people.canonical.com/~jeremysu/lp1842320/grubx64.efi.lp1842320

   * Test source code: https://git

[Touch-packages] [Bug 1970402] Re: Initrd out of memory error after upgrade to 22.04

2022-06-14 Thread Mar Kus
This problem exists still. It looks like to be an "old" problem.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1842320 describe
that grub 2.06 memory management has a problem.
http://savannah.gnu.org/bugs/?61058

I can't belive that iso ubuntu 21.10 is booting and working, but for
22.04 is no enduser solution.

Where can we get a fixed iso download with ubuntu 22.04?

Status: Incomplete (what is missing?)

and Unassigned

** Bug watch added: GNU Savannah Bug Tracker #61058
   http://savannah.gnu.org/bugs/?61058

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1970402

Title:
  Initrd out of memory error after upgrade to 22.04

Status in initramfs-tools package in Ubuntu:
  Incomplete

Bug description:
  After upgrading to 22.04 system is unbootable because of "out of memory" 
error when loading initial ramdisk. I was able to fix it by editing cat 
/etc/initramfs-tools/initramfs.conf
  and changing configuration to:
  MODULES=dep
  COMPRESS=xz
  RUNSIZE=15%

  Not sure which one helped, but I can test it if needed.

  System information:
  Description:Ubuntu 22.04 LTS
  Release:22.04

  initramfs-tools:
Installed: 0.140ubuntu13
Candidate: 0.140ubuntu13
Version table:
   *** 0.140ubuntu13 500
  500 http://pl.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
  500 http://pl.archive.ubuntu.com/ubuntu jammy/main i386 Packages
  100 /var/lib/dpkg/status

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1970402/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 1970402] Re: Initrd out of memory error after upgrade to 22.04

2022-05-08 Thread Mar Kus
Save behavior after upgrading from 21.10 to 22.04 system is unbootable because 
of "out of memory".
Live image Ubuntu 21.10 still works (btw. Fedora 36 beta works too).
Live image Ubuntu 22.04 "out of memory"

Hardware: LG Gram 16Z90P
Ram: 16 GB
Harddisk: 1 TB (Uefi and LUKS disk encryption)

Is there a solution in plan with a new daily ubuntu desktop iso?

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1970402

Title:
  Initrd out of memory error after upgrade to 22.04

Status in initramfs-tools package in Ubuntu:
  Incomplete

Bug description:
  After upgrading to 22.04 system is unbootable because of "out of memory" 
error when loading initial ramdisk. I was able to fix it by editing cat 
/etc/initramfs-tools/initramfs.conf
  and changing configuration to:
  MODULES=dep
  COMPRESS=xz
  RUNSIZE=15%

  Not sure which one helped, but I can test it if needed.

  System information:
  Description:Ubuntu 22.04 LTS
  Release:22.04

  initramfs-tools:
Installed: 0.140ubuntu13
Candidate: 0.140ubuntu13
Version table:
   *** 0.140ubuntu13 500
  500 http://pl.archive.ubuntu.com/ubuntu jammy/main amd64 Packages
  500 http://pl.archive.ubuntu.com/ubuntu jammy/main i386 Packages
  100 /var/lib/dpkg/status

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/initramfs-tools/+bug/1970402/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp