bash completion shows `awk: line 18: function gensub never defined` on `umount /dev/<Tab>`

Bug #1845529 reported by Norbert on 2019-09-26
50
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Debian
Confirmed
Unknown
bash-completion (Ubuntu)
Status tracked in Focal
Eoan
Undecided
Unassigned
Focal
High
Unassigned
gawk (Ubuntu)
Eoan
Undecided
Unassigned
Focal
Undecided
Unassigned
mawk (Ubuntu)
Eoan
Undecided
Unassigned
Focal
Undecided
Unassigned
ubuntu-meta (Ubuntu)
Status tracked in Focal
Eoan
Undecided
Unassigned
Focal
Undecided
Unassigned
util-linux (Ubuntu)
Status tracked in Focal
Eoan
Undecided
Unassigned
Focal
Undecided
Unassigned

Bug Description

[Impact]
Any user attempting to tab-complete from "umount /dev/" when running the bash shell.

[Test cases]
Steps to reproduce:
1. Install Ubuntu MATE 19.10 using minimal desktop option
2. Open terminal and enter `umount /dev/s` and then hit <Tab>

Expected result:
* bash completion works as expected

Actual results:
* bash completion does not work :

$ umount /dev/awk: line 18: function gensub never defined
awk: line 18: function gensub never defined
awk: line 18: function gensub never defined
awk: line 18: function gensub never defined

$ umount /meawk: line 18: function gensub never defined
awk: line 18: function gensub never defined
awk: line 18: function gensub never defined
awk: line 18: function gensub never defined

[Regression potential]
Since it is limited to a single file (/usr/share/bash-completion/completions/umount) and affects only it, as well as given that it currently does not work, I estimate this as a low risk change. Things to look out for as a regression would be if another previously-working completion would fail to work (ie. what if mount stops completing correctly, and works again if the fix is backed out?).

---

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: bash-completion 1:2.9-1ubuntu1
ProcVersionSignature: Ubuntu 5.3.0-10.11-generic 5.3.0-rc8
Uname: Linux 5.3.0-10-generic x86_64
ApportVersion: 2.20.11-0ubuntu7
Architecture: amd64
CurrentDesktop: MATE
Date: Thu Sep 26 18:46:59 2019
Dependencies:

InstallationDate: Installed on 2019-09-26 (0 days ago)
InstallationMedia: Ubuntu-MATE 19.10 "Eoan Ermine" - Beta amd64 (20190926.1)
PackageArchitecture: all
SourcePackage: bash-completion
UpgradeStatus: No upgrade log present (probably fresh install)

Norbert (nrbrtx) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bash-completion (Ubuntu):
status: New → Confirmed
Brian Murray (brian-murray) wrote :

I've been able to recreate in this in a freshly installed Ubuntu 19.10 system, but on my desktop which has been upgraded from Ubuntu 18.04 I have not.

tags: added: rls-ee-incoming
Changed in bash-completion (Ubuntu):
importance: Undecided → Medium
importance: Medium → High
Changed in debian:
status: Unknown → Confirmed
Sebastien Bacher (seb128) wrote :

