Bug 199845 - Often times black screen on boot (boot hangs)
Summary: Often times black screen on boot (boot hangs)
Alias: None
Product: Memory Management
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 high
Assignee: Andrew Morton
Depends on:
Reported: 2018-05-26 14:11 UTC by harryharryharry
Modified: 2018-11-02 23:05 UTC (History)
2 users (show)

See Also:
Kernel Version: 4.17-rc1
Tree: Mainline
Regression: No

Initramfs unpacking failed: uncompression error (4.82 MB, image/jpeg)
2018-05-26 14:11 UTC, harryharryharry
Initramfs unpacking failed: junk in compressed archive (4.50 MB, image/jpeg)
2018-05-26 14:14 UTC, harryharryharry
Initramfs unpacking failed: broken padding (4.96 MB, image/jpeg)
2018-05-26 14:14 UTC, harryharryharry

Description harryharryharry 2018-05-26 14:11:30 UTC
Created attachment 276207 [details]
Initramfs unpacking failed: uncompression error

Since 4.17-rc1 my Asus X205TA (baytrail platform) often hangs on boot, when this happens I need to hard reset the laptop. I've looked for similar bugtrackers and there are some:

Black screen every 1/3 times on boot

screen stays dark for long on bootup since kernel 4.17.0-rc2+

black screen irrespective of amdgpu.dc=1 or 0 at boot on kernels 4.17-rc2 and onwards caused by low entropy

The first one being the most similar in describing the symptoms. But neither one of the recommended solutions (generating entropy on boot, enabling kasan memory debugger) helped for me.

I noticed while on ubuntu with the mainline kernel 4.17-rc1 that sometimes instead of a black screen I got an actual screendump of what went wrong (I've attached pictures). The errors are always slightly different but all point to initramfs decompression issues. So I started looking at the diff between 4.16 and 4.17-rc1 and reverted the commits to head_64.S (and for the compilation to succeed also the commits to pgtable_64.c). This 'solves' or rather circumvents the boot hangs for me. This workaround still works on 4.17-rc6.
Comment 1 harryharryharry 2018-05-26 14:14:08 UTC
Created attachment 276209 [details]
Initramfs unpacking failed: junk in compressed archive
Comment 2 harryharryharry 2018-05-26 14:14:48 UTC
Created attachment 276211 [details]
Initramfs unpacking failed: broken padding
Comment 3 Dmitry Vyukov 2018-05-26 14:54:04 UTC
This does not seem to be related to KASAN/sanitizers.
Comment 4 harryharryharry 2018-05-26 16:40:44 UTC
Sorry, I couldn't find a suitable category. I must have missed 'other'. Thanks for amending.
Comment 5 Kirill A. Shutemov 2018-05-28 11:49:00 UTC
Hm. Could you try to bisect which commit is first broken one?
Comment 6 harryharryharry 2018-05-28 12:36:59 UTC
Either the commit for head_64.S in 4.17-rc1:

or the commit for pgtable_64.c in 4.17-rc1:

I can't successfully compile the kernel with only the first commit reverted.
Comment 7 Kirill A. Shutemov 2018-05-28 13:31:19 UTC
That's not commits. That's just diffs between v4.16 and v4.17-rc1 for these files. It doesn't help much with isolating the problem.

Could you find the first broken *commit*.

This would give the list of commits to look at:

git log --no-merges --oneline v4.16..v4.17-rc1 arch/x86/boot/compressed

And have you checked that plain 4.17-rc6 or -rc7 are still broken? There was couple of fixes in v4.17-rc6 in this area.
Comment 8 harryharryharry 2018-05-30 20:46:40 UTC
Thanks for the pointers, sorry I'm not too savvy with git but I'm trying to learn.

When head is at:
d6289f36aa7d (HEAD) x86/build: Don't pass in -D__KERNEL__ multiple times
loading the initramfs never freezes.

When head is at:
07344b15a994 (HEAD) x86/boot: Fix SEV boot failure from change to __PHYSICAL_MASK_SHIFT
loading the initramfs freezes regularly.

I checked 07344b15a994 with git show, but there doesn't seem to be anything regarding head_64.S or pgtable_64.c in there. However the following commit (194a9749c73d) pertains arch/x86/boot/compressed/head_64.S

Is this the commit that causes the random freezes during initramfs load ?
Comment 9 harryharryharry 2018-05-31 10:45:36 UTC
Forgot to add: I've tried 4.17-rc6 en 4.17-rc7 and 4.17.0-rc7-next-20180529 and they all exhibit the same freezing behaviour.
Comment 10 Kirill A. Shutemov 2018-05-31 14:13:40 UTC
Could you also check if 547edaca247a works fine for you?
Comment 11 harryharryharry 2018-05-31 20:11:49 UTC
No the initramfs also fails to load sometimes when booting a kernel compiled with head at:
547edaca247a (HEAD) x86/mm: Update comment in detect_tme() regarding x86_phys_bits
Comment 12 harryharryharry 2018-06-17 14:12:44 UTC
Issue still occurs with 4.18-rc1

Note You need to log in before you can comment on or make changes to this bug.