Opened 15 years ago

Closed 15 years ago

#4281 closed bug (fixed)

[acpi_battery] vm_soft_fault + vm_page_fault in ReadBatteryStatus()

Reported by: michael.weirauch Owned by: czeidler
Priority: normal Milestone: R1
Component: Drivers Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: x86

Description

hrev32497;gcc4;ata-bm;acpi; specs here and here

fresh install; happened on using TextSearch Tracker add-on (likely unrelated)

The first two lines in the screenshot are the last two lines of syslog ouput followed by a bt

Attachments (4)

haiku-r32497-acpi_battery-vm_page_fault.jpg (285.7 KB ) - added by michael.weirauch 15 years ago.
acpi_battery.cpp.patch (6.0 KB ) - added by phoudoin 15 years ago.
Patch to add missing user_memcpy and some safety checks.
haiku-gcc4-trunk-r32667-acpi_battery-freeze.jpg (248.1 KB ) - added by michael.weirauch 15 years ago.
haiku-gcc4-trunk-r32667-acpi_battery-kdl.jpg (104.5 KB ) - added by michael.weirauch 15 years ago.

Download all attachments as: .zip

Change History (17)

by michael.weirauch, 15 years ago

comment:1 by anevilyak, 15 years ago

Possibly related to #4152?

in reply to:  1 comment:2 by michael.weirauch, 15 years ago

Replying to anevilyak:

Possibly related to #4152?

Hi Rene, at least I don't seem to have any syslog output about global lock issues. No idea if that one is "technically" related.

comment:3 by anevilyak, 15 years ago

Yeah, I'm wondering if they're different symptoms of the same underlying problems or not...

comment:4 by michael.weirauch, 15 years ago

Luckily, I was just able to reproduce this with the TextSearch add-on. Happened on a second search after a longer lasting first search through the trunk/headers.

Backtrace looks exactly the same.

Suspiciously an issued reboot freezes the system immedeately, which might be just a coincidence, but I do experience complete freezes described in #3772.

comment:5 by michael.weirauch, 15 years ago

And another KDL. Just right out of the blue. This time, the KDL showed up, and the system was in a frozen state immedeately.

Really wondering if this might indeed point to some underlying ACPI issues which just show up more "aggressively" on my system.

comment:6 by phoudoin, 15 years ago

At least, acpi_battery::ReadBatteryStatus doesn't do much check before assuming the ACPI object returned is

  • a package
  • have indeed 4 sub-objects packaged in it
  • all are of integer type.

Last but not least, there is no user_memcpy() to return data to userland. AFAIK and unlike BeOS, Haiku don't lock automatically the memory handed to a driver by the userland caller. Under massive activity, maybe it's logical the userland page is not there...

comment:7 by axeld, 15 years ago

Owner: changed from axeld to czeidler

by phoudoin, 15 years ago

Attachment: acpi_battery.cpp.patch added

Patch to add missing user_memcpy and some safety checks.

comment:8 by phoudoin, 15 years ago

Again, I'm not at home to check this patch, so it's untested. But missing user_memcpy and frequent calls doesn't match great...

comment:9 by michael.weirauch, 15 years ago

Hi Philippe,

I have issues applying the patch:

michael@think:/store/data/devel/haiku/svn/trunk> patch -i ../../_patches/acpi_battery.cpp.patch --verbose --verbose -p5 --dry-run
Hmm...  Looks like a unified diff to me...
(Stripping trailing CRs from patch.)
The text leading up to this was:
--------------------------
|--- /Data/projects/haiku/trunk/src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.cpp (revision 31481)
|+++ /Data/projects/haiku/trunk/src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.cpp (working copy)
--------------------------
Patching file src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.cpp using Plan A...
Hunk #1 succeeded at 49.
Hunk #2 succeeded at 94.
patch: **** malformed patch at line 165: 

comment:10 by michael.weirauch, 15 years ago

Thanks to Philippe,

the segfault is apparently fixed with hrev32584. Would consider this one closeable.

I now for the first time saw a lot of ACPI erros in the syslog before the system froze. Is probably a candidate for another bug report.

Michael

comment:11 by michael.weirauch, 15 years ago

Please ignore the previous message...

Attached two shots. One with a freeze and some syslog output full of ACPI errors, the other with a KDL where the last lines of syslog are shown with ACPI erros. The backtrace for the KDL one was ommited because it resembled the ones already given in the ticket.

What is new for me is the ACPI output in the syslogs. Not seen any ACPI related stuff ever before IIRC.

by michael.weirauch, 15 years ago

by michael.weirauch, 15 years ago

comment:12 by michael.weirauch, 15 years ago

hrev33299-trunk-gcc4;

I've now grepped (TextSearch) the trunk/src for stdio and trunk/headers for l2cap several times with PowerStatus and acpi_battery installed. No syslog errors, no KDL, no freeze. Would consider this one fixed for real with the recent acpi changes.

comment:13 by czeidler, 15 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.