Reading the Debian bug it seems to Depends of the 'awk' variant installed, do you have 'gawk' on your system? If not does installing it resolve the issue? (it's installed on Ubuntu)

Norbert (nrbrtx) wrote :

I have tested this on the live system of Ubuntu MATE (http://cdimage.ubuntu.com/ubuntu-mate/daily-live/20191010/eoan-desktop-amd64.iso).
Here we have only `mawk` package pre-installed. Such a system does not have `gawk` installed.

Aptitude says that `mawk` was installed because of `ubuntu-minimal` (also see see https://packages.ubuntu.com/eoan/ubuntu-minimal ):

```
aptitude why mawk
i ubuntu-minimal Depends mawk
```

The system installed from netboot.iso (http://archive.ubuntu.com/ubuntu/dists/eoan/main/installer-amd64/current/images/netboot/mini.iso) is affected too.

So really It seems that `mawk` package is buggy.

---

It would be really great if you fix this package before final release of 19.10.
Or change `ubuntu-minimal` dependency on `mawk` to `gawk`.

no longer affects: ubuntu-mate-meta (Ubuntu)
no longer affects: ubuntu-meta (Ubuntu)
Thomas Dickey (dickey-his) wrote :

gensub is a gawk extension (it helps to read the manual page).

Thomas Dickey (dickey-his) wrote :

(this isn't a bug in mawk, since gawk's extensions aren't in the standard).

Changed in mawk (Ubuntu):
status: New → Invalid
Changed in bash-completion (Ubuntu):
status: Confirmed → Invalid
Norbert (nrbrtx) wrote :

@Thomas Dickey (dickey-his)

Could you please carefully describe why was it working on 19.04?
I see `mawk` installed on Ubuntu MATE 19.04. And bash-completion for `umount` works here without problems.

Norbert (nrbrtx) on 2019-10-10
Changed in bash-completion (Ubuntu):
status: Invalid → Confirmed
Norbert (nrbrtx) wrote :

It seems that you have blindly applied non-universal commits from Debian:

https://git.launchpad.net/ubuntu/+source/bash-completion/log/completions/_umount
https://git.launchpad.net/ubuntu/+source/bash-completion/log/completions/_umount.linux

while they are not compatible with `mawk`.

The `mawk` itself has the same version 1.3.3-17ubuntu3 on 18.04 LTS, 19.04 and 19.10 (see https://packages.ubuntu.com/search?suite=all&exact=1&searchon=names&keywords=mawk ). So it is not the problem.

So you should change `mawk` dependency to `gawk` on the Ubuntu side or revert these commits inside `bash-completion`.

Thomas Dickey (dickey-his) wrote :

Sure - actually not a **bug** in gawk or mawk, but the nuances of that were omitted from the cited discussions (which you appear to not have read - take some time and do that).

affects: mawk (Ubuntu) → gawk (Ubuntu)
Norbert (nrbrtx) on 2019-10-12
Changed in mawk (Ubuntu):
status: New → Invalid
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-meta (Ubuntu):
status: New → Confirmed
Steve Langasek (vorlon) wrote :

This is not a bug in ubuntu-meta. It doesn't matter whether an older version of Ubuntu gave you gawk (in addition to mawk) by default, bash-completion should not be using gawk extensions without declaring a dependency on gawk (and invoking gawk by name).

Changed in ubuntu-meta (Ubuntu):
status: Confirmed → Invalid
Changed in bash-completion (Ubuntu):
status: Confirmed → Triaged
summary: - bash completion in 19.10 shows `awk: line 18: function gensub never
- defined` on ``umount /dev/<Tab>`
+ bash completion shows `awk: line 18: function gensub never defined` on
+ `umount /dev/<Tab>`
tags: added: rls-ee-notfixing rls-ff-incoming
removed: rls-ee-incoming
Shih-Yuan Lee (fourdollars) wrote :

FYI, `sudo apt install gawk` can avoid this problem.
Debian Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933934

tags: removed: rls-ff-incoming
Timo Aaltonen (tjaalton) wrote :

missing SRU style description

Steve Langasek (vorlon) wrote :

NB for an easier reproducer on eoan without requiring a reinstall, you can use 'sudo update-alternatives --config awk' to change the target of /usr/bin/awk to mawk.

Steve Langasek (vorlon) wrote :

marking incomplete based on Timo's request for a proper SRU bug template

Changed in bash-completion (Ubuntu Focal):
status: Triaged → Incomplete
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package util-linux - 2.34-0.1ubuntu4

---------------
util-linux (2.34-0.1ubuntu4) focal; urgency=medium

  * bash-completion/umount: fix completion to not require gawk be present.
    Thanks to Étienne Mollier for the patch. (LP: #1845529)

 -- Mathieu Trudel-Lapierre <email address hidden> Tue, 03 Dec 2019 15:27:13 -0500

Changed in util-linux (Ubuntu Focal):
status: New → Fix Released
description: updated
Changed in bash-completion (Ubuntu Focal):
status: Incomplete → Invalid
Changed in bash-completion (Ubuntu Eoan):
status: New → Invalid
no longer affects: gawk (Ubuntu)
no longer affects: mawk (Ubuntu)

Hello Norbert, or anyone else affected,

Accepted util-linux into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/util-linux/2.34-0.1ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in util-linux (Ubuntu Eoan):
status: New → Fix Committed

All autopkgtests for the newly accepted util-linux (2.34-0.1ubuntu2.1) for eoan have finished running.
The following regressions have been reported in tests triggered by the package:

systemd/242-7ubuntu3.2 (i386)
netplan.io/0.98-0ubuntu1 (ppc64el)
network-manager/1.20.4-2ubuntu2 (ppc64el)
python3.8/3.8.0-3~19.10 (amd64)
rmlint/unknown (armhf)
sbd/1.4.0-18-g5e3283c-1ubuntu1 (i386)
gfs2-utils/3.2.0-2 (i386)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/eoan/update_excuses.html#util-linux

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

tags: added: id-5ddff28c2475535c4124414c
Steve Langasek (vorlon) on 2020-01-06
Changed in gawk (Ubuntu Eoan):
status: New → Invalid
Changed in mawk (Ubuntu Eoan):
status: New → Invalid
Changed in ubuntu-meta (Ubuntu Eoan):
status: New → Invalid
tags: added: verification-needed verification-needed-eoan
Brian Murray (brian-murray) wrote :

I have not been able to verify this after installing the package and starting bash again. I even went as far as a reboot.

bdmurray@clean-eoan-amd64:~$ apt-cache policy util-linux
util-linux:
  Installed: 2.34-0.1ubuntu2.1
  Candidate: 2.34-0.1ubuntu2.1
  Version table:
 *** 2.34-0.1ubuntu2.1 500
        500 http://192.168.10.7/ubuntu eoan-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     2.34-0.1ubuntu2 500
        500 http://192.168.10.7/ubuntu eoan/main amd64 Packages
bdmurray@clean-eoan-amd64:~$ umount /devawk: line 18: function gensub never defined
awk: line 18: function gensub never defined
awk: line 18: function gensub never defined
awk: line 18: function gensub never defined

umount: /dev: umount failed: Operation not permitted.

Steve Langasek (vorlon) wrote :

I've confirmed that with mount from the eoan release pocket, tab completion fails as described; and with mount from eoan-proposed, it succeeds; when /etc/alternatives/awk points to mawk.

tags: added: verification-done-eoan
removed: verification-needed-eoan
Brian Murray (brian-murray) wrote :

Ah, I had not install the mount command - after doing that it passes verification.

Preparing to unpack .../mount_2.34-0.1ubuntu2.1_amd64.deb ...
Unpacking mount (2.34-0.1ubuntu2.1) over (2.34-0.1ubuntu2) ...
Setting up mount (2.34-0.1ubuntu2.1) ...
Processing triggers for man-db (2.8.7-3) ...
bdmurray@clean-eoan-amd64:~$ bash
bdmurray@clean-eoan-amd64:~$ umount /dev/
/dev/hugepages /dev/mqueue /dev/pts /dev/shm

Looked at the remaining autopkgtest failures for util-linux/eoan [1]:

util-linux
Regression in autopkgtest for sbd (i386): test log
Regression in autopkgtest for gfs2-utils (i386): test log
Regression in autopkgtest for network-manager (ppc64el): test log

- sbd/i386:
  passed with retries [2]

- network-manager/ppc64el:
  passed with retries [3]

- gfs2-utils/i386:
  failure is unrelated to this change.

  there's an ioctl() failing w/ ENOTTY from the kernel (see strace below)
  so it's unrelated to this change to bash autocompletion.

  it's reproducible w/ util-linux from eoan-updates,
  thus not a regression from eoan-proposed.

  i'll try to look at this,
  but this should not block this SRU any longer.

root@autopkgtest:~# strace -e ioctl gfs2_jadd -j 1 /mnt2
ioctl(5, FS_IOC32_GETFLAGS or FS_IOC_GETFLAGS, 0xffb9d568) = -1 ENOTTY (Inappropriate ioctl for device)
ioctl(6, TCGETS, {B9600 opost isig icanon echo ...}) = 0
GETFLAGS: Inappropriate ioctl for device
+++ exited with 1 +++

root@autopkgtest:~# dpkg -s util-linux | grep -i version:
Version: 2.34-0.1ubuntu2

cheers,
Mauricio

[1] https://people.canonical.com/~ubuntu-archive/pending-sru.html

[2] https://autopkgtest.ubuntu.com/packages/sbd/eoan/i386
sbd [eoan/i386]
1.4.0-18-g5e3283c-1ubuntu1 util-linux/2.34-0.1ubuntu2.1 2020-01-14 13:02:27 UTC 0h 16m 07s mfo pass

[3] https://autopkgtest.ubuntu.com/packages/network-manager/eoan/ppc64el
network-manager [eoan/ppc64el]
1.20.4-2ubuntu2 util-linux/2.34-0.1ubuntu2.1 2020-01-14 13:06:12 UTC 0h 20m 00s mfo pass

tags: removed: verification-needed

Update on autopkgtests.

The only failure left was gfs2-utils, which is unrelated.

I just confirmed it's indeed unrelated (passes on i386 kernel, fails on amd64 kernel, same version), and reported bug 1859827 to work on it.
The failure started to happen because the i386 kernels are no longer built/available.

This should be good to go now.

cheers,
Mauricio

- i386/i686)

# uname -rvm
5.3.0-13-generic #14-Ubuntu SMP Tue Sep 24 02:43:47 UTC 2019 i686

root@sf256930ei:~# gfs2_jadd -j 1 /mnt
Filesystem: /mnt
Old journals: 2
New journals: 3

- amd64/x86_64)

# uname -rvm
5.3.0-13-generic #14-Ubuntu SMP Tue Sep 24 02:46:08 UTC 2019 x86_64

# gfs2_jadd -j 1 /mnt
GETFLAGS: Inappropriate ioctl for device

The verification of the Stable Release Update for util-linux has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package util-linux - 2.34-0.1ubuntu2.1

---------------
util-linux (2.34-0.1ubuntu2.1) eoan; urgency=medium

  * bash-completion/umount: fix completion to not require gawk be present.
    Thanks to Étienne Mollier for the patch. (LP: #1845529)

 -- Mathieu Trudel-Lapierre <email address hidden> Wed, 11 Dec 2019 14:47:41 -0500

Changed in util-linux (Ubuntu Eoan):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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