From owner-freebsd-current Wed Apr 24 9:47:23 2002 Delivered-To: freebsd-current@freebsd.org Received: from h132-197-179-27.gte.com (h132-197-179-27.gte.com [132.197.179.27]) by hub.freebsd.org (Postfix) with ESMTP id 4F9FE37B400 for ; Wed, 24 Apr 2002 09:47:11 -0700 (PDT) Received: from kanpc.gte.com (localhost [IPv6:::1]) by h132-197-179-27.gte.com (8.12.3/8.12.3) with ESMTP id g3OGl9Fk000502 for ; Wed, 24 Apr 2002 12:47:10 -0400 (EDT) (envelope-from ak03@kanpc.gte.com) Received: (from ak03@localhost) by kanpc.gte.com (8.12.3/8.12.3/Submit) id g3OGl9CY000501; Wed, 24 Apr 2002 12:47:09 -0400 (EDT) Date: Wed, 24 Apr 2002 12:47:09 -0400 From: Alexander Kabaev To: current@freebsd.org Subject: CURRENT panic + patch Message-Id: <20020424124709.1b065bd5.ak03@gte.com> Organization: Verizon Data Services X-Mailer: Sylpheed version 0.7.4claws95 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Calling freeenv with the pointerm different from one received from getenv seldom is a good idea :) Indeed, CURRENT panics with the following stack trace (patch below fixes that): _mtx_lock_sleep(c08300e4,0,c03644b1,649,c08300e4) at _mtx_lock_sleep+0x122 _mtx_lock_flags(c08300e4,0,c03644b1,649,c03a7b60) at _mtx_lock_flags+0x67 uma_zfree_arg(c0830000,cca34d5f,cca34ef8,cca34d5f,5) at uma_zfree_arg+0x3e free(cca34d5f,c03a7b60,c04ddc44,c015d9ce,cca34d5f) at free+0x6c freeenv(cca34d5f,cca41070,cc3d5100,c04ddc60,c04ddc64) at freeenv+0x1a acpi_disabled(c0326287) at acpi_disabled+0x96 acpi_ec_probe(ccac1100,ccac1100,cc3d5100,ccac1100,0) at acpi_ec_probe+0x96 device_probe_child(cc3d5100,ccac1100,ccac1100,cc3d5100,cc3d5100) at device_probe_child+0xce device_probe_and_attach(ccac1100) at device_probe_and_attach+0x41 bus_generic_attach(cc3d5100,cc3d5100,c6d83f20,c6d83f00,c6d5a700) at bus_generic_attach+0x16 acpi_probe_children(cc3d5100) at acpi_probe_children+0x6a acpi_attach(cc3d5100,cc3d5100,cc3d5a00,cc3d5a00,1) at acpi_attach+0x2bd device_probe_and_attach(cc3d5100) at device_probe_and_attach+0x9a bus_generic_attach(cc3d5a00,cca6b090,cc3d5c80,c04ddd5c,c020ad66) at bus_generic_attach+0x16 nexus_attach(cc3d5a00,cc3d5a00,c037ace4,4e2000,1) at nexus_attach+0xe device_probe_and_attach(cc3d5a00) at device_probe_and_attach+0x9a root_bus_configure(cc3d5c80,c03675a0,0,4) at root_bus_configure+0x16 configure(0,4dac00,4da000,0,c0130d3c) at configure+0x22 mi_startup() at mi_startup+0x95 begin() at begin+0x43 Index: acpi.c =================================================================== RCS file: /usr/ncvs/src/sys/dev/acpica/acpi.c,v retrieving revision 1.60 diff -u -r1.60 acpi.c --- acpi.c 19 Apr 2002 23:36:38 -0000 1.60 +++ acpi.c 24 Apr 2002 16:33:24 -0000 @@ -1590,17 +1590,18 @@ int acpi_disabled(char *subsys) { - char *cp; + char *cp, *env; int len; - if ((cp = getenv("debug.acpi.disable")) == NULL) + if ((env = getenv("debug.acpi.disable")) == NULL) return(0); - if (!strcmp(cp, "all")) { - freeenv(cp); + if (!strcmp(env, "all")) { + freeenv(env); return(1); } /* scan the disable list checking for a match */ + cp = env; for (;;) { while ((*cp != 0) && isspace(*cp)) cp++; @@ -1610,12 +1611,12 @@ while ((cp[len] != 0) && !isspace(cp[len])) len++; if (!strncmp(cp, subsys, len)) { - freeenv(cp); + freeenv(env); return(1); } cp += len; } - freeenv(cp); + freeenv(env); return(0); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message