overdue-scratch

Author Topic: KP when on battery  (Read 9351 times)

0 Members and 1 Guest are viewing this topic.

syntr0py

  • Entrant
  • Posts: 6
KP when on battery
« on: March 03, 2010, 07:11:02 PM »
Hi there,

I'm running the latest version of VoodooBattery on Snow Leopard in 64 bit mode on a HP 8510w, and it works well, except I get occasional kernel panics when on battery, which makes the kext unusable (unfortuntely, AppleACPIBatteryManager.kext is no option, either, all 64 bit versions I found caused KPs during boot). The KP looks like this:
----------- 8< ----------
panic (cpu 0 caller 0xffffff80002ccf74): Kernel trap at 0x0000000000000000, type 14=page fault, registers:
....
Backtrace continues
Kernel Extensions in backtrace (with dependencies):
  com.superhai.driver.VoodooBattery(1.3.2)@0xff....
    dependency: com.apple.iokit.IOACPIFamily(1.3.0)@0xff...
  com.apple.driver.AppleACPIPlatform(1.3)@0xff...
    dependency: com.apple.iokit.IOACPIFamily(1.3.0)@0xff...
    dependency: com.apple.iokit.IOPCIFamily(2.6)@0xff...

BSD process name corresponding to current thread: kernel_task

Mac OS version:
10C540

Kernel version:
Darwin Kernel Version 10.2.0: Tue Nov  3 10:35:19 PST 2009; root:xnu-1486.2.11~1/RELEASE_X86_64
----------- 8< ----------
Any idea what could be wrong? Is there anything I need to post to help you help me?

Thanks!

P.S.: is the source code of VoodooBattery available?

syntr0py

  • Entrant
  • Posts: 6
Re: KP when on battery
« Reply #1 on: March 03, 2010, 07:38:49 PM »
Some more info:

- the machine is rock stable without the VoodooBattery kext
- VoodooBattery reliably crashes the machine when on battery, but sometimes it's right after boot, sometimes after 5 or 10 minutes
- no crash when connected to the power adapter
- got KPs with slight variations (e.g. type 6=invalid opcode instead of type 14=page fault)
- the 32 bit mode crashes with the same symptoms

This pretty much sucks because otherwise this machine runs SL almost as well as a real Mac...

Superhai

  • VoodooLabs
  • Posts: 102
Re: KP when on battery
« Reply #2 on: March 04, 2010, 09:29:11 PM »
....

I need that info you omitted from the kp. Also you can run the debug version (http://www.superhai.com/debug-darwin.html) and look for the last messages from the kext before it panics.

syntr0py

  • Entrant
  • Posts: 6
Re: KP when on battery
« Reply #3 on: March 10, 2010, 04:23:30 PM »
Using the debug version, I got another KP, and I shot two pictures of it (attached). One is the output of
"tail -f /var/log/kernel" as it stopped during the KP.
Pretty weird that VoodooBattery detects two batteries. It seems my DSDT contains two battery devices (PNP0C0A).

Thanks for trying to help.

syntr0py

  • Entrant
  • Posts: 6
Re: KP when on battery
« Reply #4 on: March 10, 2010, 04:27:04 PM »
It seems the forum cuts off part of my pics (at least in Firefox/Mac), but if you download them to your drive, they are complete.

Superhai

  • VoodooLabs
  • Posts: 102
Re: KP when on battery
« Reply #5 on: March 10, 2010, 09:02:22 PM »
It seems the forum cuts off part of my pics (at least in Firefox/Mac), but if you download them to your drive, they are complete.

It is ok, at least in Safari you can scroll the picture. It is interesting that it tries to execute at address 0. Either an odd jump or it might be some return address that gets overwritten for some reason. I will take a closer look later. If you have kp that differs, please post them as well. And also I recommend to change the id to some MacBook or MacBookPro and ensure that system id is set to laptop.

syntr0py

  • Entrant
  • Posts: 6
Re: KP when on battery
« Reply #6 on: March 13, 2010, 01:37:47 AM »
Here's another kp, again with kernel.log.

Thanks for the ID hint, I set it to MacBookPro3,1, and I also set the SMbiosversion to some value I found on the net. Let's see if it helps.

Thank you.

JudasD

  • Entrant
  • Posts: 1
Re: KP when on battery
« Reply #7 on: March 13, 2010, 03:36:25 AM »
How do you set the system id?  where can you ever read what the current system id is?  I don't see anything like that is profiler.

Thanks,
JD

It seems the forum cuts off part of my pics (at least in Firefox/Mac), but if you download them to your drive, they are complete.

It is ok, at least in Safari you can scroll the picture. It is interesting that it tries to execute at address 0. Either an odd jump or it might be some return address that gets overwritten for some reason. I will take a closer look later. If you have kp that differs, please post them as well. And also I recommend to change the id to some MacBook or MacBookPro and ensure that system id is set to laptop.

Superhai

  • VoodooLabs
  • Posts: 102
Re: KP when on battery
« Reply #8 on: March 13, 2010, 09:09:21 PM »
You find it in ioreg I think it is called system-type and should be 2 for a laptop.
Also have you changed any other ACPI related kext on your machine?

syntr0py

  • Entrant
  • Posts: 6
Re: KP when on battery
« Reply #9 on: March 14, 2010, 12:13:43 PM »
Doesn't seem to have anything to do with the system type or the ID. I have them set as 2 and MacBookPro3,1, and I jut got another kp (see the attached pic, again kernel trap at 0x0).

I haven't changed any ACPI kexts. I had added AppleACPIPS2Nub.kext and EvOreboot.kext.

I attached the kp screenshot, as well as an ioreg output. Hope it helps diagnose the problem.

Is there any other battery related kext I could give a try?

Thanks.

Superhai

  • VoodooLabs
  • Posts: 102
Re: KP when on battery
« Reply #10 on: March 14, 2010, 07:49:20 PM »
Ok, I think I know approximately where it does happen, but not why. A problem might be that it is not something inside the kext but within one of apples kexts or the kernel. There is something that is overwriting a return address. If you see on the backtrace, the fourth return address is the culprit. I believe the reason you get an invalid opcode occasionally is because the return address is overwritten with a valid address but to some non code address. So it is caused by the same bug as the page fault kp.

1) Are you 100% sure it always happens when on battery? Not just after or before A/C connected or disconnected?
2) It can't be completely random as it does seem to be the same every time. Are you able to see some pattern? Like a special charge level or something other particular event happening? It might be difficult to spot as alot happens under the hood.
3) You said the other battery kexts paniced immediately, can you post a picture of one of those panics and which kext causes it?
4) It might help if you can post some of the panics from running in 32 bit, and also some more from 64 bit to find some patterns.

zhengbo0409

  • Entrant
  • Posts: 1
Re: KP when on battery
« Reply #11 on: May 04, 2010, 04:12:37 PM »
my situation is same as you ....so i don't show battery any more....

Ludens

  • Entrant
  • Posts: 1
Re: KP when on battery
« Reply #12 on: August 04, 2010, 11:21:49 AM »
kernel panic is caused by conflict between AppleACPIPS2Nub.kext and VoodooBattery.kext

when I boot 32-bit, I use VoodooPS2Controller 0.98 32-bit from this forum
all is ok with battery

when I switch to 64-bit, I use VoodooPS2Controller 0.98 32/64-bit from here:
http://www.insanelymac.com/forum/index.php?showtopic=175372
it forces to use AppleACPIPS2Nub.kext and gives kernel panic when battery is low