From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21405 invoked from network); 6 Oct 2022 10:53:31 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 6 Oct 2022 10:53:31 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1665053611; b=j4yq+q+tLr1I64+EGr3dJx1a+bHLh5H4AJmOTY2CHDEXoU5CGFDs+TBP6ytI+8PUpB5G3DonfJ Hq8FRM3jZ2NWPZENNs3aPirr2XsM6y/8yr2fOeAdZv2iSDawtsaf8/k3O0DbZcol/MBkshnVXa XH6wyt+wC27OUFXAf5L8u3s7O5TOUL0Y7XODjYkDdmpirys6QshPUKwFkJ+H/H6h41iypQIOWT L27bVWZ1L6hmJ9xg1O3b/GSbhXyNOnVl5wWxLjYX4a5nwC9t8udOjXyx0GU336APwnePzDX2PL /8y/yJNTeOjFuoqpBcUR5OfhElCa9xo9V47wogl/r7aqqA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mout.gmx.net) smtp.remote-ip=212.227.17.21; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.a=rsa-sha256; dmarc=none header.from=gmx.de; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1665053611; bh=6tMDUDS3EOZHYRV4C1bkJdhbUzIipX5mP3RxcBJTFm8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:In-Reply-To:Content-Type: MIME-Version:References:Reply-To:Message-ID:Subject:To:From:Date: DKIM-Signature:DKIM-Signature; b=AWJm87Vile2ZhtzLDFRD6pr0sci2ZX6Y2tzbz2vMzyFowHr9VOJPvEQsuB9O3bAS589hoZElau xovSgdrvbNZ8HDn4jHsEtdtkwmbdG0GJlRpbw+nOTV5GljcWjx9U1RW5onFVzokK55HtyI6NcW Gq/qtP5bVNeWvZ5XSYe1yVYNzPOiJz/P2m9W5e2bdK6uxUucXzEFQM/Z1sDHz8IOPWAMHavNeU aByr/QOgw1UCPJbNsVCStVnQ3yNlNU8dyWQ69adchX5JZ5MAi1mnFkUfEOyPOzd4Yom6diV/3K IGBRFndRmTY7lK4F39nQVPnvRxEZmxNDxwAPw0+OLEm42Q==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding:In-Reply-To :Content-Type:MIME-Version:References:Reply-To:Message-ID:Subject:To:From: Date:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=Dp/pWKX7KffkkHGaBgeTXHBAdiR1LLBD/OF2ZUVP7tM=; b=sIS67bR5jcToDNhCKVLLvj4dsH D6JO6kcB+Z4/aMsbkH6XtokRZBl51A6alXXYZ/eTFhcEfOBQ6G6RQlV5GUd8RmWO6gIidfe43sUbA cM1oTCa70QKCRN4fhXK5c1oP+ClhC201dyl6IbUFHmYR0UghGijTu/XcbpDW8Z82QDZMFyjfXTGyi O1GP/rtyHJjgAWxkq1Zvy+E4LTmdpGon2z3pifvxJ9p0WuuZ9Vvy2L4qisrqWBd+kMAIkWK+HCusK LePjcRS3CAPjulnpIRYVQ4KDRbbagkAZrmBYt/BhBt2i0ne2Ig2admKDHoZBD/mqIMs5VNQKf3vhp eys3Xxfg==; Received: from authenticated user by zero.zsh.org with local id 1ogOVP-000Bf9-FX; Thu, 06 Oct 2022 10:53:31 +0000 Authentication-Results: zsh.org; iprev=pass (mout.gmx.net) smtp.remote-ip=212.227.17.21; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.a=rsa-sha256; dmarc=none header.from=gmx.de; arc=none Received: from mout.gmx.net ([212.227.17.21]:44611) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1ogOUj-000B1V-3e; Thu, 06 Oct 2022 10:52:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1665053568; bh=6tMDUDS3EOZHYRV4C1bkJdhbUzIipX5mP3RxcBJTFm8=; h=X-UI-Sender-Class:Date:From:To:Subject:Reply-To:References: In-Reply-To; b=KrXSQ4rr8ZEXxt7ZUVNFXxr1S1N+oSLqqLcmdBJgoEtST3fwyOhvE44kyAdvhsioj vMbJglvRyee6AJA4y1xDYLK7y1LTLdUfGYcV9/bvbF9Joojz9X8vOVVHIpn5QsSp2E Jl3f543qLFqVUxRWvmTIWkjvC20hPkLSpf3W9m7I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from zitrone.obstwiese ([46.223.163.206]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MhD6g-1pAU7e0OXq-00eLhG for ; Thu, 06 Oct 2022 12:52:48 +0200 Received: from luthien by zitrone.obstwiese with local (Exim 4.94.2) (envelope-from ) id 1ogOUf-0001Vf-A3; Thu, 06 Oct 2022 11:52:45 +0100 Date: Thu, 6 Oct 2022 11:52:45 +0100 From: Dominik Vogt To: zsh-users@zsh.org Subject: Re: Bug: Losing .zsh_history Message-ID: Reply-To: dominik.vogt@gmx.de Mail-Followup-To: zsh-users@zsh.org References: <50fa26c9-98aa-1fc7-6bc5-f552a1f450f3@protonmail.com> <1099768997.2262545.1665049204679@mail.virginmedia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1099768997.2262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R3Qce+WYa8Pshl1o4h7lx0MdDDHvXBJZbGFHPSwflx7MlyAd jm0o/5eHIO/CbahII8ukqJ6SdsT5NQ1JD3mLlf3LaP1wlm3fN6E3oEPERiOy60teKRqf5YxYb 1SgdYQFCsAn+qLttXWtqHxnuEvcjUi9EZuZnq1XUd1Y8bya4Rk960gmwYWgPgbm1AgGisitf3 r6HTnfh4xrLBqS74MzMCzGeuyvxhmlYLJUprtjM7YX875add86llJkrMt5r32HLSh11nfz8jF nV6wRE96ngNv+LurTJkrEv1Nruty0ljUtQfGBLoku78MFzFQRvX3cHCRjAmOYSsPT4U+CmTj6 RR9+zbRVkp8g5kEbU0iuM+n+l1sYExsxzk5Omt97nhmFhM1hRQ3M0XzgjqTCEKwwOqt9FDAzX sxnhjKTK2HhPiuwCFqZr5+UT9p Content-Transfer-Encoding: quoted-printable X-Seq: 28190 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Thu, Oct 06, 2022 at 10:40:04AM +0100, Peter Stephenson wrote: > Deliberately deleting the previous history in this thread (tee hee) > because I want to get a higher level picture... > > We seem to be homing in on cases where the shell is involved in > misbehaviour but doesn't get enough information or warning that > something's up that it can do anything about it. Is that fair, or is > there some aspect that might give it a head's up that writing history > could be dangerous? With the discussion and the available my hypothesis of whats happening: On an unjournaled ext4 (on an SSD; with "discard" option) 1) System starts shutdown 2) Shell is told to terminate. 3) Shell writes new history into separate file. This is cached by the disk, the disk drivers or the fs layer. 4) Shell moves new history over old one. This is cached by the disk, the disk drivers or the fs layer. 5) Because the filesystem is not journaled, the changes from the previous step are written to disk in random order. 6) Power loss occurs while the new directory entries have already been written to disk, but the new file contents have not. (The box is attached to a switchable multi socket adapter.) This wouldn't be the fault of the shell. Still, why did this happen to the history files twice, but not to the browser config files which are also written at shutdown? Is there anything the shell could do to prevent this or make it less likely? More fsync()s? Ciao Dominik ^_^ ^_^ =2D- Dominik Vogt