Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Broken elf header incorrectly identified as missing file
- X-seq: zsh-workers 54372
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Oliver Kiddle <opk@xxxxxxx>
- Cc: Nathan <nathan.titirangi@xxxxxxxxx>, zsh-workers@xxxxxxx
- Subject: Re: Broken elf header incorrectly identified as missing file
- Date: Fri, 17 Apr 2026 17:47:18 +0200
- 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:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Dk/qbljm1y5Qdo+/dICb5aN2g24jlFlu4Pv++WVoLOE=; fh=vob/QK92NyE0N6qwcWuGGYbyfjAjxEXGHhTTPVbhKrk=; b=V3vsgZ731oFOCClm4K9XcsxYw/pSvAnf+zThGONp4S9bAUvgmzDxTx8Ne1msfITf4G 7VC0XZkXOiDuZIIwn7l4qa+gAzCGldJ5rHFvTfbHkU2P1VbbfiDDaoLCmOkZBIYY2pNh +9P/qe3FPqgSDbFGwkfbxodJdCZDmkCQiP0fnJ0HkJJobi9uyIP1YALM9WIM/dg/bsh8 KkRL4NNL+ii6kgKTqXuQUfvfK4OSB0XN161rBGa2ZzLUxU+5g9chVB+FwKBhMDMiBXD0 q2TV/SRWJr5e9/sB6Icfx0oAHNhbIJwImu5VnT0ng6PIjFxeQfLIE9Rs4Hca6Y5Cf8NO ZYEg==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1776440852; cv=none; d=google.com; s=arc-20240605; b=BE5SoBV6mbHWTxi5a2ACVAKyIuu7355v1/2DICF4v/0wOhJd2l5v3siUjtPxUsWoBc lv9hcYENE/Me0E9e/CdqqiMfTPIvHAOr3HmkHeBrRS1wtZa72kTqjLs7qA026BYXZrhx lcQMa9yqqYrUSaJ0L2BWxXPh8mwtOaIRKCGuSES06/hGmqOgA7UrfRkt8/EYp5FSUdYy rbfyIQWImmtVfJsex4gGnMC4JGIGJxTO/dBS3L1mFr/MKl8IVY+TwD6KR7I3CvohsPHv fjg9OJ6HgTzigWcJWREqLyUr8hmJi4xIByxd6NGq+p072mnGRdqeNS/vCn/Mb8rWRMsv onIQ==
- Archived-at: <https://zsh.org/workers/54372>
- In-reply-to: <34178-1776428538.059420@LBVL.DoNP.Oed_>
- List-id: <zsh-workers.zsh.org>
- References: <CAE3bff1FTL_XEeAXEWgv+1bLKFvc3Yd4YjVZRG-V3yY3iZ44EQ@mail.gmail.com> <34178-1776428538.059420@LBVL.DoNP.Oed_>
On Fri, Apr 17, 2026 at 2:22 PM Oliver Kiddle <opk@xxxxxxx> wrote:
>
> Nathan wrote:
> > On zsh 5.9 (x86_64-ubuntu-linux-gnu)
> >
> > To reproduce:
> > 1. Create a malformed elf binary by deleting everything past part way through
> > the file (a broken binary that triggers the bug is attached)
> > 2. Make the binary executable
> > 3. Attempt to run the binary with ./b.out
> > 4. Observe that the file is incorrectly identified as not existing, when the
> > actual issue is a broken elf header
>
> It is not the job of the shell to dig in to malformed binaries. We pass
> it on to the operating system and system loader and error handling is
> their job.
>
> > Bash returns the correct error message, but several other shells return the
> > same wrong error.
>
> Probably because bash does go poking around in ELF binaries. This was
> proposed (and rejected) also for zsh, see:
>
> zsh-workers/34909 or https://www.zsh.org/mla/workers/2015/msg00833.html
>
> I've not examined the attached binary as such. If there are ways to get
> better errors just from the OS APIs then let us know. Not all systems
> zsh runs on use ELF.
And if the file is not readable, this won't work anyway, so even the
corner case has a corner case.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author