From nobody@FreeBSD.org  Sun Oct 28 07:27:47 2007
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 07CE316A419
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 28 Oct 2007 07:27:47 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id EC5EA13C4A5
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 28 Oct 2007 07:27:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l9S7RC0u045977
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 28 Oct 2007 07:27:12 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.1/8.14.1/Submit) id l9S7RCWJ045976;
	Sun, 28 Oct 2007 07:27:12 GMT
	(envelope-from nobody)
Message-Id: <200710280727.l9S7RCWJ045976@www.freebsd.org>
Date: Sun, 28 Oct 2007 07:27:12 GMT
From: Jessica Mahoney <root@varusonline.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Kernel panic on hot battery insertion
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         117591
>Category:       kern
>Synopsis:       [acpi][panic] Divide by zero bug in ACPI
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jkim
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 28 07:30:00 UTC 2007
>Closed-Date:    Wed Jan 23 17:18:08 UTC 2008
>Last-Modified:  Wed Jan 23 17:18:08 UTC 2008
>Originator:     Jessica Mahoney
>Release:        7.0-BETA1
>Organization:
>Environment:
FreeBSD panther 7.0-BETA1 FreeBSD 7.0-BETA1 #2: Fri Oct 26 16:51:43 EDT 2007     root@panther:/usr/obj/usr/src/sys/PANTHER  i386
>Description:
I removed the battery from my laptop while it was running, then put it
back in the laptop.  Kernel fall down go boom (panic).  First happened
while I had Xorg+KDE running.  Panic occurred immediately, probably from
KLaptopDaemon as I didn't have any terminal windows open.  Secondary
test to confirm the issue was done without Xorg, running "acpiconf -i batt".

Fatal trap 18: integer divide fault while in kernel mode
cpuid = 0; apic id = 00
instruction pointer
stack pointer           = 0x20:0xc0ecc472
frame pointer           = 0x28:0xe3217ba0
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, def32 1, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 936 (acpiconf)
trap number             = 18
panic: integer divide fault
>How-To-Repeat:
While laptop is on, remove the battery, reinsert the battery, and get
battery information.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->acpi 
Responsible-Changed-By: kmacy 
Responsible-Changed-When: Fri Nov 16 18:16:05 UTC 2007 
Responsible-Changed-Why:  

assign to owner 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117591 
Responsible-Changed-From-To: acpi->freebsd-acpi 
Responsible-Changed-By: remko 
Responsible-Changed-When: Fri Nov 16 18:20:53 UTC 2007 
Responsible-Changed-Why:  
Assign to expanded group 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117591 

From: John Baldwin <jhb@freebsd.org>
To: bug-followup@freebsd.org, root@varusonline.com
Cc:  
Subject: Re: kern/117591: [acpi][panic] Divide by zero bug in ACPI
Date: Mon, 19 Nov 2007 14:07:39 -0500

 Can you get a stack trace?
 
 -- 
 John Baldwin

From: Jessica Mahoney <root@varusonline.com>
To: John Baldwin <jhb@freebsd.org>, bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/117591: [acpi][panic] Divide by zero bug in ACPI
Date: Mon, 19 Nov 2007 17:06:40 -0500

 John Baldwin wrote:
 > Can you get a stack trace?
 >
 >   
 Tracing pid 878 tid 100080 td 0xc3f26440
 acpi_battery_get_battinfo(c3a27980,c3ee4d00,e51e1c60,c3ee4d00,0,...) at 
 acpi_battery_get_battinfo+0x26f
 acpi_battery_ioctl(c0a44203,c3ee4d00,0,c40ec880,e51e1c08,...) at 
 acpi_battery_ioctl+0x14b
 acpiioctl(c3a9e900,c0a44203,c3ee4d00,3,c3f26440,...) at acpiioctl_0xdd
 devfs_ioctl_f(c3e35d80,c0a44203,c3ee4d00,c3ee5800,c3f26440,...) at 
 devfs_ioctl_f+0xcb
 kern_ioctl(c3f26440,3,c0a44203,c3ee4d00,1000a24,..._ at kern_ioctl+0x355
 ioctl(c3f26440,e51e1cfc,c,c3f26440,e51e1d2c,...) at ioctl+0x134
 syscall(e51e1d38) at syscall+0x345
 Xint0x80_syscall() at Xint0x80_syscall+0x20
 --- syscall (54, FreeBSD ELF32, ioctl), eip = 0x2815289b, esp = 
 0xbfbfec3c, ebp = 0xbfbfed28 ---
 
 If there's anything else needed, please let me know and I shall provide.
Responsible-Changed-From-To: freebsd-acpi->jkim 
Responsible-Changed-By: jkim 
Responsible-Changed-When: Tue Nov 20 18:29:31 UTC 2007 
Responsible-Changed-Why:  
I have a working patch.  Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117591 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/117591: commit references a PR
Date: Tue, 20 Nov 2007 18:35:41 +0000 (UTC)

 jkim        2007-11-20 18:35:36 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/dev/acpica       acpi_battery.c 
   Log:
   Check battery presence first before trying to get battery information.
   
   PR:             kern/117591
   Tested by:      Jessica Mahoney (root at varusonline dot com)
   
   Revision  Changes    Path
   1.26      +4 -3      src/sys/dev/acpica/acpi_battery.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: jkim 
State-Changed-When: Wed Jan 23 17:17:10 UTC 2008 
State-Changed-Why:  
The fix was MFC'd to RELENG_7 and RELENG_7_0. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=117591 
>Unformatted:
