Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: nofork leaves tmp files behind on errexit and ${foo?bar}
- X-seq: zsh-workers 54466
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: nofork leaves tmp files behind on errexit and ${foo?bar}
- Date: Sun, 3 May 2026 22:36:39 -0700
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uYO2/NpnbkEtLrZGECifByhBuoz6LXp0KmHgMWIyVTU=; fh=DSq7imBqIFzdbbKtbVCpdy8HVz0gMsj8pDLr9jpnRMA=; b=X+tZInvmifotv6rxiOIW88GKwTFf79G+del9k2L2qf8Z7ly4GCRlUtxAjT5mT0Fcgm 9G8MAP3U9icHT55aU4rnfROKrIXpTyneY3PrrADV9MJap8LibqXZgSxHG/X0x3O3eegi aQHnTLMnyBF4kaDNE/yLIqk6CG24ZrbxSQHnW6IG6VG7anvlE/fv7vv7pzD3JSqpdZ1y fRAm6iLXm42kHxn9W60Qax1uZ+aUIj9yFoFsrAXDzt31sXVe/xhOUfd879Rj1rA6pG+l ZrRAQKIVMaPQkjFRn/lx3hKJ+fSMxpz3n01sa/OvicppZpao0e1soGgF6gC8sAOxHawH sSIw==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1777873011; cv=none; d=google.com; s=arc-20240605; b=hHsi0vD8a6aCIVN2MOSQQlMpzFFMwsWldExX9n0NIdU8AwqZkJqOifCCG8qn0Vnjxe /6MKr3t3MKqcDrjh/zNDRiJKulFETVrpCoMg+E8aCcwCuRMJEI4dKnV6w+qzPCj2IouP Jr1WWnnZ6Hh5l5LPBQdxSK8m21eZFxTgCW4A8z43zzBTw6yopYD1jk7TGkwAtXueE07m q/KmMFDNliunUE58KYfaIjOElbHg2VCHzUth3KT/B3MASGbwdwZtDm1cP9qI+OwDoEwb NnGBjVMz7o/L47Ys1QRknzyYYSaLsEj+8+x3w4/gUQC2C039oFaCEW2TLqVAPe3KG5CK sfVA==
- Archived-at: <https://zsh.org/workers/54466>
- In-reply-to: <CAHYJk3RwMATGznPZ+So0qAfYTt=tJv78v2nX6bh3DAyY=U0UeQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHYJk3RwMATGznPZ+So0qAfYTt=tJv78v2nX6bh3DAyY=U0UeQ@mail.gmail.com>
On Sun, May 3, 2026 at 7:55 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> I noticed this because the test suite does this, and my /tmp had a ton
> of zshdo8sar files.
Interesting. If I run each of the tests separately with
make check TESTNUM=...
then no /tmp/zsh*(.) file is left behind, but every test leaves
/tmp/zsh.ztst.<->
If I run the entire test suite, then I get two /tmp/zsh*(.) but no
/tmp/zsh.ztst.<->
So there's something fishy going on with either options, or with the
tests cleaning up after themselves.
> the test that explicitly exits rather than depend on errexit does not
> leave the tmpfile behind, which makes me think this can possibly be
> fixed?
Unfortunately it's not simple. "exit" calls bin_exit() which notices
that we're not at the top level and sets exit_pending without actually
exiting. ERR_EXIT on the other hand calls realexit() straight from
the depths of exec.c, there's no opportunity to catch it.
There might be a way to unlink the file in advance, but that means
making several larger changes.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author