From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 11 06:32:34 2012 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 463EF106566B; Tue, 11 Sep 2012 06:32:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2EF7D8FC12; Tue, 11 Sep 2012 06:32:32 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA18870; Tue, 11 Sep 2012 09:32:31 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TBK1P-00020O-FI; Tue, 11 Sep 2012 09:32:31 +0300 Message-ID: <504EDAFE.3000601@FreeBSD.org> Date: Tue, 11 Sep 2012 09:32:30 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120901 Thunderbird/15.0 MIME-Version: 1.0 To: "freebsd-acpi@freebsd.org" X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=X-VIET-VPS Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org Subject: do we always have acpi_cpu for a cpu? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Sep 2012 06:32:34 -0000 I think that we always expect to have a one-to-one correspondence between acpi_cpu devices and actual (APIC) CPUs. acpi_pcpu_get_id() seems to even assert that, if I am reading the code correctly. The following patch adds the assert to acpi_cpu_idle as well and also removes what I believe to be an obsolete comment about HTT CPUs. acpi_cpu: expect every cpu to have a corresponding acpi_cpu object ... via Processor object in ASL namespace. diff --git a/sys/dev/acpica/acpi_cpu.c b/sys/dev/acpica/acpi_cpu.c index 15201f9..203ed02 100644 --- a/sys/dev/acpica/acpi_cpu.c +++ b/sys/dev/acpica/acpi_cpu.c @@ -925,23 +925,15 @@ acpi_cpu_idle() uint32_t start_time, end_time; int bm_active, cx_next_idx, i; + sc = cpu_softc[PCPU_GET(cpuid)]; + KASSERT(sc != NULL, ("acpi_cpu_idle: CPU without ACPI CPU")); + /* If disabled, return immediately. */ if (cpu_disable_idle) { ACPI_ENABLE_IRQS(); return; } - /* - * Look up our CPU id to get our softc. If it's NULL, we'll use C1 - * since there is no ACPI processor object for this CPU. This occurs - * for logical CPUs in the HTT case. - */ - sc = cpu_softc[PCPU_GET(cpuid)]; - if (sc == NULL) { - acpi_cpu_c1(); - return; - } - /* Find the lowest state that has small enough latency. */ cx_next_idx = 0; if (cpu_disable_deep_sleep) -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 12 20:33:33 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4781B106564A for ; Wed, 12 Sep 2012 20:33:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 1C79D8FC08 for ; Wed, 12 Sep 2012 20:33:33 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6C1DCB91E; Wed, 12 Sep 2012 16:33:32 -0400 (EDT) From: John Baldwin To: Mark Felder Date: Wed, 12 Sep 2012 15:20:26 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> In-Reply-To: <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201209121520.26337.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 12 Sep 2012 16:33:32 -0400 (EDT) Cc: freebsd-hackers@freebsd.org Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2012 20:33:33 -0000 On Wednesday, June 06, 2012 9:34:02 pm Mark Felder wrote: > Hi guys I'm excitedly posting this from my phone. Good news for you guys, bad news for us -- we were building HA storage on vmware for a client and can now replicate the crash on demand. I'll be posting details when I get home to my PC tonight, but this hopefully is enough to replicate the crash for any curious followers: > > ESXi 5 > 9 or 9-STABLE > HAST > 1 cpu is fine > 1GB of ram > UFS SUJ on HAST device > No special loader.conf, sysctl, etc > No need for VMWare tools > Run Bonnie++ on the HAST device > > We can get the crash to happen on the first run of bonnie++ right now. I'll post the exact specs and precise command run in the PR. We found an old post from 2004 when we looked up the process state obtained from CTRL+T -- flswai -- which describes the symptoms nearly perfectly. > > http://unix.derkeiler.com/Mailing-Lists/FreeBSD/stable/2004-02/0250.html > > Hopefully this gets us closer to a fix... Sorry, I just now saw this. :( Are you still seeing this, and if so can you get a crashdump? Also, I'm curious if you only see this with SUJ or if plain UFS+SU works fine? -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 13 14:27:57 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 709851065703; Thu, 13 Sep 2012 14:27:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 45E278FC0A; Thu, 13 Sep 2012 14:27:57 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 915A7B989; Thu, 13 Sep 2012 10:27:56 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 13 Sep 2012 10:22:24 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p17; KDE/4.5.5; amd64; ; ) References: <504910CB.8050007@FreeBSD.org> <201209071048.39664.jhb@freebsd.org> In-Reply-To: <201209071048.39664.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201209131022.24898.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 13 Sep 2012 10:27:56 -0400 (EDT) Cc: Navdeep Parhar Subject: Re: Order in which a driver attaches to devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 14:27:57 -0000 On Friday, September 07, 2012 10:48:39 am John Baldwin wrote: > On Thursday, September 06, 2012 5:08:27 pm Navdeep Parhar wrote: > > I have a system with multiple cards supported by cxgbe(4). When I build > > a kernel with the driver compiled in, it attaches to the cards in a > > different order from when it's loaded as a module. Why? The network > > interfaces get re-ordered and this is quite annoying. > > Hmmmm. The boot time probe does a depth first walk of the PCI bus. This is > what is suggested by PCI-SIG for enumerating PCI buses (and is normally how > BIOSs walk the bus assigning bus numbers). The walk that is done at kldload > time walks the 'pciX' bus devices in numerical order (rather than walking the > tree). I suspect your BIOS is doing something weird and assigning bus numbers > in a non-depth first ordering so that the two orderings are not consisent as > they are on other machines. BTW, another fix is to stop trying to force unit numbers to patch PCI bus numbers (e.g. change pcib_attach() in pci_pci.c to use -1 instead of sc->secbus). A few other places would need to be changed as well: acpi_pcib_attach(), legacy_pcib_attach(), qpi_pcib_attach(), mptable_hostb_attach(). If we went this route we should probably do it on other platforms as well. (Some, such as sparc64 already do this.) -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 13 14:51:07 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CBA7106564A; Thu, 13 Sep 2012 14:51:07 +0000 (UTC) (envelope-from feld@feld.me) Received: from feld.me (unknown [IPv6:2607:f4e0:100:300::2]) by mx1.freebsd.org (Postfix) with ESMTP id CB3788FC08; Thu, 13 Sep 2012 14:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=feld.me; s=blargle; h=In-Reply-To:Message-Id:From:Mime-Version:Date:References:Subject:Cc:To:Content-Type; bh=5zUUiytYVs4kQmMvhjyr5wJCuq9bUoWbkhAPNDNp8BY=; b=OshIgccLrLeSLoOHrL8nij1GolPbCr3EaBYKHr81sTtz0RSdTEI7iXYpNFG4Pv2hmO6f5z+xEpbNRcnrUMFZluerw319UawvhJIuRhEh8qqrXhZUey1mDmlpGz8Bd7bb; Received: from localhost ([127.0.0.1] helo=mwi1.coffeenet.org) by feld.me with esmtp (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TCAks-0006MI-UP; Thu, 13 Sep 2012 09:51:05 -0500 Received: from feld@feld.me by mwi1.coffeenet.org (Archiveopteryx 3.1.4) with esmtpa id 1347547852-3100-3099/5/1; Thu, 13 Sep 2012 14:50:52 +0000 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: John Baldwin References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> Date: Thu, 13 Sep 2012 09:50:51 -0500 Mime-Version: 1.0 From: Mark Felder Message-Id: In-Reply-To: <201209121520.26337.jhb@freebsd.org> User-Agent: Opera Mail/12.02 (FreeBSD) X-SA-Report: ALL_TRUSTED=-1, KHOP_THREADED=-0.5 X-SA-Score: -1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 14:51:07 -0000 On Wed, 12 Sep 2012 14:20:26 -0500, John Baldwin wrote: > Are you still seeing this, and if so can you get a crashdump? Also, I'm > curious if you only see this with SUJ or if plain UFS+SU works fine? The crash on demand right now is producable on 8.x and 9.x, so SUJ isn't a requirement. Also, there is no crashdump available. The OS just hangs and stops taking input. There's no panic or coredump or anything of the like. You just have to nuke the VM and re-boot it back up. And for the record we can't reproduce this crash in Xen... From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 13 15:11:43 2012 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10D2E106566B; Thu, 13 Sep 2012 15:11:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2A9698FC0A; Thu, 13 Sep 2012 15:11:41 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id SAA27161; Thu, 13 Sep 2012 18:11:28 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <5051F7A0.90901@FreeBSD.org> Date: Thu, 13 Sep 2012 18:11:28 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120830 Thunderbird/15.0 MIME-Version: 1.0 To: Mark Felder References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org, John Baldwin Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 15:11:43 -0000 on 13/09/2012 17:50 Mark Felder said the following: > On Wed, 12 Sep 2012 14:20:26 -0500, John Baldwin wrote: > >> Are you still seeing this, and if so can you get a crashdump? Also, I'm >> curious if you only see this with SUJ or if plain UFS+SU works fine? > > The crash on demand right now is producable on 8.x and 9.x, so SUJ isn't a > requirement. Also, there is no crashdump available. The OS just hangs and stops > taking input. There's no panic or coredump or anything of the like. You just have > to nuke the VM and re-boot it back up. > > And for the record we can't reproduce this crash in Xen... Just curious - does VMWare provide a remote debugger support (gdb stub)? -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 13 16:15:05 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBC25106566B; Thu, 13 Sep 2012 16:15:04 +0000 (UTC) (envelope-from feld@feld.me) Received: from feld.me (unknown [IPv6:2607:f4e0:100:300::2]) by mx1.freebsd.org (Postfix) with ESMTP id A68198FC0A; Thu, 13 Sep 2012 16:15:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=feld.me; s=blargle; h=In-Reply-To:Message-Id:From:Mime-Version:Date:References:Subject:Cc:To:Content-Type; bh=PcrRuuQj/nIJn0EsVeapRkbWqtiBtRXVv/8UXT8Ocxs=; b=bvnSgVfAeyZQW6v12MSOAgcylVFPqfNZCFEIjfhpX2/k5TwfOZsGemNNk4Tlu+xPVYSed6cjr/7EWZ0lnk458UVGCeocgJCmaRj39XYsy8DWDqTkjHGS+PBiaMe7FRYL; Received: from localhost ([127.0.0.1] helo=mwi1.coffeenet.org) by feld.me with esmtp (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TCC48-0007pm-5q; Thu, 13 Sep 2012 11:15:03 -0500 Received: from feld@feld.me by mwi1.coffeenet.org (Archiveopteryx 3.1.4) with esmtpa id 1347552890-3100-3099/5/2; Thu, 13 Sep 2012 16:14:50 +0000 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: Andriy Gapon References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> Date: Thu, 13 Sep 2012 11:14:49 -0500 Mime-Version: 1.0 From: Mark Felder Message-Id: In-Reply-To: <5051F7A0.90901@FreeBSD.org> User-Agent: Opera Mail/12.02 (FreeBSD) X-SA-Report: ALL_TRUSTED=-1, KHOP_THREADED=-0.5 X-SA-Score: -1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 16:15:05 -0000 On Thu, 13 Sep 2012 10:11:28 -0500, Andriy Gapon wrote: > Just curious - does VMWare provide a remote debugger support (gdb stub)? I'm not aware of one. What I have been able to successfully do is break into the debugger during the hang but the info I've posted so far has not been relevant to anyone. I'm hoping someone on the core team will eventually be able to follow my guide and figure out what went wrong. From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 13 16:28:32 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF8071065670; Thu, 13 Sep 2012 16:28:31 +0000 (UTC) (envelope-from lidl@hydra.pix.net) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254:10::3c]) by mx1.freebsd.org (Postfix) with ESMTP id BE6368FC12; Thu, 13 Sep 2012 16:28:31 +0000 (UTC) Received: from hydra.pix.net (localhost [127.0.0.1]) by hydra.pix.net (8.14.5/8.14.5) with ESMTP id q8DGSFDe001313; Thu, 13 Sep 2012 12:28:15 -0400 (EDT) (envelope-from lidl@hydra.pix.net) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.97.5 at mail.pix.net Received: (from lidl@localhost) by hydra.pix.net (8.14.5/8.14.5/Submit) id q8DGSF2p001312; Thu, 13 Sep 2012 12:28:15 -0400 (EDT) (envelope-from lidl) Date: Thu, 13 Sep 2012 12:28:15 -0400 From: Kurt Lidl To: Mark Felder Message-ID: <20120913162815.GA1219@pix.net> References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Andriy Gapon Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 16:28:32 -0000 On Thu, Sep 13, 2012 at 11:14:49AM -0500, Mark Felder wrote: > On Thu, 13 Sep 2012 10:11:28 -0500, Andriy Gapon wrote: > > > Just curious - does VMWare provide a remote debugger support (gdb stub)? > > I'm not aware of one. What I have been able to successfully do is break > into the debugger during the hang but the info I've posted so far has not > been relevant to anyone. I'm hoping someone on the core team will > eventually be able to follow my guide and figure out what went wrong. Isn't this what you want? http://stackframe.blogspot.com/2007/04/debugging-linux-kernels-with.html -Kurt From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 13 19:57:57 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D1FC106566C; Thu, 13 Sep 2012 19:57:57 +0000 (UTC) (envelope-from feld@feld.me) Received: from feld.me (unknown [IPv6:2607:f4e0:100:300::2]) by mx1.freebsd.org (Postfix) with ESMTP id E192C8FC1A; Thu, 13 Sep 2012 19:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=feld.me; s=blargle; h=In-Reply-To:Message-Id:From:Mime-Version:Date:References:Subject:Cc:To:Content-Type; bh=yjhSIwqvqgSvVtXtgherjw3mcpXc74AWixWrt7fTQGE=; b=DxtAaaS+QyJano9HIHFtA9534dCZZQuQFfPtooxY4hIPHcrmoyL4CC5mH6b9tvB3vI21ob1tG1vzKEb5SW21zPS9a9fNJobcaIyQtDvi0MA8VkZsWXvAXa68Ag9UQJhm; Received: from localhost ([127.0.0.1] helo=mwi1.coffeenet.org) by feld.me with esmtp (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TCFXs-000BqH-Ca; Thu, 13 Sep 2012 14:57:55 -0500 Received: from feld@feld.me by mwi1.coffeenet.org (Archiveopteryx 3.1.4) with esmtpa id 1347566266-3100-3099/5/3; Thu, 13 Sep 2012 19:57:46 +0000 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: Kurt Lidl References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> <20120913162815.GA1219@pix.net> Date: Thu, 13 Sep 2012 14:57:46 -0500 Mime-Version: 1.0 From: Mark Felder Message-Id: In-Reply-To: <20120913162815.GA1219@pix.net> User-Agent: Opera Mail/12.02 (FreeBSD) X-SA-Report: ALL_TRUSTED=-1, KHOP_THREADED=-0.5 X-SA-Score: -1.5 Cc: freebsd-hackers@freebsd.org, Andriy Gapon Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 19:57:57 -0000 On Thu, 13 Sep 2012 11:28:15 -0500, Kurt Lidl wrote: > Isn't this what you want? > > http://stackframe.blogspot.com/2007/04/debugging-linux-kernels-with.html > > -Kurt Interesting -- it looks like that's an option on ESX as well. The only question is: what do I do with that? It's going to give me the debugging entire VM, not the kernel inside. Without being a VMWare developer I imagine its data will be a bit useless :-( From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 13 21:14:10 2012 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22CA21065673 for ; Thu, 13 Sep 2012 21:14:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 66E468FC12 for ; Thu, 13 Sep 2012 21:14:09 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA01113; Fri, 14 Sep 2012 00:13:14 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TCGio-000BBI-3V; Fri, 14 Sep 2012 00:13:14 +0300 Message-ID: <50524C67.3040403@FreeBSD.org> Date: Fri, 14 Sep 2012 00:13:11 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120901 Thunderbird/15.0 MIME-Version: 1.0 To: Mark Felder References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> <20120913162815.GA1219@pix.net> In-Reply-To: X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.org, Kurt Lidl Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 21:14:10 -0000 on 13/09/2012 22:57 Mark Felder said the following: > On Thu, 13 Sep 2012 11:28:15 -0500, Kurt Lidl wrote: > >> Isn't this what you want? >> >> http://stackframe.blogspot.com/2007/04/debugging-linux-kernels-with.html >> >> -Kurt > > Interesting -- it looks like that's an option on ESX as well. The only question > is: what do I do with that? It's going to give me the debugging entire VM, not > the kernel inside. Without being a VMWare developer I imagine its data will be a > bit useless :-( No, gdb stub is for debugging what is running inside the VM. E.g. look here for an example of how to do that with qemu: http://andriygapon.wikispaces.com/QemuSetup VMWare with gdb stub enabled should not be any different. -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 13 22:25:44 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1CA10106566B for ; Thu, 13 Sep 2012 22:25:44 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-qa0-f54.google.com (mail-qa0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id BC5D68FC14 for ; Thu, 13 Sep 2012 22:25:43 +0000 (UTC) Received: by qatn12 with SMTP id n12so2718424qat.13 for ; Thu, 13 Sep 2012 15:25:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to :x-gm-message-state; bh=CFHqtu2G69QOsPipBLFtKKFzxFHqtP9XqjM0hvHzhaA=; b=EihKrFWCKOZEquSzgJAFBg3IcDwt9l0qVzQGVwvMp1cCLTMdl0U29o2bGgMASwd/wO Zhf8ysPfgIhC99aXg91eB1ZxkYwj/kWqG3yY5mGsKAyAX8i9pj8dKRT+MiNFc+NzybgU 2i6OwL2WSzdteJf8/PUDqgbuYDnwZmOEf3ldmwnW+Z+liMlBX/IfMFZvgfdJ1lIFL83P E6hEqcN7TaHQoPZKe+6xFRKeKADT4Hy4aZiJd26PW61Z/Q8qlCuxXT40eh6pe5hupJov 3MYy6NXAW1Zd7g2gC+FysPYyuodZwbtcEIQpoS0jeP9G9LTROkEzJs/cFs4c1aKJ6Ycy abEw== Received: by 10.229.136.8 with SMTP id p8mr532417qct.3.1347575142453; Thu, 13 Sep 2012 15:25:42 -0700 (PDT) Received: from [97.20.106.248] (248.sub-97-20-106.myvzw.com. [97.20.106.248]) by mx.google.com with ESMTPS id ep8sm1316445qab.22.2012.09.13.15.25.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Sep 2012 15:25:41 -0700 (PDT) References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> <20120913162815.GA1219@pix.net> <50524C67.3040403@FreeBSD.org> In-Reply-To: <50524C67.3040403@FreeBSD.org> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPhone Mail (9B206) From: Mark Saad Date: Thu, 13 Sep 2012 18:25:38 -0400 To: Mark Felder X-Gm-Message-State: ALoCoQm7F/2jmoGPi8s/8UQjZSUKlsRUPdOJUBg6cK40g6SiJNb4K1ZPUL/LanfJ/Y2X6Fxw8Tfh Cc: "freebsd-hackers@FreeBSD.org" Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 22:25:44 -0000 --- On Sep 13, 2012, at 5:13 PM, Andriy Gapon wrote: > on 13/09/2012 22:57 Mark Felder said the following: >> On Thu, 13 Sep 2012 11:28:15 -0500, Kurt Lidl wrote: >>=20 >>> Isn't this what you want? >>>=20 >>> http://stackframe.blogspot.com/2007/04/debugging-linux-kernels-with.html= >>>=20 >>> -Kurt >>=20 >> Interesting -- it looks like that's an option on ESX as well. The only qu= estion >> is: what do I do with that? It's going to give me the debugging entire VM= , not >> the kernel inside. Without being a VMWare developer I imagine its data wi= ll be a >> bit useless :-( >=20 > No, gdb stub is for debugging what is running inside the VM. > E.g. look here for an example of how to do that with qemu: > http://andriygapon.wikispaces.com/QemuSetup > VMWare with gdb stub enabled should not be any different. >=20 > --=20 > Andriy Gapon > _____________________________ Mark did you try changing the time counter choice sysctl from hpet to Acpi-s= afe/fast or tsc ? In esx 4.1 an newer using hpet timers causes issues for b= sd and linux vms in some cases .=20 The sysctl is kern.timecounter.choice . This sounds like another VMware issu= es I have seen and read about . See this post http://forums.freebsd.org/arch= ive/index.php/t-32104.html --- Mark saad | mark.saad@longcount.org From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 13 23:45:57 2012 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 66746106564A for ; Thu, 13 Sep 2012 23:45:57 +0000 (UTC) (envelope-from feld@feld.me) Received: from feld.me (unknown [IPv6:2607:f4e0:100:300::2]) by mx1.freebsd.org (Postfix) with ESMTP id 24AD38FC08 for ; Thu, 13 Sep 2012 23:45:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=feld.me; s=blargle; h=Message-Id:Cc:To:Date:From:Subject:Content-Type:Content-Transfer-Encoding:Mime-Version:References:In-Reply-To; bh=8BTyQxbzrekq4bEscaxSLl+igvrMyZJ46Auoe5axoFM=; b=n0HOeS4ituKE+ShX1rJoTrzVs5bR1vKKKxbsvolYkm9pDkbGV+6wDz0kr7bPcCWqLFUSF86J+83s/Ux/2LArhTk52wPvT9DPQ/TfUfp3CUP2ssC2TmQ+75B24rN0KPEa; Received: from localhost ([127.0.0.1] helo=mwi1.coffeenet.org) by feld.me with esmtp (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TCJ6X-000Fwh-AF; Thu, 13 Sep 2012 18:45:56 -0500 Received: from feld@feld.me by mwi1.coffeenet.org (Archiveopteryx 3.1.4) with esmtpa id 1347579947-3100-3099/5/6; Thu, 13 Sep 2012 23:45:47 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> <20120913162815.GA1219@pix.net> <50524C67.3040403@FreeBSD.org> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 From: Mark Felder Date: Thu, 13 Sep 2012 18:45:28 -0500 To: Mark Saad Message-Id: <66357a32-b570-4dc3-a27c-d32903da41db@email.android.com> X-SA-Report: ALL_TRUSTED=-1, KHOP_THREADED=-0.5 X-SA-Score: -1.5 Cc: freebsd-hackers@FreeBSD.org Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 23:45:57 -0000 Changing timer source has not been tested. It doesn't crash in 7.x, so = did something timer related change in 8.x? From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 14 00:47:52 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0065C106564A for ; Fri, 14 Sep 2012 00:47:51 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9B14F8FC0A for ; Fri, 14 Sep 2012 00:47:51 +0000 (UTC) Received: by qcsg15 with SMTP id g15so3028030qcs.13 for ; Thu, 13 Sep 2012 17:47:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to :x-gm-message-state; bh=SpRbcHSw4IS8gZuWQLBgeH3zvBZRVEx3st1lAmkV5Ag=; b=eUACj9QHoCTZ3amc1ONsVMu0QBk+vbWAvoC6DcawupHLzoJ2oP4yuGtwHEfK1LW/P/ /2l3gEB2YiQ6mr0lJEkhm6aUhidTDVsclF7FiAOrhvqTH+xxh2qBgMAauSBe/YlFqq03 bpbT2TO3slCxQ3wD6PHTO2zInbZiy/x3Z2UnWAs+lmSUrJTW6I5JupW5Qbe8VCcvbd3Z Cwv5ylL5HHH4URi1CaaXGdxrkJLcQXtRrq7N3gYn8K1kig3Z1Lx7SfqzL4GCcNqMFusa pXANhxLJMABL3N/vZd9pkjNkF3KRae0GvmOqgAtZ1tKd8nM2qpYYKhRbKrKh4Y+qfotO qhrw== Received: by 10.224.203.193 with SMTP id fj1mr3514273qab.13.1347583670361; Thu, 13 Sep 2012 17:47:50 -0700 (PDT) Received: from [192.168.11.108] (ool-182c6d68.dyn.optonline.net. [24.44.109.104]) by mx.google.com with ESMTPS id e5sm387563qao.11.2012.09.13.17.47.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Sep 2012 17:47:49 -0700 (PDT) References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> <20120913162815.GA1219@pix.net> <50524C67.3040403@FreeBSD.org> <66357a32-b570-4dc3-a27c-d32903da41db@email.android.com> In-Reply-To: <66357a32-b570-4dc3-a27c-d32903da41db@email.android.com> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: X-Mailer: iPhone Mail (9B206) From: Mark Saad Date: Thu, 13 Sep 2012 20:47:47 -0400 To: Mark Felder X-Gm-Message-State: ALoCoQlvNz3ZjRGyDvrGd1YpTA0Z4fKKQk0VB7NB5TbcKe0LKa5MQtCD15Weal1L0OjmI97YpSSX Cc: "freebsd-hackers@FreeBSD.org" Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2012 00:47:52 -0000 --- On Sep 13, 2012, at 7:45 PM, Mark Felder wrote: > Changing timer source has not been tested. It doesn't crash in 7.x, so did= something timer related change in 8.x? >=20 Mark Yes the time counter choice priority changed , in 8 favoring higher precis= ion hardware like hpet over acpi-fast/safe . I am not sure why or when thus w= as done; or if this is a side effect of another change. Interestingly centos= /rhel/suse has made similar changes and VMware has odd issues with them as w= ell.=20 Can you boot up a 7 environment and get us the value sysctl kern.timecounter= . Then get that from an a 8 and 9 environment . Then if the 7 environment u= ses a different time counter can you try using that value on your crashing s= etup and report back what the result is .=20 --- Mark saad | mark.saad@longcount.org From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 14 05:32:45 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0670106564A for ; Fri, 14 Sep 2012 05:32:45 +0000 (UTC) (envelope-from vijju.singh@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 426F38FC08 for ; Fri, 14 Sep 2012 05:32:44 +0000 (UTC) Received: by eeke52 with SMTP id e52so2410371eek.13 for ; Thu, 13 Sep 2012 22:32:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=SzELcWZCTPl1FB3rabFksjAsT29ENr1f3eq1JpQCd2g=; b=svkEPvFy6SMyQoLqIEYkQx+1ZgUy7M5Vp5+UginJGMHuffXsOryvltEnLv3dujI94U XFrQy0nXnMqKYqSmNx2uc4KgCntn5FRGu073cWx5a9eNKwjz//92prZItKBngSEEaFjJ xB0yqHXpMkbqdDTV7wvOtqeUfv0YTnHK8LlhgOPRkcjmBguwzFKnIC8POmJdSjiecdXK 4qc56qIzY2I69/t3VLP1rRaPKyL1FVrjhSUWinNj7PvwGCJqIi4HV0GXqygv0/Ca68Ji 9Th0wuF4tmAS4E/AV7bgmZePRro4HJOsTwGoIFdEhCfsNwlf4jb1lDV6ejXzapr56O7l Aqkg== MIME-Version: 1.0 Received: by 10.14.215.193 with SMTP id e41mr1823452eep.44.1347600763978; Thu, 13 Sep 2012 22:32:43 -0700 (PDT) Received: by 10.14.219.134 with HTTP; Thu, 13 Sep 2012 22:32:43 -0700 (PDT) Date: Thu, 13 Sep 2012 22:32:43 -0700 Message-ID: From: Vijay Singh To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: vm info from a hung system X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2012 05:32:45 -0000 Need some expert help. I have a system that is hung hard, and I was able to get it into gdb. From show_vmstat I see: (kgdb-amd64-7.4-95) show_vmstat SYSTEM MEMORY INFORMATION: mem_wire: 285970432 ( 272MB) Wired: disabled for paging out mem_active: + 400105472 ( 381MB) Active: recently referenced mem_inactive:+ 56840192 ( 54MB) Inactive: recently not referenced mem_cache: + 0 ( 0MB) Cached: almost avail. for allocation mem_free: + 0 ( 0MB) Free: fully available for allocation mem_gap_vm: + 753664 ( 0MB) Memory gap: vm -------------- ------------ ----------- ------ mem_all: = 743669760 ( 709MB) Total real memory managed mem_gap_sys: + 22765568 ( 21MB) Memory gap: system -------------- ------------ ----------- mem_phys: = 766435328 ( 730MB) Total phys memory -------------- ------------ ----------- SYSTEM MEMORY SUMMARY: mem_used: 709595136 ( 676MB) Used memory mem_avail: + 56840192 ( 54MB) Available memory -------------- ------------ ----------- ------ mem_total: = 766435328 ( 730MB) Total memory What is this telling me? -vijay From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 14 07:49:52 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 816F4106566B for ; Fri, 14 Sep 2012 07:49:52 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp2.one.com (csmtp2.one.com [91.198.169.22]) by mx1.freebsd.org (Postfix) with ESMTP id 43C5A8FC08 for ; Fri, 14 Sep 2012 07:49:52 +0000 (UTC) Received: from [192.168.1.18] (unknown [217.157.7.221]) by csmtp2.one.com (Postfix) with ESMTPA id D02FB3077836 for ; Fri, 14 Sep 2012 07:49:44 +0000 (UTC) From: Erik Cederstrand Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <035514CA-81D6-407F-A2C1-51A9FB0E3A74@cederstrand.dk> Date: Fri, 14 Sep 2012 09:49:45 +0200 To: "freebsd-hackers@freebsd.org" Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) X-Mailer: Apple Mail (2.1486) Subject: Change vfork() to posix_spawn()? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2012 07:49:52 -0000 Hello hackers, I'm looking through the Clang Analyzer scans on = http://scan.freebsd.your.org/freebsd-head looking for false positives to = report back to LLVM. There are quite a list of reports suggesting to = change vfork() calls to posix_spawn(). Example from /bin/rpc: = http://scan.freebsd.your.org/freebsd-head/bin.rcp/2012-09-12-amd64/report-= nsOV80.html#EndPath I know nothing about this but I can see fork and posix_spawn have been = discussed on this list previously. Is this a legitimate warning (in this = case and in general in FreeBSD base)? Thanks, Erik= From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 14 11:03:31 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D713F1065670 for ; Fri, 14 Sep 2012 11:03:31 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4B18B8FC0A for ; Fri, 14 Sep 2012 11:03:31 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TCTgE-0004tc-Ly for freebsd-hackers@freebsd.org; Fri, 14 Sep 2012 13:03:26 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Sep 2012 13:03:26 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Sep 2012 13:03:26 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Date: Fri, 14 Sep 2012 13:03:11 +0200 Lines: 38 Message-ID: References: <035514CA-81D6-407F-A2C1-51A9FB0E3A74@cederstrand.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigBB57C1BA0D64AA99FC0B2170" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:14.0) Gecko/20120812 Thunderbird/14.0 In-Reply-To: <035514CA-81D6-407F-A2C1-51A9FB0E3A74@cederstrand.dk> X-Enigmail-Version: 1.4.3 Subject: Re: Change vfork() to posix_spawn()? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2012 11:03:31 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigBB57C1BA0D64AA99FC0B2170 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 14/09/2012 09:49, Erik Cederstrand wrote: > Hello hackers, >=20 > I'm looking through the Clang Analyzer scans on http://scan.freebsd.you= r.org/freebsd-head looking for false positives to report back to LLVM. Th= ere are quite a list of reports suggesting to change vfork() calls to pos= ix_spawn(). Example from /bin/rpc: http://scan.freebsd.your.org/freebsd-h= ead/bin.rcp/2012-09-12-amd64/report-nsOV80.html#EndPath >=20 > I know nothing about this but I can see fork and posix_spawn have been = discussed on this list previously. Is this a legitimate warning (in this = case and in general in FreeBSD base)? Currently (on 9-stable at least), posix_spawn() is implemented as a wrapper around vfork(), so I doubt replacing one with the other would do much. --------------enigBB57C1BA0D64AA99FC0B2170 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlBTDu8ACgkQ/QjVBj3/HSxuiwCffNvAgiKPU9grWind829tY9Ll EjkAn1Qw8j2WFyR61Zr4qpYY2NfEkQnf =D9gh -----END PGP SIGNATURE----- --------------enigBB57C1BA0D64AA99FC0B2170-- From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 14 11:45:56 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 807D61065670; Fri, 14 Sep 2012 11:45:56 +0000 (UTC) (envelope-from erik@cederstrand.dk) Received: from csmtp3.one.com (csmtp3.one.com [91.198.169.23]) by mx1.freebsd.org (Postfix) with ESMTP id 3D4E68FC08; Fri, 14 Sep 2012 11:45:55 +0000 (UTC) Received: from [192.168.1.18] (unknown [217.157.7.221]) by csmtp3.one.com (Postfix) with ESMTPA id 7DD212413A27; Fri, 14 Sep 2012 11:45:49 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) From: Erik Cederstrand In-Reply-To: Date: Fri, 14 Sep 2012 13:45:49 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <52517366-C10B-4CAA-BDDF-31E2098CBDA3@cederstrand.dk> References: <035514CA-81D6-407F-A2C1-51A9FB0E3A74@cederstrand.dk> To: Ivan Voras X-Mailer: Apple Mail (2.1486) Cc: freebsd-hackers@freebsd.org Subject: Re: Change vfork() to posix_spawn()? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2012 11:45:56 -0000 Den 14/09/2012 kl. 13.03 skrev Ivan Voras : > On 14/09/2012 09:49, Erik Cederstrand wrote: >> Hello hackers, >>=20 >> I'm looking through the Clang Analyzer scans on = http://scan.freebsd.your.org/freebsd-head looking for false positives to = report back to LLVM. There are quite a list of reports suggesting to = change vfork() calls to posix_spawn(). Example from /bin/rpc: = http://scan.freebsd.your.org/freebsd-head/bin.rcp/2012-09-12-amd64/report-= nsOV80.html#EndPath >>=20 >> I know nothing about this but I can see fork and posix_spawn have = been discussed on this list previously. Is this a legitimate warning (in = this case and in general in FreeBSD base)? >=20 > Currently (on 9-stable at least), posix_spawn() is implemented as a > wrapper around vfork(), so I doubt replacing one with the other would = do > much. The analyzer added this warning in January. The release notes link to = this explanation: = https://www.securecoding.cert.org/confluence/display/seccode/POS33-C.+Do+n= ot+use+vfork() I guess this is the important part: "Because of the implementation of the vfork() function, the parent = process is suspended while the child process executes. If a user sends a = signal to the child process, delaying its execution, the parent process = (which is privileged) is also blocked. This means that an unprivileged = process can cause a privileged process to halt, which is a privilege = inversion resulting in a denial of service." Erik= From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 14 12:48:41 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BFFFC106566B for ; Fri, 14 Sep 2012 12:48:41 +0000 (UTC) (envelope-from feld@feld.me) Received: from feld.me (unknown [IPv6:2607:f4e0:100:300::2]) by mx1.freebsd.org (Postfix) with ESMTP id 7D8958FC0A for ; Fri, 14 Sep 2012 12:48:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=feld.me; s=blargle; h=In-Reply-To:Message-Id:From:Mime-Version:Date:References:Subject:Cc:To:Content-Type; bh=rQpP141uowv2QX78G/mk8FGGXoeovQYZsp0CXn91jRg=; b=tGrvSQd6aQMUwN+SAhVb+JN7ZaAGbt9uf6SIrphru4Hgu1bFH78/FnDpNYdFxvmTtghAi/u0p9TlJzK4CrzT9OO5HTDQWTz5hU+UQfEhBfadN/41ffycIPsKasbeHSkg; Received: from localhost ([127.0.0.1] helo=mwi1.coffeenet.org) by feld.me with esmtp (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TCVK2-000F3D-FS; Fri, 14 Sep 2012 07:48:40 -0500 Received: from feld@feld.me by mwi1.coffeenet.org (Archiveopteryx 3.1.4) with esmtpa id 1347626912-3100-3099/5/7; Fri, 14 Sep 2012 12:48:32 +0000 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: Mark Saad References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> <20120913162815.GA1219@pix.net> <50524C67.3040403@FreeBSD.org> <66357a32-b570-4dc3-a27c-d32903da41db@email.android.com> Date: Fri, 14 Sep 2012 07:48:31 -0500 Mime-Version: 1.0 From: Mark Felder Message-Id: In-Reply-To: User-Agent: Opera Mail/12.02 (FreeBSD) X-SA-Report: ALL_TRUSTED=-1, KHOP_THREADED=-0.5 X-SA-Score: -1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2012 12:48:41 -0000 Hi Mark, Here's the output of our VMs running on ESXi 4.1u1 FreeBSD 7.4: # sysctl kern.timecounter.choice kern.timecounter.choice: TSC(800) ACPI-safe(850) i8254(0) dummy(-1000000) # sysctl kern.timecounter.hardware kern.timecounter.hardware: ACPI-safe FreeBSD 8.3: # sysctl kern.timecounter.choice kern.timecounter.choice: TSC(800) ACPI-safe(850) i8254(0) dummy(-1000000) # sysctl kern.timecounter.hardware kern.timecounter.hardware: ACPI-safe FreeBSD 9.0: # sysctl kern.timecounter.choice kern.timecounter.choice: TSC(1000) i8254(0) ACPI-fast(900) dummy(-1000000) # sysctl kern.timecounter.hardware kern.timecounter.hardware: TSC Note that both 8.3 and 9.0 crash, while 7.4 does not. From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 14 14:33:45 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9CBA106564A; Fri, 14 Sep 2012 14:33:44 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id A557A8FC0A; Fri, 14 Sep 2012 14:33:44 +0000 (UTC) Received: by pbbrp2 with SMTP id rp2so6231378pbb.13 for ; Fri, 14 Sep 2012 07:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=q/5xyo6XBXBH27jWa9PcDwT0t9/u5PqY+rVlfwCk8dA=; b=DUN201AMmobh+CVcN3oCBN5smHtZ6kyAdTRO8uvjud7iug8KI4tVhaQYEB/Uf8p4HO Q0ru4Dqxjyi+o6WLBExZTnOc7kvVbQC/Fh9Z1jw2NLdRaNztwwuujg5CwsdDd2ZfWLWR wkoCWtGnD3mpbjEDfEUNCer5oohq6b6GSSMIcgtnOg9xC8Mze/SiRJJ+XDdgH1WvfWCA IPhz8lDWxvKJ9nUyaARS2ox26sYK9reKy/tYhZT1xBOujgyb8Z7Z1lJNMBV5JM1ni/1l lFGpipyPf/shDQZGkYgobgNNUmc9erkx+AcIdHVoM676pwC23xX9OvSfgJOgrAzetPhj GCRw== MIME-Version: 1.0 Received: by 10.66.75.73 with SMTP id a9mr4411040paw.43.1347633224050; Fri, 14 Sep 2012 07:33:44 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.68.13.170 with HTTP; Fri, 14 Sep 2012 07:33:43 -0700 (PDT) In-Reply-To: <52517366-C10B-4CAA-BDDF-31E2098CBDA3@cederstrand.dk> References: <035514CA-81D6-407F-A2C1-51A9FB0E3A74@cederstrand.dk> <52517366-C10B-4CAA-BDDF-31E2098CBDA3@cederstrand.dk> Date: Fri, 14 Sep 2012 07:33:43 -0700 X-Google-Sender-Auth: 0UODToJbe_iRtXScT-4eqGjhVRU Message-ID: From: mdf@FreeBSD.org To: Erik Cederstrand Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Ivan Voras Subject: Re: Change vfork() to posix_spawn()? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2012 14:33:45 -0000 On Fri, Sep 14, 2012 at 4:45 AM, Erik Cederstrand wro= te: > Den 14/09/2012 kl. 13.03 skrev Ivan Voras : > >> On 14/09/2012 09:49, Erik Cederstrand wrote: >>> Hello hackers, >>> >>> I'm looking through the Clang Analyzer scans on http://scan.freebsd.you= r.org/freebsd-head looking for false positives to report back to LLVM. Ther= e are quite a list of reports suggesting to change vfork() calls to posix_s= pawn(). Example from /bin/rpc: http://scan.freebsd.your.org/freebsd-head/bi= n.rcp/2012-09-12-amd64/report-nsOV80.html#EndPath >>> >>> I know nothing about this but I can see fork and posix_spawn have been = discussed on this list previously. Is this a legitimate warning (in this ca= se and in general in FreeBSD base)? >> >> Currently (on 9-stable at least), posix_spawn() is implemented as a >> wrapper around vfork(), so I doubt replacing one with the other would do >> much. > > The analyzer added this warning in January. The release notes link to thi= s explanation: https://www.securecoding.cert.org/confluence/display/seccode= /POS33-C.+Do+not+use+vfork() > > I guess this is the important part: > > "Because of the implementation of the vfork() function, the parent proces= s is suspended while the child process executes. If a user sends a signal t= o the child process, delaying its execution, the parent process (which is p= rivileged) is also blocked. This means that an unprivileged process can cau= se a privileged process to halt, which is a privilege inversion resulting i= n a denial of service." > Isn't the important part the previous paragraph, which said that some older versions of Linux had the problem? The entire thing reads that the issue comes from an idiom of vfork(), setuid(), then exec, which is both undefined and would be specific to only some *uses* of vfork(), not the implementation. The whole thing isn't worded terribly usefully; e.g. it doesn't explain if it was only Linux that had an issue, which version of Linux is fixed, whether normal code that went straight from vfork() to exec() was fine, etc. Cheers, matthew From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 14 18:12:19 2012 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE2A81065670 for ; Fri, 14 Sep 2012 18:12:19 +0000 (UTC) (envelope-from lokadamus@gmx.de) Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.23]) by mx1.freebsd.org (Postfix) with SMTP id EFE068FC08 for ; Fri, 14 Sep 2012 18:12:18 +0000 (UTC) Received: (qmail invoked by alias); 14 Sep 2012 18:12:17 -0000 Received: from c132068.adsl.hansenet.de (EHLO FBSD.lokilan) [213.39.132.68] by mail.gmx.net (mp031) with SMTP; 14 Sep 2012 20:12:17 +0200 X-Authenticated: #3333826 X-Provags-ID: V01U2FsdGVkX1/U0Px3FI7UoDWtxooaTZliZxn/xXQv3HovLOJITQ GCpopRCKTQlKvf Message-ID: <5053737F.8090303@gmx.de> Date: Fri, 14 Sep 2012 20:12:15 +0200 From: "lokadamus@gmx.de" User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:12.0) Gecko/20120505 Thunderbird/12.0.1 MIME-Version: 1.0 To: Vijay Singh References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 Cc: hackers@freebsd.org Subject: Re: vm info from a hung system X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2012 18:12:19 -0000 Are errors in /var/log/messages? I think, you ran out of memory. With top you can see, how many swap is avaible. On 09/14/12 07:32, Vijay Singh wrote: > Need some expert help. I have a system that is hung hard, and I was > able to get it into gdb. From show_vmstat I see: > > (kgdb-amd64-7.4-95) show_vmstat > SYSTEM MEMORY INFORMATION: > mem_wire: 285970432 ( 272MB) Wired: disabled for paging out > mem_active: + 400105472 ( 381MB) Active: recently referenced > mem_inactive:+ 56840192 ( 54MB) Inactive: recently not referenced > mem_cache: + 0 ( 0MB) Cached: almost avail. for allocation > mem_free: + 0 ( 0MB) Free: fully available for allocation > mem_gap_vm: + 753664 ( 0MB) Memory gap: vm > From owner-freebsd-hackers@FreeBSD.ORG Fri Sep 14 19:09:54 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B1B5106566C; Fri, 14 Sep 2012 19:09:54 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (unknown [IPv6:2001:610:1108:5012::107]) by mx1.freebsd.org (Postfix) with ESMTP id 9BE9C8FC16; Fri, 14 Sep 2012 19:09:53 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 7EC5D1203E1; Fri, 14 Sep 2012 21:09:49 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 667652847B; Fri, 14 Sep 2012 21:09:49 +0200 (CEST) Date: Fri, 14 Sep 2012 21:09:49 +0200 From: Jilles Tjoelker To: Erik Cederstrand Message-ID: <20120914190949.GC13027@stack.nl> References: <035514CA-81D6-407F-A2C1-51A9FB0E3A74@cederstrand.dk> <52517366-C10B-4CAA-BDDF-31E2098CBDA3@cederstrand.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52517366-C10B-4CAA-BDDF-31E2098CBDA3@cederstrand.dk> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-hackers@freebsd.org, Ivan Voras Subject: Re: Change vfork() to posix_spawn()? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2012 19:09:54 -0000 On Fri, Sep 14, 2012 at 01:45:49PM +0200, Erik Cederstrand wrote: > Den 14/09/2012 kl. 13.03 skrev Ivan Voras : > > On 14/09/2012 09:49, Erik Cederstrand wrote: > >> I'm looking through the Clang Analyzer scans on > >> http://scan.freebsd.your.org/freebsd-head looking for false > >> positives to report back to LLVM. There are quite a list of reports > >> suggesting to change vfork() calls to posix_spawn(). Example from > >> /bin/rpc: > >> http://scan.freebsd.your.org/freebsd-head/bin.rcp/2012-09-12-amd64/report-nsOV80.html#EndPath > >> I know nothing about this but I can see fork and posix_spawn have > >> been discussed on this list previously. Is this a legitimate > >> warning (in this case and in general in FreeBSD base)? > > Currently (on 9-stable at least), posix_spawn() is implemented as a > > wrapper around vfork(), so I doubt replacing one with the other > > would do much. vfork() returns twice, possibly reanimating variables from the dead. Calling posix_spawn() limits this issue to the posix_spawn() implementation only. For example, in case of unwilling compiler developers, the optimization level for that file might be lowered or more volatile keywords might be added. I think it makes more sense to disable various optimizations in the compiler automatically in functions that call vfork(), longjmp() and similar functions, but I do not decide what compiler developers do. > The analyzer added this warning in January. The release notes link to > this explanation: > https://www.securecoding.cert.org/confluence/display/seccode/POS33-C.+Do+not+use+vfork() > I guess this is the important part: > "Because of the implementation of the vfork() function, the parent > process is suspended while the child process executes. If a user sends > a signal to the child process, delaying its execution, the parent > process (which is privileged) is also blocked. This means that an > unprivileged process can cause a privileged process to halt, which is > a privilege inversion resulting in a denial of service." This problem only occurs if privileges are dropped between vfork and exec, which is uncommon. If no privileges are dropped, the user can affect the parent directly. Furthermore, this exact problem does not happen in FreeBSD because child processes between vfork and exec/exit are not affected by stop signals (this is stronger than the vfork(2) man page documents). However, related issues are still present. If there is a signal handler that blocks for a long time (many functions which do this are async-signal-safe) for a signal permitted by security.bsd.conservative_signals, an unprivileged user will be able to trigger it and delay the thread calling vfork(). A function may also be async-signal-safe but not suitable for a vforked child (for example, libthr makes many functions async-signal-safe by postponing signal handlers which is not good enough if a vforked child is SIGKILL'ed). An unprivileged user may also trigger priority inversion by lowering the priority of the child process and consuming CPU time at a higher priority. Obviously, the child process should not lower its priority voluntarily either. These problems can be fixed in various ways. The direct priority inversion problem can be fixed by using fork() instead in that case or by adding a priority inheritance scheme in the kernel for vforked children (but only for the static priority; the parent's dynamic priority will increase because it is sleeping). The privilege manipulation available via POSIX_SPAWN_RESETIDS seems safe enough. Since it only affects the effective UID/GID, it does not affect the ability to modify scheduling parameters (real UID) or to send signals (real or saved UID). Since the seteuid() call itself will set the issetugid flag to true if it changed anything, it does not affect the ability to debug before exec. More general privilege dropping frequently involves frameworks such as PAM which are not async-signal-safe and certainly not vfork-safe. -- Jilles Tjoelker From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 00:19:46 2012 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DB53106564A for ; Sat, 15 Sep 2012 00:19:46 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id 692448FC1F for ; Sat, 15 Sep 2012 00:19:46 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id q8F0JjpV057293 for ; Fri, 14 Sep 2012 17:19:45 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <5053C9A1.3030605@rawbw.com> Date: Fri, 14 Sep 2012 17:19:45 -0700 From: Yuri User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: freebsd-hackers@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Why fdisk can't open root disk with MBR for writing? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 00:19:46 -0000 I am trying to change the active partition in MBR. This should be a matter of changing only two bits (clearing one in one byte and setting another one in another byte). However, fdisk complains: fdisk: Failed to write MBR. Try to use gpart(8). truss reveals that fdisk failed to open the root disk for writing: open("/dev/ad4",O_RDWR,00) ERR#1 'Operation not permitted' open("/dev/ad4",O_RDONLY,00) = 3 (0x3) ... ... pwrite(0x3,0x34048200,0x200,0x0,0x0,0x0) ERR#9 'Bad file descriptor' Failed to write MBR. Try to use gpart(8) The question is: why the disk can't be open RW under root? The secondary issue is the bug in fdisk: once -a option is supplied and it can't open it RW it should just say so, and not suggest using gpart because gpart will probably have the same issue. Yuri From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 00:29:23 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F28E106566C for ; Sat, 15 Sep 2012 00:29:23 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5E0668FC08 for ; Sat, 15 Sep 2012 00:29:23 +0000 (UTC) Received: by oagm1 with SMTP id m1so4167268oag.13 for ; Fri, 14 Sep 2012 17:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=VjmATMD+Kc1xNXft45UlQALCMEJtLRvY8P5f78D/iG0=; b=JouSuLyigeXZlY0lumOgzLnxJXkC5sd87FIYhGoCekldsmrjOaLpoNwDKfameN60t0 XCnFvABYk6Dcgr4mcsv5Mum9RX8E4KqxvZPxbcRMvXto81az3chGJIkIyDixZFRjyEM+ y2UoIlCH4+BM0UCb1dp+RxgDqCWDZWUgEX+gomfokqOZxbaOiIXOAj7X8ZlC0wdu1tGd rXb8z/idXm6MUfVcUJ6eyLySQq0cPNTJeGC52AocZB5uEAv4SAWZFzknYH/c4KPJBmIa 9z5reTsUnQkQndsmy5zJUBFA3BQCOLHt8UtMR+UajFT8jAjCTDFcIG2jlV0+nVwnm2Sh 6Qvw== MIME-Version: 1.0 Received: by 10.60.29.164 with SMTP id l4mr6193477oeh.4.1347668962512; Fri, 14 Sep 2012 17:29:22 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Fri, 14 Sep 2012 17:29:22 -0700 (PDT) In-Reply-To: <5053C9A1.3030605@rawbw.com> References: <5053C9A1.3030605@rawbw.com> Date: Fri, 14 Sep 2012 17:29:22 -0700 Message-ID: From: Garrett Cooper To: Yuri Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: Why fdisk can't open root disk with MBR for writing? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 00:29:23 -0000 On Fri, Sep 14, 2012 at 5:19 PM, Yuri wrote: > I am trying to change the active partition in MBR. > This should be a matter of changing only two bits (clearing one in one byte > and setting another one in another byte). > > However, fdisk complains: > fdisk: Failed to write MBR. Try to use gpart(8). > > truss reveals that fdisk failed to open the root disk for writing: > open("/dev/ad4",O_RDWR,00) ERR#1 'Operation not > permitted' > open("/dev/ad4",O_RDONLY,00) = 3 (0x3) > ... > ... > pwrite(0x3,0x34048200,0x200,0x0,0x0,0x0) ERR#9 'Bad file descriptor' > Failed to write MBR. Try to use gpart(8) > > The question is: why the disk can't be open RW under root? > The secondary issue is the bug in fdisk: once -a option is supplied and it > can't open it RW it should just say so, and not suggest using gpart because > gpart will probably have the same issue. 1. What version of FreeBSD? 2. What do you have set for kern.geom.debug_flags? 3. Is /dev/ad4 (or any partitions / slices under it) currently in use? Thanks! -Garrett From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 01:37:51 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE13A106566B for ; Sat, 15 Sep 2012 01:37:51 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-qa0-f54.google.com (mail-qa0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 96CAE8FC08 for ; Sat, 15 Sep 2012 01:37:51 +0000 (UTC) Received: by qatn12 with SMTP id n12so364880qat.13 for ; Fri, 14 Sep 2012 18:37:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to :x-gm-message-state; bh=8qzK4hjfI0VAklTuwANi42+egYVFXU90GeIZUwaohiQ=; b=KOMab4tvgtHDSbkiB38KJZ83C10uBRbab3nMNMPwhziGtfFZgdsWCfXXmyZCGlPyMu S4BShE3Y+ND9rXpF79QSf8mM0kb9Vht6MdphbzZeTE81hsNs3FvefUgBb8N+58LZPRXw AZ3P2kv2oDqSb53NX+q+K1GX6OwDx6NbkXjBTB9zTcI8kJAQRQ1O7o8sIIIUIQLI0cf3 wZ1fwP/dYfIq5TVVwI+6gYqz8fd3ZB9JvPobNZ2vzgani/hutUsFu17hpVTcWjo/GFYT WaIE/VIouVd12Z1dbvjXRsvf9MbTm2bqHHYajf8oXEFmqSgY02511Yze7rYfUKxqqmeP 0KjA== Received: by 10.229.137.148 with SMTP id w20mr3002244qct.22.1347673065001; Fri, 14 Sep 2012 18:37:45 -0700 (PDT) Received: from [192.168.11.108] (ool-182c6d68.dyn.optonline.net. [24.44.109.104]) by mx.google.com with ESMTPS id d11sm2670535qaj.18.2012.09.14.18.37.43 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 14 Sep 2012 18:37:44 -0700 (PDT) References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> <20120913162815.GA1219@pix.net> <50524C67.3040403@FreeBSD.org> <66357a32-b570-4dc3-a27c-d32903da41db@email.android.com> In-Reply-To: Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <9566CAD6-AD55-4BC5-B9B0-92C15949A63B@longcount.org> X-Mailer: iPhone Mail (9B206) From: Mark Saad Date: Fri, 14 Sep 2012 21:37:40 -0400 To: Mark Felder X-Gm-Message-State: ALoCoQm04T6LKkMzRb0A0gihKKwp7LMhgH/Xgj8WytIR77u5kqtRcg/e9r82ds8GyIL3hQ5RsVjC Cc: "freebsd-hackers@freebsd.org" Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 01:37:52 -0000 On Sep 14, 2012, at 8:48 AM, Mark Felder wrote: > Hi Mark, >=20 > Here's the output of our VMs running on ESXi 4.1u1 >=20 > FreeBSD 7.4: > # sysctl kern.timecounter.choice > kern.timecounter.choice: TSC(800) ACPI-safe(850) i8254(0) dummy(-1000000) > # sysctl kern.timecounter.hardware > kern.timecounter.hardware: ACPI-safe >=20 > FreeBSD 8.3: > # sysctl kern.timecounter.choice > kern.timecounter.choice: TSC(800) ACPI-safe(850) i8254(0) dummy(-1000000) > # sysctl kern.timecounter.hardware > kern.timecounter.hardware: ACPI-safe >=20 > FreeBSD 9.0: > # sysctl kern.timecounter.choice > kern.timecounter.choice: TSC(1000) i8254(0) ACPI-fast(900) dummy(-1000000)= > # sysctl kern.timecounter.hardware > kern.timecounter.hardware: TSC >=20 >=20 > Note that both 8.3 and 9.0 crash, while 7.4 does not. How do you have suj on 8.3 ? Are you using a patch ? Also can you retest 9 w= ith the following sysctl kern.timecounter.hardware=3DAcpi-fast=20 Also in esxi what setup options do you have for the vm's ? Lastly do you have esxi setup to talk to a ntp server ? If so can you confir= m that it's working ? I mean the esxi host not the vm .=20 --- Mark saad | mark.saad@longcount.org=20 From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 02:23:53 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 919C1106566B for ; Sat, 15 Sep 2012 02:23:53 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 4E4AA8FC08 for ; Sat, 15 Sep 2012 02:23:53 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q8F2NqfI036670; Fri, 14 Sep 2012 20:23:52 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q8F2NpIG036667; Fri, 14 Sep 2012 20:23:52 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Fri, 14 Sep 2012 20:23:51 -0600 (MDT) From: Warren Block To: Yuri In-Reply-To: <5053C9A1.3030605@rawbw.com> Message-ID: References: <5053C9A1.3030605@rawbw.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Fri, 14 Sep 2012 20:23:52 -0600 (MDT) Cc: freebsd-hackers@freebsd.org Subject: Re: Why fdisk can't open root disk with MBR for writing? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 02:23:53 -0000 On Fri, 14 Sep 2012, Yuri wrote: > I am trying to change the active partition in MBR. > This should be a matter of changing only two bits (clearing one in one byte > and setting another one in another byte). > > However, fdisk complains: > fdisk: Failed to write MBR. Try to use gpart(8). > > truss reveals that fdisk failed to open the root disk for writing: > open("/dev/ad4",O_RDWR,00) ERR#1 'Operation not > permitted' > open("/dev/ad4",O_RDONLY,00) = 3 (0x3) > ... > ... > pwrite(0x3,0x34048200,0x200,0x0,0x0,0x0) ERR#9 'Bad file descriptor' > Failed to write MBR. Try to use gpart(8) > > The question is: why the disk can't be open RW under root? > The secondary issue is the bug in fdisk: once -a option is supplied and it > can't open it RW it should just say so, and not suggest using gpart because > gpart will probably have the same issue. Did you actually try gpart? GEOM prevents writes to providers that are in use, but gpart should handle it correctly if the problem is just that fdisk doesn't understand GEOM. # gpart set -a active -i 1 ada0 If that fails, the provider is in use, usually mounted. The safety can be disabled, but it's better to figure out what has it in use. From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 05:24:22 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11B48106564A for ; Sat, 15 Sep 2012 05:24:22 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id EDBDB8FC08 for ; Sat, 15 Sep 2012 05:24:21 +0000 (UTC) Received: from eagle.yuri.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id q8F5OKpb007069; Fri, 14 Sep 2012 22:24:21 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <50541103.6050608@rawbw.com> Date: Fri, 14 Sep 2012 22:24:19 -0700 From: Yuri User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: Warren Block References: <5053C9A1.3030605@rawbw.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Why fdisk can't open root disk with MBR for writing? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 05:24:22 -0000 On 09/14/2012 19:23, Warren Block wrote: > Did you actually try gpart? GEOM prevents writes to providers that > are in use, but gpart should handle it correctly if the problem is > just that fdisk doesn't understand GEOM. > > # gpart set -a active -i 1 ada0 > > If that fails, the provider is in use, usually mounted. The safety > can be disabled, but it's better to figure out what has it in use. Yes it is the hard drive with mounted /. But changing the active slice should be safe in any case. gpart worked. This safety feature is protecting people from themselves. Sounds very familiar. Thanks! Yuri From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 12:24:34 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A01FB106566C for ; Sat, 15 Sep 2012 12:24:34 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 5C2F18FC0C for ; Sat, 15 Sep 2012 12:24:34 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q8FCOXn7040299; Sat, 15 Sep 2012 06:24:33 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q8FCOWFI040296; Sat, 15 Sep 2012 06:24:33 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sat, 15 Sep 2012 06:24:32 -0600 (MDT) From: Warren Block To: Yuri In-Reply-To: <50541103.6050608@rawbw.com> Message-ID: References: <5053C9A1.3030605@rawbw.com> <50541103.6050608@rawbw.com> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Sat, 15 Sep 2012 06:24:33 -0600 (MDT) Cc: freebsd-hackers@freebsd.org Subject: Re: Why fdisk can't open root disk with MBR for writing? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 12:24:34 -0000 On Fri, 14 Sep 2012, Yuri wrote: > On 09/14/2012 19:23, Warren Block wrote: >> Did you actually try gpart? GEOM prevents writes to providers that are in >> use, but gpart should handle it correctly if the problem is just that fdisk >> doesn't understand GEOM. >> >> # gpart set -a active -i 1 ada0 >> >> If that fails, the provider is in use, usually mounted. The safety can be >> disabled, but it's better to figure out what has it in use. > > Yes it is the hard drive with mounted /. But changing the active slice should > be safe in any case. > gpart worked. > This safety feature is protecting people from themselves. Sounds very > familiar. gpart allowed it, so it's not the safety feature but merely that fdisk is aging and can't deal well with GEOM. From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 13:23:29 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1A4B106564A for ; Sat, 15 Sep 2012 13:23:29 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from tower.berklix.org (tower.berklix.org [83.236.223.114]) by mx1.freebsd.org (Postfix) with ESMTP id 52C328FC08 for ; Sat, 15 Sep 2012 13:23:28 +0000 (UTC) Received: from mart.js.berklix.net (pD9FBFE3C.dip.t-dialin.net [217.251.254.60]) (authenticated bits=0) by tower.berklix.org (8.14.2/8.14.2) with ESMTP id q8FDNQcR022783; Sat, 15 Sep 2012 13:23:27 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id q8FDNEP6016878; Sat, 15 Sep 2012 15:23:14 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.4/8.14.4) with ESMTP id q8FDMobF058992; Sat, 15 Sep 2012 15:22:56 +0200 (CEST) (envelope-from jhs@fire.js.berklix.net) Message-Id: <201209151322.q8FDMobF058992@fire.js.berklix.net> To: Garrett Cooper From: "Julian H. Stacey" Organization: http://berklix.com BSD Unix Linux Consultancy, Munich Germany User-agent: EXMH on FreeBSD http://berklix.com/free/ X-URL: http://www.berklix.com In-reply-to: Your message "Fri, 14 Sep 2012 17:29:22 PDT." Date: Sat, 15 Sep 2012 15:22:50 +0200 Sender: jhs@berklix.com Cc: Yuri , freebsd-hackers@freebsd.org Subject: Re: Why fdisk can't open root disk with MBR for writing? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 13:23:30 -0000 Hi Yuri & hackers, Garrett Cooper wrote: > On Fri, Sep 14, 2012 at 5:19 PM, Yuri wrote: > > I am trying to change the active partition in MBR. > > This should be a matter of changing only two bits (clearing one in one byte > > and setting another one in another byte). > > > > However, fdisk complains: > > fdisk: Failed to write MBR. Try to use gpart(8). > > > > truss reveals that fdisk failed to open the root disk for writing: > > open("/dev/ad4",O_RDWR,00) ERR#1 'Operation not > > permitted' > > open("/dev/ad4",O_RDONLY,00) = 3 (0x3) > > ... > > ... > > pwrite(0x3,0x34048200,0x200,0x0,0x0,0x0) ERR#9 'Bad file descriptor' > > Failed to write MBR. Try to use gpart(8) > > > > The question is: why the disk can't be open RW under root? > > The secondary issue is the bug in fdisk: once -a option is supplied and it > > can't open it RW it should just say so, and not suggest using gpart because > > gpart will probably have the same issue. > > 1. What version of FreeBSD? > 2. What do you have set for kern.geom.debug_flags? > 3. Is /dev/ad4 (or any partitions / slices under it) currently in use? > > Thanks! > -Garrett I have been applying this diff to my man fdisk: http://berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/gen/sbin/fdisk/ *** 8.0-RELEASE/src/sbin/fdisk/fdisk.8 Sat Mar 14 22:32:16 2009 --- new-generic/src/sbin/fdisk/fdisk.8 Sat Mar 14 22:35:10 2009 *************** *** 462,464 **** --- 462,468 ---- The .Xr bsdlabel 8 command must be used for this. + .Pp + When running multi user, you cannot write unless you first run this: + .br + sysctl kern.geom.debugflags=16 I never submitted it as a send-pr, anyone think I should submit it to help save people ? Cheers, Julian -- Julian Stacey, BSD Unix Linux C Sys Eng Consultant, Munich http://berklix.com Reply below not above, like a play script. Indent old text with "> ". Send plain text. Not: HTML, multipart/alternative, base64, quoted-printable. From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 15:36:44 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CDA92106566B for ; Sat, 15 Sep 2012 15:36:44 +0000 (UTC) (envelope-from feld@feld.me) Received: from feld.me (unknown [IPv6:2607:f4e0:100:300::2]) by mx1.freebsd.org (Postfix) with ESMTP id 8F3A58FC16 for ; Sat, 15 Sep 2012 15:36:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=feld.me; s=blargle; h=In-Reply-To:Message-Id:From:Mime-Version:Date:References:Subject:Cc:To:Content-Type; bh=mfmkzY0JHeKSonDOQI2i/Yi2E9UJUYRkFeU/RVdDbHk=; b=pL1fmd9B27PzYKWyH1s4ZMrX94mPS51bq+tiBevKCeYBFDrCwXq/H+xN6paD4REWWBJ8UaE4Zz+ZQzWg2TIa5gU5Jx6KUNTIdvs0uq2RCWaKnPkEBl3+vkWNwA9IKSkq; Received: from localhost ([127.0.0.1] helo=mwi1.coffeenet.org) by feld.me with esmtp (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TCuQF-000MmD-25; Sat, 15 Sep 2012 10:36:43 -0500 Received: from feld@feld.me by mwi1.coffeenet.org (Archiveopteryx 3.1.4) with esmtpa id 1347723392-3100-3099/5/32; Sat, 15 Sep 2012 15:36:32 +0000 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: Mark Saad References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> <20120913162815.GA1219@pix.net> <50524C67.3040403@FreeBSD.org> <66357a32-b570-4dc3-a27c-d32903da41db@email.android.com> <9566CAD6-AD55-4BC5-B9B0-92C15949A63B@longcount.org> Date: Sat, 15 Sep 2012 10:36:23 -0500 Mime-Version: 1.0 From: Mark Felder Message-Id: In-Reply-To: <9566CAD6-AD55-4BC5-B9B0-92C15949A63B@longcount.org> User-Agent: Opera Mail/12.02 (Win32) X-SA-Report: ALL_TRUSTED=-1, KHOP_THREADED=-0.5 X-SA-Score: -1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 15:36:44 -0000 On Fri, 14 Sep 2012 20:37:40 -0500, Mark Saad wrote: > How do you have suj on 8.3 ? Are you using a patch ? I don't have suj on 8.3 > Also can you retest 9 with the following > sysctlkern.timecounter.hardware=Acpi-fast Yes, I'll attempt that as soon as possible. We're under a tight deadline to migrate critical resources off of VMWare now so I don't know how soon I can test. > Also in esxi what setup options do you have for the vm's ? I'm not sure what ones I have off the top of my head, but VMWare support has previously poured over ever option to make sure nothing was misconfigured. > Lastly do you have esxi setup to talk to a ntp server ? If so can you > confirm that it's working ? I mean the esxi host not the vm . Yes, and yes. We've got a reliable NTP infrastructure at work and ESXi is definitely using it. From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 17:07:38 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0392106564A for ; Sat, 15 Sep 2012 17:07:38 +0000 (UTC) (envelope-from nonesuch@longcount.org) Received: from mail-qa0-f47.google.com (mail-qa0-f47.google.com [209.85.216.47]) by mx1.freebsd.org (Postfix) with ESMTP id 750BB8FC0A for ; Sat, 15 Sep 2012 17:07:38 +0000 (UTC) Received: by qadc11 with SMTP id c11so673051qad.13 for ; Sat, 15 Sep 2012 10:07:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to :x-gm-message-state; bh=l9U1odndCWJvQVqP4KmSwt6Zx4Bh/b5/OhN58Vabsl0=; b=JMLYGfWdUr9x8lTnePe0Vedf2rqIImzrQVcUsOgdpFILS5VjmM28yGXSGDX5HKLMqx brXbYCymfMlE8e+MBN+5E5Zss6Erwao5AaZYydS3bBmOTgQgNeh3NX5K7r8jk0s47ICF QzSGmYNeyqzI0guquwO6/BZc3TcXEqFnnhrjRaTjpXW+1gho/FIBZ6osmh+2yEZW5Z7o GiVIFLR533P0dqm3jZDM7u1cifC9xcF6oUd51e0qtktKkSVPAdGgJ+q9SJh1lhMBAlgk PkMRtydJaJPmhbdQi0qZy9dJZ0ODJYG65s4+P8M7TGCulh5iTDwON+2vvB3YhJ0jqR3B JHrA== Received: by 10.224.42.78 with SMTP id r14mr15945023qae.19.1347728852483; Sat, 15 Sep 2012 10:07:32 -0700 (PDT) Received: from [192.168.11.108] (ool-182c6d68.dyn.optonline.net. [24.44.109.104]) by mx.google.com with ESMTPS id ha5sm7333389qab.1.2012.09.15.10.07.31 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Sep 2012 10:07:32 -0700 (PDT) References: <201205311157.42909.jhb@freebsd.org> <19d73256-b7c6-417e-a051-a5faeabf219d@email.android.com> <201209121520.26337.jhb@freebsd.org> <5051F7A0.90901@FreeBSD.org> <20120913162815.GA1219@pix.net> <50524C67.3040403@FreeBSD.org> <66357a32-b570-4dc3-a27c-d32903da41db@email.android.com> <9566CAD6-AD55-4BC5-B9B0-92C15949A63B@longcount.org> In-Reply-To: Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <6C389C71-9762-4E02-A590-EB17359052EC@longcount.org> X-Mailer: iPhone Mail (9B206) From: Mark Saad Date: Sat, 15 Sep 2012 13:07:28 -0400 To: Mark Felder X-Gm-Message-State: ALoCoQnN4wfulS2xfECJa0CbigwyZ0ka42u0ZxrEPiFlalmAijv2UgdJoZIPqrrX42hnScKlrQuH Cc: "freebsd-hackers@freebsd.org" Subject: Re: Please help me diagnose this crazy VMWare/FreeBSD 8.x crash X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 17:07:39 -0000 On Sep 15, 2012, at 11:36 AM, Mark Felder wrote: > On Fri, 14 Sep 2012 20:37:40 -0500, Mark Saad wro= te: >=20 >> How do you have suj on 8.3 ? Are you using a patch ? >=20 > I don't have suj on 8.3 I misread the prior emails=20 >=20 >> Also can you retest 9 with the following sysctlkern.timecounter.hardware=3D= Acpi-fast >=20 > Yes, I'll attempt that as soon as possible. We're under a tight deadline t= o migrate critical resources off of VMWare now so I don't know how soon I ca= n test. >=20 >> Also in esxi what setup options do you have for the vm's ? >=20 > I'm not sure what ones I have off the top of my head, but VMWare support h= as previously poured over ever option to make sure nothing was misconfigured= . >=20 It's not that I doubt that , in my experience their support is not equipped t= o answer questions that don't start with " in my windows vm I have this issu= e ..."=20 >> Lastly do you have esxi setup to talk to a ntp server ? If so can you con= firm that it's working ? I mean the esxi host not the vm . >=20 > Yes, and yes. We've got a reliable NTP infrastructure at work and ESXi is d= efinitely using it. Just checking this can cause odd issues .=20 What hardware is the esxi host server ? What are you using for the vm disks?= Is the storage pool on local disks , iscsi , fiber channel , or nfs . =20 --- Mark saad | mark.saad@longcount.org From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 18:49:46 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B80D7106566B for ; Sat, 15 Sep 2012 18:49:46 +0000 (UTC) (envelope-from kaduk@mit.edu) Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU [18.9.25.14]) by mx1.freebsd.org (Postfix) with ESMTP id 090218FC0A for ; Sat, 15 Sep 2012 18:49:45 +0000 (UTC) X-AuditID: 1209190e-b7f256d000000c6a-56-5054cdc8a814 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP id 6F.B9.03178.8CDC4505; Sat, 15 Sep 2012 14:49:44 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q8FInhT1007315; Sat, 15 Sep 2012 14:49:44 -0400 Received: from multics.mit.edu (MULTICS.MIT.EDU [18.187.1.73]) (authenticated bits=56) (User authenticated as kaduk@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q8FInfiR027313 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 15 Sep 2012 14:49:42 -0400 (EDT) Received: (from kaduk@localhost) by multics.mit.edu (8.12.9.20060308) id q8FInfM6022216; Sat, 15 Sep 2012 14:49:41 -0400 (EDT) Date: Sat, 15 Sep 2012 14:49:41 -0400 (EDT) From: Benjamin Kaduk To: "Julian H. Stacey" In-Reply-To: <201209151322.q8FDMobF058992@fire.js.berklix.net> Message-ID: References: <201209151322.q8FDMobF058992@fire.js.berklix.net> User-Agent: Alpine 1.10 (GSO 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrHIsWRmVeSWpSXmKPExsUixG6nonvibEiAwfzHIhbbN/9jtNiz9g27 A5PHvxvH2DxmfJrPEsAUxWWTkpqTWZZapG+XwJXx880NtoJO9oqJL98wNjA+YO1i5OSQEDCR aDq4gBnCFpO4cG89WxcjF4eQwD5GiVVtT1kgnA2MEtP/voFyDjBJbPu5iRnCaWCU2PH6BxtI P4uAtsS6OefBbDYBFYmZbzaC2SICGhKvDj0Cs5kF5CUubD7ECGILCzhJXLv9F+wOTgE7iZv3 tzCB2LwC9hLXNh8DqxESsJX42vELrEZUQEdi9f4pLBA1ghInZz5hgZhpKXHuz3W2CYyCs5Ck ZiFJLWBkWsUom5JbpZubmJlTnJqsW5ycmJeXWqRrrJebWaKXmlK6iREUrJySfDsYvx5UOsQo wMGoxMP7ITs4QIg1say4MvcQoyQHk5Ior/qpkAAhvqT8lMqMxOKM+KLSnNTiQ4wSHMxKIryH JgPleFMSK6tSi/JhUtIcLErivFdSbvoLCaQnlqRmp6YWpBbBZGU4OJQkeI+cAWoULEpNT61I y8wpQUgzcXCCDOcBGj4LpIa3uCAxtzgzHSJ/ilFRSpz3I0hCACSRUZoH1wtLJq8YxYFeEea9 A1LFA0xEcN2vgAYzAQ1e+CkIZHBJIkJKqoFRaK2A3mTBU/Pi+u45SlQnH+1KOMEe/SxQZPP6 LxNFrnat2n25766Gda3O+k7v0K6Zql1TMl0X/O0zD9qxMvXo2XeMp8J3fH0+QUPl9onyHUKG d9hfc7+P+MRzefGZGbZ6Hq0eb+fHns/VeJ74SevtZ+/tdw9P+MijPaXpgMINQ9ZO3wOx8XK6 SizFGYmGWsxFxYkAOevR0gEDAAA= Cc: freebsd-hackers@freebsd.org Subject: Re: Why fdisk can't open root disk with MBR for writing? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 18:49:46 -0000 On Sat, 15 Sep 2012, Julian H. Stacey wrote: > I have been applying this diff to my man fdisk: > > http://berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/gen/sbin/fdisk/ > > *** 8.0-RELEASE/src/sbin/fdisk/fdisk.8 Sat Mar 14 22:32:16 2009 > --- new-generic/src/sbin/fdisk/fdisk.8 Sat Mar 14 22:35:10 2009 > *************** > *** 462,464 **** > --- 462,468 ---- > The > .Xr bsdlabel 8 > command must be used for this. > + .Pp > + When running multi user, you cannot write unless you first run this: > + .br > + sysctl kern.geom.debugflags=16 > > I never submitted it as a send-pr, > anyone think I should submit it to help save people ? We have had a long discussion about kern.geom.debugflags starting here: http://lists.freebsd.org/pipermail/freebsd-current/2011-October/028090.html My understanding from that discussion is that your patch should not be accepted. -Ben Kaduk From owner-freebsd-hackers@FreeBSD.ORG Sat Sep 15 19:03:41 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1BF2E106566B for ; Sat, 15 Sep 2012 19:03:41 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id CE6118FC0C for ; Sat, 15 Sep 2012 19:03:40 +0000 (UTC) Received: by oagm1 with SMTP id m1so4642110oag.13 for ; Sat, 15 Sep 2012 12:03:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RzVxMt31Buoxn5YtMW4OoqkhDHlISvpWe+W8iy8Zhvw=; b=RxYF3wCNcY/iUsGcoWLEfRlbwwE+h9PDI8bgAe3J2Io6cgaOMpbhwoCESMkG4GoRgV gbc00kXfSLXxbHijMNyoaWsNknqrJa+vwLKVSSHtIqQI6r41182jehrsyPFpNBy6DPKU tujg0pwkPMBFe1LxDPLIN1MgkujY3YMbvPAEH+MGyakUU1obsv2jDNh5Q9ez4Sdq6oXT wxqFc9nwGfOSgkDU7lpZyR3yhOiOWZbYaVySIZLiWrL+fMJr0fNCibVniLxH/XHTPOXH QLejzvSwweLYxc3R7LNDyTalqRRO1fNBiiCfDyyPJoDe0GIZo2qAlMqmm5btLROKdmgn m8Ug== MIME-Version: 1.0 Received: by 10.60.13.232 with SMTP id k8mr7824661oec.81.1347735819019; Sat, 15 Sep 2012 12:03:39 -0700 (PDT) Received: by 10.76.142.201 with HTTP; Sat, 15 Sep 2012 12:03:38 -0700 (PDT) In-Reply-To: References: <201209151322.q8FDMobF058992@fire.js.berklix.net> Date: Sat, 15 Sep 2012 12:03:38 -0700 Message-ID: From: Garrett Cooper To: Benjamin Kaduk Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org, "Julian H. Stacey" Subject: Re: Why fdisk can't open root disk with MBR for writing? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Sep 2012 19:03:41 -0000 On Sat, Sep 15, 2012 at 11:49 AM, Benjamin Kaduk wrote: > On Sat, 15 Sep 2012, Julian H. Stacey wrote: > >> I have been applying this diff to my man fdisk: >> >> http://berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/gen/sbin/fdisk/ >> >> *** 8.0-RELEASE/src/sbin/fdisk/fdisk.8 Sat Mar 14 22:32:16 2009 >> --- new-generic/src/sbin/fdisk/fdisk.8 Sat Mar 14 22:35:10 2009 >> *************** >> *** 462,464 **** >> --- 462,468 ---- >> The >> .Xr bsdlabel 8 >> command must be used for this. >> + .Pp >> + When running multi user, you cannot write unless you first run this: >> + .br >> + sysctl kern.geom.debugflags=16 >> >> I never submitted it as a send-pr, >> anyone think I should submit it to help save people ? > > We have had a long discussion about kern.geom.debugflags starting here: > http://lists.freebsd.org/pipermail/freebsd-current/2011-October/028090.html > My understanding from that discussion is that your patch should not be > accepted. Correct. Either fdisk should be fixed or updated to point out that gpart should be used. There is some useful utility for fdisk still, but it's waning. Thanks, -Garrett