Bash dies with a SIGABRT sporadically when doing 'read -N INTEGER'.

Bug #1583269 reported by David Hunt
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Bash sometimes dies with a SIGABRT on the command
        read -N $N < /dev/urandom
where $N represent an integer >=1.

It occurs frequently for high values of N (>2**20).
It occurs rarely for low values of N (<2**20).
It has occurred more than once with a value of N as low as 128!

With N=2**21, this command aborts approximately 5 out of 10 tries.
        ( read -N 2097152 < /dev/urandom )

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: bash 4.3-14ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-22.40-generic 4.4.8
Uname: Linux 4.4.0-22-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Wed May 18 12:24:28 2016
DistributionChannelDescriptor:
 # This is a distribution channel descriptor
 # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
 canonical-oem-formosa-beigang-precise-amd64-20130801-1
InstallationDate: Installed on 2016-01-23 (116 days ago)
InstallationMedia: Ubuntu 12.04 "Precise" - Build amd64 LIVE Binary 20130801-07:00
SourcePackage: bash
UpgradeStatus: Upgraded to xenial on 2016-04-22 (26 days ago)

Revision history for this message
David Hunt (another-david-hunt) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in bash (Ubuntu):
status: New → Confirmed
Revision history for this message
xhienne (xhienne) wrote :

Affects trusty too. A quick way to reproduce this is (works 9 times out of 10 here):
$ bash -c 'read -N 10000000' < /dev/urandom

Trusty output:
$ bash -c 'read -N 10000000' < /dev/urandom
malloc: ../.././builtins/../.././builtins/read.def:603: assertion botched
realloc: start and end chunk sizes differ
Aborting...Aborted

Xenial output:
$ bash -c 'read -N 10000000' < /dev/urandom
malloc: ../.././builtins/../.././builtins/read.def:617: assertion botched
realloc: start and end chunk sizes differ
Aborting...Aborted

tags: added: trusty
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.