Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] kernel panic after upgrade to Linux-4.18
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
lanjian9151
n00b
n00b


Joined: 06 Mar 2014
Posts: 8

PostPosted: Thu Aug 23, 2018 9:20 am    Post subject: [Solved] kernel panic after upgrade to Linux-4.18 Reply with quote

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
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31455
Location: here

PostPosted: Thu Aug 23, 2018 9:30 am    Post subject: Reply with quote

What is the exact error message?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
lanjian9151
n00b
n00b


Joined: 06 Mar 2014
Posts: 8

PostPosted: Thu Aug 23, 2018 11:33 am    Post subject: Reply with quote

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"
Back to top
View user's profile Send private message
lanjian9151
n00b
n00b


Joined: 06 Mar 2014
Posts: 8

PostPosted: Thu Aug 23, 2018 12:23 pm    Post subject: Reply with quote

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"
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 136

PostPosted: Thu Aug 23, 2018 6:31 pm    Post subject: Reply with quote

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
Code:
/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/.
Back to top
View user's profile Send private message
lanjian9151
n00b
n00b


Joined: 06 Mar 2014
Posts: 8

PostPosted: Fri Aug 24, 2018 3:20 am    Post subject: Reply with quote

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
Code:
/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/.

just tested, there is nothing in there.
Back to top
View user's profile Send private message
dylanmc
Apprentice
Apprentice


Joined: 18 Apr 2014
Posts: 157
Location: Modena, Italy

PostPosted: Fri Aug 24, 2018 5:50 pm    Post subject: Reply with quote

a question for this kernel: I have unmasked, but I didn't have the sources for x86_64 :O
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 136

PostPosted: Fri Aug 24, 2018 6:09 pm    Post subject: Reply with quote

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:
Code:
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.
Back to top
View user's profile Send private message
lanjian9151
n00b
n00b


Joined: 06 Mar 2014
Posts: 8

PostPosted: Wed Aug 29, 2018 6:19 am    Post subject: Reply with quote

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:
Code:
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.


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.
Back to top
View user's profile Send private message
medmusicus
n00b
n00b


Joined: 22 Dec 2011
Posts: 14

PostPosted: Mon Sep 03, 2018 8:12 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 136

PostPosted: Mon Sep 03, 2018 9:37 pm    Post subject: Reply with quote

@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
Back to top
View user's profile Send private message
medmusicus
n00b
n00b


Joined: 22 Dec 2011
Posts: 14

PostPosted: Mon Sep 03, 2018 9:49 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
medmusicus
n00b
n00b


Joined: 22 Dec 2011
Posts: 14

PostPosted: Mon Sep 03, 2018 9:58 pm    Post subject: Reply with quote

Looking in the pstore-directory now shows only cryptic files like "dmesg-efi-153601155201001.enc.z", which do not show any reasonable text.
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 136

PostPosted: Mon Sep 03, 2018 10:13 pm    Post subject: Reply with quote

IMHO in your case pstore subsystem compresses the log data using
zlib. The data can be extracted with the following command:
Code:
cat xxx/dmesg-efi-153601155201001.enc.z | \
> python -c 'import sys, zlib; print(zlib.decompress(sys.stdin.read()))'

or
Code:
cat - xxx/dmesg-efi-153601155201001.enc.z | gzip -dc
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23075

PostPosted: Tue Sep 04, 2018 1:47 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 136

PostPosted: Tue Sep 04, 2018 6:21 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3942
Location: Hamburg

PostPosted: Tue Sep 04, 2018 9:28 am    Post subject: Reply with quote

PrSo wrote:
Code:
cat - xxx/dmesg-efi-153601155201001.enc.z | gzip -dc
?
Code:
zcat <file>
should be fully enough
Back to top
View user's profile Send private message
medmusicus
n00b
n00b


Joined: 22 Dec 2011
Posts: 14

PostPosted: Tue Sep 04, 2018 5:09 pm    Post subject: Reply with quote

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

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

gzip: stdin: unexpected end of file
Back to top
View user's profile Send private message
Tony0945
Watchman
Watchman


Joined: 25 Jul 2006
Posts: 5127
Location: Illinois, USA

PostPosted: Tue Sep 04, 2018 6:34 pm    Post subject: Reply with quote

I think Toralf meant "zcat dmesg-efi-153601155201001.enc.z" without any piping.
Back to top
View user's profile Send private message
medmusicus
n00b
n00b


Joined: 22 Dec 2011
Posts: 14

PostPosted: Tue Sep 04, 2018 7:14 pm    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
PrSo
Tux's lil' helper
Tux's lil' helper


Joined: 01 Jun 2017
Posts: 136

PostPosted: Tue Sep 04, 2018 9:43 pm    Post subject: Reply with quote

@medmusicus
I apologize, the command should be:
Code:
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum