From owner-freebsd-i386@FreeBSD.ORG Mon Mar 24 20:10:04 2008 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16FAF1065673 for ; Mon, 24 Mar 2008 20:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id DF9318FC19 for ; Mon, 24 Mar 2008 20:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m2OKA3ov043091 for ; Mon, 24 Mar 2008 20:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m2OKA3oh043090; Mon, 24 Mar 2008 20:10:03 GMT (envelope-from gnats) Resent-Date: Mon, 24 Mar 2008 20:10:03 GMT Resent-Message-Id: <200803242010.m2OKA3oh043090@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Jorge Niedbalski R." Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFE84106566C for ; Mon, 24 Mar 2008 20:05: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 D6E868FC13 for ; Mon, 24 Mar 2008 20:05:47 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m2OK5bGe033331 for ; Mon, 24 Mar 2008 20:05:37 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m2OK5bAC033330; Mon, 24 Mar 2008 20:05:37 GMT (envelope-from nobody) Message-Id: <200803242005.m2OK5bAC033330@www.freebsd.org> Date: Mon, 24 Mar 2008 20:05:37 GMT From: "Jorge Niedbalski R." To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: i386/122056: Acpi battery ioctl interface integer divide fault X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Mar 2008 20:10:04 -0000 >Number: 122056 >Category: i386 >Synopsis: Acpi battery ioctl interface integer divide fault >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 24 20:10:03 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Jorge Niedbalski R. >Release: 7.0-RELEASE >Organization: IP6 >Environment: FreeBSD saqsaywaman.int.ip6nw.com 7.0-RELEASE FreeBSD 7.0-RELEASE #1: Fri Mar 21 01:03:48 BRT 2008 root@:/usr/obj/usr/src/sys/GENERIC i386 >Description: Using the ioctl interface provided for manipulating /dev/acpi pseudo-device , in particular the ACPIIO_BATT_GET_BATTINFO request give me a integer divide kernel fault exception. The computer sysctl oids acpi information : hw.acpi.supported_sleep_state: S3 S4 S5 hw.acpi.power_button_state: S5 hw.acpi.sleep_button_state: S3 hw.acpi.lid_switch_state: NONE hw.acpi.standby_state: S1 hw.acpi.suspend_state: S3 hw.acpi.sleep_delay: 1 hw.acpi.s4bios: 0 hw.acpi.verbose: 0 hw.acpi.disable_on_reboot: 0 hw.acpi.handle_reboot: 0 hw.acpi.reset_video: 0 hw.acpi.cpu.cx_lowest: C1 hw.acpi.acline: 1 hw.acpi.battery.life: 100 hw.acpi.battery.time: -1 hw.acpi.battery.state: 0 hw.acpi.battery.units: 1 hw.acpi.battery.info_expire: 5 hw.acpi.thermal.min_runtime: 0 hw.acpi.thermal.polling_rate: 10 hw.acpi.thermal.user_override: 0 hw.acpi.thermal.tz0.temperature: 52.0C hw.acpi.thermal.tz0.active: -1 hw.acpi.thermal.tz0.passive_cooling: 1 hw.acpi.thermal.tz0.thermal_flags: 0 hw.acpi.thermal.tz0._PSV: 88.0C hw.acpi.thermal.tz0._HOT: 95.0C hw.acpi.thermal.tz0._CRT: -1 hw.acpi.thermal.tz0._ACx: -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 >How-To-Repeat: To repeat the problem, follow the next steps : 1) Connect the AC power cable to the computer, 2) Remove the battery from the computer. 3) Reconnect the battery to the computer 4) Request a ioctl ACPIIO_BATT_GET_BATTINFO to the /dev/acpi device like this function : (where fd is a reference to a open filedescriptor with /dev/acpi (in RO mode)) int get_battery_status(int *fd, short number) { union acpi_battery_ioctl_arg battio; battio.unit = number; if(ioctl(*fd, ACPIIO_BATT_GET_BATTINFO, &battio) == -1) { return -1; } if(battio.battinfo.state == ACPI_BATT_STAT_NOT_PRESENT) { return -1; } return 0; } >Fix: >Release-Note: >Audit-Trail: >Unformatted: