# How to detect a Kernel Panic!

## Pes88

Hi,

   I have a big issue with my kernel! When I'm using my pc it freezes, I think, the kernel causes this because after that, the only way to use the pc is reboot  with the power button.  I explain myself better...

 I've recently bought a new laptop with the Intel i7  3610, Nvidia 630 Optimus technology, It should be very nice computer but not long after buying it I had troubles.

  Firstly, I've installed Ubuntu ( in order to install GENTOO ), and that problem occured.. When I am using the pc gets stuck, completely random. 

I thought it was a problem which had to do with the Ubuntu Kernel. So, I decided to install Gentoo with a my kernel ( without any particular configuration, just the default config ), the pc still freezes... 

   I haven't found anything weird in the kernel messages (dmesg). I don't know how to find useful information linked to crushes....   :Crying or Very sad:   :Crying or Very sad: 

what shall I do to find out what cause this?

What shall I post to help you to understand better my problem?

Also I would like to be sure that isn't a Hardware problem..

I have also a Windows installation which works properly!!!

I have an idea about this, could the nouveau driver cause this? Because I have that driver in both systems... Also, I'm using lvm, but difficultly it can cause this because it is quite stable and tested software... isn't it?

----------

## aCOSwt

Do you mean it freezes only under X ?

And that CTRL+ALT+F1 does not bring you back to console ?

And that CTRL+ALT+BACKSPACE is intefficient ?

Well, if yes then do try with the nvidia proprietary drivers (emerge nvidia-drivers) and in the meantime, post your /etc/X11/xorg.conf and pastebin your /var/log/Xorg.0.log

----------

## DaggyStyle

you don't need to install ubuntu in order to install gentoo.

does your pc freezes or after x start screen is black?

----------

## Pes88

 *Quote:*   

> 
> 
> Do you mean it freezes only under X ? 
> 
> And that CTRL+ALT+F1 does not bring you back to console ? 
> ...

 

It happened only when I'm using the graphic interface. However, it isn't any Xorg crash, it's a kernel freeze!!!  :Sad: 

 *Quote:*   

> 
> 
> does your pc freezes or after x start screen is black?
> 
> 

 

not, the scree remain the same, but you can use the pc! 

After the pc freezes, I can hear the fun, i think some kernel process get all the cpu... Maybe there is some bug in the kernel with my new hardware?

----------

## DaggyStyle

 *Pes88 wrote:*   

>  *Quote:*   
> 
> Do you mean it freezes only under X ? 
> 
> And that CTRL+ALT+F1 does not bring you back to console ? 
> ...

 

the kernel is the core of the system, if it freezes, you cannot use the system.

according to you the screen is black but you can use the system, e.g. CTRL+ALT+F1 should drop you to shell.

in that case, you'll need to look at /var/log/Xorg.0.log to see what is the issue.

did you installed the gpu driver? are you sure the driver supports your card?

also it is a good idea to change the topic and ask to move it to the right forum.

----------

## Pes88

I made a mistake, the screen is not black, it's just stuck and  I CANNOT use the pc! Sorry... 

However I think it's a kernel Panic. 

 *Quote:*   

> 
> 
> did you installed the gpu driver? are you sure the driver supports your card? 
> 
> 

 

I haven't installed the official driver yet, because I have the Optimus technology I din't understood very well how it works. Although I have installed the driver intel which works properly. 

 *Quote:*   

> 
> 
> also it is a good idea to change the topic and ask to move it to the right forum.
> 
> 

 

why?

----------

## aCOSwt

 *Pes88 wrote:*   

> why?

 

Just because it is likely not to be a kernel panic.

Could you post the informations I asked for in my first post ?

----------

## DaggyStyle

 *Pes88 wrote:*   

> I made a mistake, the screen is not black, it's just stuck and  I CANNOT use the pc! Sorry... 
> 
> However I think it's a kernel Panic. 
> 
> I haven't installed the official driver yet, because I have the Optimus technology I din't understood very well how it works. Although I have installed the driver intel which works properly. 
> ...

 

you really need to decide what is the problem...

so grab a livecd, boot it, mount then needed partitions to access /var/log/messages, post it on dpaste and put the link here.

if there is a kernel panic, we will see it in the log.

----------

## Pes88

 *Quote:*   

> 
> 
> /etc/X11/xorg.conf and pastebin your /var/log/Xorg.0.log
> 
> 

 

I don't use any xorg.conf for the moment... 

http://pastebin.com/4StqZ9hw

 *Quote:*   

> 
> 
> so grab a livecd, boot it, mount then needed partitions to access /var/log/messages, post it on dpaste and put the link here.
> 
> if there is a kernel panic, we will see it in the log.
> ...

 

I couldn't do that because now the pc didn't freeze... It is completely random! When happen I will do.. 

Thank for helping me...

----------

## John R. Graham

The /var/log/messages file will preserve messages from the previous freeze, so it's still potentially useful to post.   :Wink: 

- John

----------

## DaggyStyle

 *John R. Graham wrote:*   

> The /var/log/messages file will preserve messages from the previous freeze, so it's still potentially useful to post.  
> 
> - John

 

 *Pes88 wrote:*   

>  *Quote:*   
> 
> /etc/X11/xorg.conf and pastebin your /var/log/Xorg.0.log
> 
>  
> ...

 

