# [Solved] kernel panic after upgrade to Linux-4.18

## lanjian9151

I'm using Linux-4.17.14 kernel, after upgrade to Linux-4.18.* with old config, the kernel got panic in early boot, is there any suggestion how to troubleshoot this issue.

update: issue solved by use genkernel re-create .config file and rebuild kernel.

still don't know which config cause this.Last edited by lanjian9151 on Wed Aug 29, 2018 6:22 am; edited 1 time in total

----------

## fedeliallalinea

What is the exact error message?

----------

## lanjian9151

 *fedeliallalinea wrote:*   

> What is the exact error message?

 

I can't see any useful info due to it's happened on  early boot. I can just see a info "kernel offset disable"

----------

## lanjian9151

 *fedeliallalinea wrote:*   

> What is the exact error message?

 

after several reboot I can see some error said "Kernel panic not syncing attempted to kill init"

----------

## PrSo

 *lanjian9151 wrote:*   

>  *fedeliallalinea wrote:*   What is the exact error message? 
> 
> I can't see any useful info due to it's happened on  early boot. I can just see a info "kernel offset disable"

 

If you can boot to previous working kernel you could check 

```
/sys/fs/pstore/
```

 for panic and oops messages. The pstore filesystem should be enabled by default in gentoo-sources.

Please, see: https://lwn.net/Articles/434821/.

----------

## lanjian9151

 *PrSo wrote:*   

>  *lanjian9151 wrote:*    *fedeliallalinea wrote:*   What is the exact error message? 
> 
> I can't see any useful info due to it's happened on  early boot. I can just see a info "kernel offset disable" 
> 
> If you can boot to previous working kernel you could check 
> ...

 

just tested, there is nothing in there.

----------

## dylanmc

a question for this kernel: I have unmasked, but I didn't have the sources for x86_64 :O

----------

## PrSo

 *lanjian9151 wrote:*   

> just tested, there is nothing in there.

 

Does your machine have EFI filesystem (UEFI) or it is pure BIOS?

If it is BIOS only, unfortunately pstore has to preserve logs during the reboots, so it will not work for you, but when this is UEFI machine please check what is actual pstore backend: 

```
cat /sys/module/pstore/parameters/backend
```

 (BTW you can choose preferred pstore backend by kernel boot option "pstore.backend=")

In BIOS only case I would do "make mproper" and with "make menuconfig" enable all needed drivers from "lspci -nnk" command executed on 4.17.14 just to boot up the 4.18.x.(and all fiesystem drivers needed accordig to wiki which you are using) I would tune it later.

----------

## lanjian9151

 *PrSo wrote:*   

>  *lanjian9151 wrote:*   just tested, there is nothing in there. 
> 
> Does your machine have EFI filesystem (UEFI) or it is pure BIOS?
> 
> If it is BIOS only, unfortunately pstore has to preserve logs during the reboots, so it will not work for you, but when this is UEFI machine please check what is actual pstore backend: 
> ...

 

Thanks for your help, finally I use genkernel rebuild the kernel issue solved. But still don't know which config caused the issue. Anyway I can user 4.18 now.

----------

## medmusicus

Same problem on my laptop. I can configure/compile/use the latest 4.17-kernel, but NOT any kernel since 4.18. Tried all kinds of configurations. Eventually, it worked with genkernel, but I would like a manually configured kernel much better.

HP-Laptop, Intel HM170-Chipset, Skylake-CPU, Nvidia mobile 1050, 16 GB RAM.

On each kernel configuration I tried there is a kernel panic. It boots, sets up the SATA-Drives, recognizes the file system (btrfs), but then stops with panic.

Any suggestions?

----------

## PrSo

@lanjian9151

I am glad to hear that your machine is on 4.18.x kernel. You can play with .config with "make menuconfig" later to trim it down because the genkernel by default enables "more" than is needed, but this depends on your choice.

@medmusicus

If I'm correct this machine has UEFI, if so, what is pstore panic log output, if any?Last edited by PrSo on Mon Sep 03, 2018 9:52 pm; edited 1 time in total

----------

## medmusicus

I reverted to 4.17, because I couldn`t use the nvidia-driver, as genkernel sets up the nouveau stuff and nvidia framebuffer.

I`m playing around with the .config for a while now, with all thinkable configurations and checking the right hardware drivers, crosschecking with my 4.17-config, but still getting a kernel panic.

Just deleted the pstore directory, because it didn`t contain any output for the last days, but I`ll try again and will post the output here.

----------

## medmusicus

Looking in the pstore-directory now shows only cryptic files like "dmesg-efi-153601155201001.enc.z", which do not show any reasonable text.

----------

## PrSo

IMHO in your case pstore subsystem compresses the log data using

zlib.  The data can be extracted with the following command: 

```
cat xxx/dmesg-efi-153601155201001.enc.z | \

> python -c 'import sys, zlib; print(zlib.decompress(sys.stdin.read()))'
```

or

```
cat - xxx/dmesg-efi-153601155201001.enc.z | gzip -dc
```

----------

## Hu

Why do you need cat there?  In the first case, you only use it to read one file, which is a Useless Use Of Cat.  In the second case, you use it to read two files, but one of them is a non-redirected stdin, which will probably not work.

----------

## PrSo

 *Hu wrote:*   

> Why do you need cat there?  In the first case, you only use it to read one file, which is a Useless Use Of Cat.  In the second case, you use it to read two files, but one of them is a non-redirected stdin, which will probably not work.

 

Hmm, after rethinking you could be right, but what do you recommend/suggest instead?

Thanks,

Przemek.

----------

## toralf

 *PrSo wrote:*   

> 
> 
> ```
> cat - xxx/dmesg-efi-153601155201001.enc.z | gzip -dc
> ```
> ...

 ?

```
zcat <file>
```

should be fully enough

----------

## medmusicus

zcat dmesg-efi-153601155201001.enc.z | gzip -dc

gzip: dmesg-efi-153601155201001.enc.z: not in gzip format

gzip: stdin: unexpected end of file

----------

## Tony0945

I think Toralf meant "zcat dmesg-efi-153601155201001.enc.z" without any piping.

----------

## medmusicus

Magaged it at last, don`t know exactly, why.

After deselecting everything what was not supported by my hardware it fnally worked: manually configured kernel, recompiled nvidia-drivers and bingo, I'm on my plasma desktop again!

----------

## PrSo

@medmusicus

I apologize, the command should be:

```
printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" |cat - sys/fs/pstore/dmesg-efi-153601155201001.enc.z |gzip -dc
```

for one file only, but pstore saves couple of files from kernel panics due to the space limit. Wrong copy-paste action here.

I am glad to hear that your kernel is working.

@Hu

You are right, it was for the one file only. If medmusicus would like (and I suppose to) decompress and read multiplies files in /sys/fs/pstore dir he would use a regex  i.e. wildcard -  "*" after "efi-" in the file name.

@toralf

 *Quote:*   

> ?

 

thanks for pointing that out. 

As for "zcat" I have heard that it cannot decompress the pstore messages as it will produce error that the file is not in gzip format, but I could be wrong tough.

Sorry for whole this mess.

----------

