bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bash-devel] Attempting to cd to the empty directory operand where .


From: Kerin Millar
Subject: Re: [bash-devel] Attempting to cd to the empty directory operand where ./ does not exist aborts
Date: Mon, 29 Jan 2024 15:38:05 +0000

On Mon, 29 Jan 2024 10:30:43 -0500
Chet Ramey <chet.ramey@case.edu> wrote:

> On 1/29/24 5:51 AM, Kerin Millar wrote:
> 
> > $ bash -c 'declare -p BASH_VERSION; cd ""'
> > shell-init: error retrieving current directory: getcwd: cannot access 
> > parent directories: No such file or directory
> > declare -- BASH_VERSION="5.3.0(4)-devel"
> > chdir: error retrieving current directory: getcwd: cannot access parent 
> > directories: No such file or directory
> > malloc: ./cd.def:619: assertion botched
> > malloc: 0x56be197137b0: allocated: last allocated from pathcanon.c:109
> > free: start and end chunk sizes differ
> > Aborting...Aborted (core dumped)
> 
> Thanks for the report. `cd' should not try to canonicalize empty pathnames;
> it should just see what chdir(2) returns and go from there.
> 
> > And, again, with bash 5.2.
> 
> I suspect your version of bash-5.2 is built without the bash malloc for
> some reason, since I can reproduce this with bash-5.2.

You are quite right.

https://gitlab.archlinux.org/archlinux/packaging/packages/bash/-/blob/c5dfc21dfe74524ca5766af83924cc8c3e3f1a0a/PKGBUILD#L60

-- 
Kerin Millar



reply via email to

[Prev in Thread] Current Thread [Next in Thread]