john is right, unlike dmesg, /var/log/messages is kept between boots.

----------

## Pes88

 *Quote:*   

> 
> 
> The /var/log/messages file will preserve messages from the previous freeze, so it's still potentially useful to post
> 
> 

 

I don't have! 

This is the content of my var : 

```

ConsoleKit  Xorg.0.log  Xorg.0.log.old  dmesg  emerge-fetch.log  emerge.log  genkernel.log  kdm.log  lastlog  pm-powersave.log  pm-suspend.log  portage  sandbox  tallylog  wtmp

```

----------

## DaggyStyle

 *Pes88 wrote:*   

>  *Quote:*   
> 
> The /var/log/messages file will preserve messages from the previous freeze, so it's still potentially useful to post
> 
>  
> ...

 

did you emerged syslog-ng?

----------

## cach0rr0

a)you need to emerge a syslog daemon, such as syslog-ng as DaggyStyle suggested

b)if it's really not showing for whatever reason, if your system has a serial port, you can terminal in via serial console and watch the panic - if in fact there is one

I normally confirm a panic by trying to contact the box from another host on the same LAN - it doesnt always work, since sometimes a network driver may be what's crashing, but it can be helpful - all the better if you can try to ssh from another local host to your supposedly frozen PC.

----------

## Pes88

I've installed syslog-ng! 

These logs are when the system had a freeze! 

dmesg : 

http://pastebin.com/grCYVjHH

Xorg :

http://pastebin.com/i0W4JqPK

Messages : 

http://pastebin.com/nypM0kfT

thak for helping..  :Wink: 

----------

## DaggyStyle

when the freeze occurs, does the leds on the keyboard blink?

----------

## Pes88

 *Quote:*   

> 
> 
> when the freeze occurs, does the leds on the keyboard blink?
> 
> 

 

No! everything is dead...   :Sad: 

I have noticed that after rebooting the pc the keyboard doesn't work properly! For instance,  I can't use the arrows to select the system on Grub, only after the system is completely loaded it start again to work. 

it's quite wired.. isn't it?

----------

## DaggyStyle

well your system doesn't panic, it just freezes.

try latest kernel.

----------

## DirtyHairy

Well, I have to second Pes88, it could be a panic. The fact that the logs are empty is natural, a panic stops userspace and therefore usually is not logged. Blinking keyboard lights are an indicator, but as all other indicators (no ping, lights do not change on caps/numlock etc.), it's absence doesn't indicate that _no_ panic occured. Another test would be to activate magic sysrq in the kernel config and try the various key combinations in /usr/src/linux/Documentation/sysrq.txt . If you have access to another machine in the network, try ping and ssh.

However, irrespectively of whether panic or not, a good first stab it fixing it is to let the system run for prolonged time (e.g. updating) without any video drivers or X, just a plain VGA terminal; if it doesn't freeze, you know it is video. As you have an intel IGP in addition to your nvidia optimus, try deactivting nouveau in the kernel config (your dmesg shows that you are loading it), it might well be the culprit.

----------

## Pes88

```

However, irrespectively of whether panic or not, a good first stab it fixing it is to let the system run for prolonged time (e.g. updating) without any video drivers or X, just a plain VGA terminal; if it doesn't freeze, you know it is video. As you have an intel IGP in addition to your nvidia optimus, try deactivting nouveau in the kernel config (your dmesg shows that you are loading it), it might well be the culprit.

```

I have been using the pc in graphic mode for more than 4 hours and nothing happened, so I can't exclude the graphing driver if anything happens when I'm using in shell mode!  

it's completely random and I am getting crazy trying to figure out who is the culprit.   :Sad: 

I have substituted the driver nouveau in Ubuntu with the Nvidia official and I have installed bubblee to try to use the Optimums technology but in spite of this,  the problem still persists. 

 *Quote:*   

> 
> 
> Another test would be to activate magic sysrq in the kernel config and try the various key combinations in /usr/src/linux/Documentation/sysrq.txt
> 
> 

 

This might be  useful, should the key-code work  even though the pc is freezed?

I can't understand if it's a kernel panic or a freeze, actually  I don't think it's worth it.. The important thing is just fix it!

----------

## DirtyHairy

I disagree with your opinion of disabling graphics being useless. As you can't get any log data from the incidents, your only way of nailing down the problem and solving it is to systematically simplify your configuration piecemeal and try to provoke the crash after each change long enough that you can be confident that it is gone. Other than that, you can just hope for a kernel change mysteriously solving the issue, which might or might not happen. In the worst case, the issue might be a hardware problem, but I doubt this.

For starters, take your discrete nvidia chip completely out of the equation by removing all drivers for it; your IGP will still work, but when it crashes, you will have excluded the nvidia. Then go to the plain terminal, as I told you, then remove more hardware drivers (wifi, network, you get the idea) until you get a configuration which seems to run stable. After that, you can start to look for a fix. I know that this is slow and painful, but it is the only reliable thing to do in absence of a log.

The only other pointer I can give you is to try aquiring a log of the hang, either using ssh (if the machine still responds), a serial console or netconsole. You can also run memcheck to check for memory and / or CPU issues. BIOS update is another desparate thing to try. As for the magic sysrq: if it doesn't work, you can be confident that something serious has happened and the kernel has panicked or hung. I don't think you can reliably deduce anything on the system state if it works though.

----------

