# Resolving a kernel panic on a working system

## gohmdoree

I have a dedicated machine somewhere and started seeing issues yesterday.  I was given KVM access but that was spotty and noticed some network type of attack from local to local.  A reboot request got that fixed.  

All seemed fine until later in the night where access was lost again.  The tech on site said that the machine had experienced some kind of a kernel panic and had rebooted to a livecd for me to try and diagnose.

Any pointers where to start?  I had looked at /var/log/messages but didn't see anything from the day before.  Not sure where else to start.  I do experience some Segfaults when emerging a world update.

----------

## gohmdoree

I have logs up to afternoon May 31, but it doesn't start again until Jun 2 afternoon.  Maybe can be thought of as maybe compromised?  The machine was down most of yesterday though.  At least from my pov.

----------

## chithanh

If it is a recurring issue, you can capture the kernel panic with a kdump kernel. This kernel is called via kexec() on panic and allows you to take a memory snapshot for further debugging. Check /usr/src/linux/Documentation/kdump/ for details.

----------

## Hu

I suppose the technician did not record the kernel panic text before resetting the machine?

When you experience problems updating world, are they reproducible or are they random?

----------

## gohmdoree

I'll look into capturing that kernel panic.

No the tech didn't record anything.  I had asked a few times, but no mention of it.

It happens randomly when doing an emerge world, and not all the time.  Usually, I just rerun emerge world and it goes through fine.  I think at one point they said that there was a heat issue.

----------

## chithanh

If you suspect that the CPU may be overheating, you can try to limit its maximum frequency using /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq . This needs CPU frequency scaling and PowerNow (AMD) or ACPI p-states (Intel) enabled in your kernel.

----------

## gohmdoree

Thanks for the great tips chithanh.

Will have to give it a go.  Traveling so will try when I have access again.

----------

