bash exec command unwanted behaviour

Bug #1952584 reported by Ümit Atakul
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
New
Undecided
Unassigned

Bug Description

(GNU bash 4.3.46)
(ubuntu 16.04 LTS)

Consider you have out.txt on current dir.
-------
>exec 123456789012>out.txt
bash: exec: 123456789012: not found
-------
exec command prints indicated error for large numbers that is supposed to use as a fd but redirects /proc/$$/fd/1 to out.txt silently.

Additionally,
-------
>exec 1234567890>out.txt
bash: 123456789: Bad file descriptor
-------
For large numbers but not that large (I don't inspect the limits!), exec command rejects fd number but silently adds a new fd to current bash process. In every execution of the command, bash adds a new fd to itself again and again.
---
ProblemType: Bug
ApportVersion: 2.20.11-0ubuntu27.16
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
DistroRelease: Ubuntu 20.04
NonfreeKernelModules: nvidia_modeset nvidia
Package: bash 5.0-6ubuntu1.1
PackageArchitecture: amd64
ProcVersionSignature: Ubuntu 4.15.0-141.145-generic 4.15.18
Tags: focal
Uname: Linux 4.15.0-141-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm cdrom dip libvirt lpadmin plugdev sambashare sudo wireshark
_MarkForUpload: True

Revision history for this message
Chris Guiver (guiverc) wrote :

Thank you for reporting this bug to Ubuntu.

Ubuntu 16.04 (xenial) reached end-of-standard-life on April 29, 2021.

See this document for currently supported Ubuntu releases:
https://wiki.ubuntu.com/Releases

We appreciate that this bug may be old and you might not be interested in discussing it any more. But if you are then please upgrade to the latest Ubuntu version and re-test. If you then find the bug is still present in the newer Ubuntu version, please add a comment here telling us which new version it is in.

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Changed in bash (Ubuntu):
status: New → Incomplete
Revision history for this message
Ümit Atakul (uatakul) wrote :

(Ubuntu 20.04.2 LTS)
(Bash 5.0.17(1)-release)

I have tested same scenarios on a newer system again.

The first bug reported on the previous post are still available.

But the second bug is no longer exist.

Thanks.

Revision history for this message
Chris Guiver (guiverc) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command only once, as it will automatically gather debugging information, in a terminal:

apport-collect 1952584

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

(this should be run on the 20.04 machine; as 16.04 has completed it's five year standard support cycle, and now only gets security related fixes for ESM users)

Revision history for this message
Ümit Atakul (uatakul) wrote : Dependencies.txt

apport information

tags: added: apport-collected focal
description: updated
Revision history for this message
Ümit Atakul (uatakul) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Ümit Atakul (uatakul) wrote : ProcEnviron.txt

apport information

Chris Guiver (guiverc)
Changed in bash (Ubuntu):
status: Incomplete → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.