Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 255343 - sys-apps/coreutils-6.10-r2 - unexpand gets wedged by conflicting options -t3 -t5
Summary: sys-apps/coreutils-6.10-r2 - unexpand gets wedged by conflicting options -t3 -t5
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-18 04:38 UTC by Kevin O'Gorman
Modified: 2009-02-22 00:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Short bash script to cause the bug (unexpand-bug-1.sh,299 bytes, text/plain)
2009-01-18 04:55 UTC, Kevin O'Gorman
Details
Test case to produce illustrated output (testcase.sh,109 bytes, text/plain)
2009-01-22 18:15 UTC, Kevin O'Gorman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin O'Gorman 2009-01-18 04:38:25 UTC
Rather than give an error or even peculiar output, the unexpand(1) utility
(sys-apps/coreutils-6.10-r2) gets wedged.  I used this script to cause it
(I'll also attach a copy)

-------- BEGIN: cut here
#!/bin/bash
echo This is going to cause an infinite delay in unexpand
echo The options switches are nonsensical, but should not cause this behavior.
echo The input is a single line consisting of 9 spaces and the letter a.
echo Other things probably fail too.

unexpand -t3 -t5 <<EOF
          a
EOF
------------ END: cut here



Reproducible: Always




This bug was found by students assigned to replicate the utility.  It occurs
on several Linux distributions, but gentoo is what I use so i'm reporting it here.
Comment 1 Kevin O'Gorman 2009-01-18 04:55:29 UTC
Created attachment 178857 [details]
Short bash script to cause the bug

This script causes an infinite delay (possibly inifinite output).  Nothing in the
man or info pages suggests such a possibility.  It would seem wise for this to
cause an error diagnostic and an early death.
Comment 2 Wormo (RETIRED) gentoo-dev 2009-01-19 02:00:22 UTC
Thanks for the report and test case; assigning to maintainers.
Comment 3 Wormo (RETIRED) gentoo-dev 2009-01-19 02:11:12 UTC
Oops, I ran the test case and it didn't fail on my system, which also has coreutils-6.10-r2 installed. 

We're going to need you to post more info to be able to reproduce this... let's start with 'emerge --info' output.
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2009-01-20 15:44:12 UTC
Confirmed with sys-apps/coreutils-6.10-r2.

Tue Jan 20 16:43:37 CET 2009
Portage 2.2_rc23 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.25-gentoo-r7-JeR i686)
=================================================================
System uname: Linux-2.6.25-gentoo-r7-JeR-i686-AMD_Athlon-tm-_XP_2500+-with-glibc2.0
Timestamp of tree: Tue, 20 Jan 2009 05:15:01 +0000
distcc[5510] (dcc_set_trace_from_env) ERROR: failed to open logfile /var/log/distcc: Permission denied [disabled]
ccache version 2.4 [disabled]
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7-r1, 2.1.6-r1
dev-lang/python:     2.5.2-r7
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.4.6-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=athlon-xp"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/app-defaults/XTerm /usr/share/X11/app-defaults/XTerm-color"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -march=athlon-xp"
DISTDIR="/keeps/gentoo/distfiles"
FEATURES="autoaddcvs buildpkg cvs distlocks fixpackages notitles parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.tiscali.nl/ http://mirror.muntinternet.net/pub/gentoo/ http://mirror.cambrium.nl/pub/os/linux/gentoo/ http://mirror.leaseweb.com/gentoo/ "
LANG="en"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_GB nl"
MAKEOPTS="-j3"
PKGDIR="/keeps/gentoo/packages/astrid"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/keeps/gentoo/portage"
PORTDIR_OVERLAY="/keeps/gentoo/local"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac aalib acpi alsa asf audiofile bash-completion berkdb bl bluetooth boost branding bzip2 cairo cdda cddb cdio cdparanoia cdr chroot cli cpudetection cracklib crypt cscope css cups curl custom-cflags dga dillo divx dri dv dvd dvdr dvdread edl eds elf emboss encode evo fame fbcon ffmpeg flac flash fontforge foomaticdb fortran freetype gdbm ggi gif gimpprint glib glitz glut gmedia gnokii gnutls gpm gs gstreamer gtk gtk2 iconv idn imagemagick imlib inkjar ipv6 isdnlog jingle jpeg kde lcms libcaca libnotify libsamplerate live lm_sensors logrotate lzo mad matroska midi mikmod mjpeg mmx mng modplug mozilla mozsvg mozxmlterm mp3 mpeg mplayer mudflap musepack ncurses nethack network nls nptl nptlonly nsplugin offensive ogg opengl openmp optimisememory pam pcre pda pdf perl physfs plotutils png ppds pppd pulseaudio python quicktime readline realmedia reflection rtc rtsp ruby samba screenshot sdl server session sftplogging shout skins smux snmp speex spell spl sse ssl startup-notification stream svg sysfs syslog tcpd test tetex tga theora threads tiff truetype unicode upnp usb userlocales utils v4l v4l2 vcd vidix vim vlm vorbis win32codecs winbind wmp x86 xanim xml xml2 xorg xosd xulrunner xv xvid xvmc zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB nl" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 5 Kevin O'Gorman 2009-01-22 18:13:07 UTC
From the original poster:

I'm also attaching a slightly more sophisticated test case as a bash script.

kevin@treat Test $ emerge --info
Portage 2.1.6.4 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.27-gentoo-r7-kosmanor i686)
=================================================================
System uname: Linux-2.6.27-gentoo-r7-kosmanor-i686-Intel-R-_XEON-TM-_CPU_1.80GHz-with-glibc2.0
Timestamp of tree: Thu, 22 Jan 2009 08:45:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7-r1, 2.1.6-r1
dev-lang/python:     2.4.4-r14, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
dev-util/cmake:      2.4.6-r1
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Wall -g"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer -pipe -mfpmath=sse -msse2 -mmmx"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ ftp://ftp.gtlib.gatech.edu/pub/gentoo ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ http://cudlug.cudenver.edu/gentoo/ http://gentoo.netnitco.net ftp://gentoo.netnitco.net/pub/mirrors/gentoo/source/ http://mirror.datapipe.net/gentoo "
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="en fr de es pl"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/overlay"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="X Xaw3d acl acpi aim alsa apache2 apm bash-completion bcmath berkdb branding bzip2 cairo calendar caps cdr cli cracklib crypt cscope ctype cups dbm dbus dri dvd dvdr dvdread eds emboss encode esd evo exif fam fastcgi foomaticdb fortran gdbm gif gnome gphoto2 gpm gstreamer gtk guile hal iconv icq imap imlib ipv6 isdnlog java jbig joystick jpeg kde ldap libnotify libwww mad mailwrapper mbox mcal midi mikmod mime mmap mmx motif mp3 mpeg mpi mudflap mysql ncurses nis nls nptl nptlonly nsplugin odbc offensive ogg openal opengl openmp oscar pam pcre pdf perl pic png posix postgres ppds pppd python qt3 qt3support qt4 quicktime readline reflection ruby samba sdl session snmp sockets spell spl sse ssl startup-notification svg svga symlink sysfs sysvipc tcpd tetex tiff tk truetype unicode usb vorbis win32codecs x86 xml xorg xpm xulrunner xv yahoo zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en fr de es pl" USERLAND="GNU" VIDEO_CARDS="vga fbdev fglrx vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 6 Kevin O'Gorman 2009-01-22 18:15:56 UTC
Created attachment 179358 [details]
Test case to produce illustrated output

Here's what happens when I run the script.


kevin@treat Test $ bash testcase.sh
testcase.sh: line 5: 22245 File size limit exceededunexpand -t2 -t5  > testoutput <<EOF
         a
EOF

-rw-r--r-- 1 kevin kevin 1024 2009-01-22 10:14 testoutput
0000000 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09
         \t  \t  \t  \t  \t  \t  \t  \t  \t  \t  \t  \t  \t  \t  \t  \t
*
0002000
kevin@treat Test $
Comment 7 Kevin O'Gorman 2009-01-30 04:43:57 UTC
This may not be an unexpand(1) bug exactly.  It turns out that I was running
with LANG and LC_ALL both set to "en_US.utf8".  If I set them both to "C", the
bugs go away.  Unfortunately, that does not work well for me, and I use other
locales as well (but haven't tested unexpand in them).
Comment 8 SpanKY gentoo-dev 2009-02-22 00:15:42 UTC
fixed in newer versions as we've dropped the utf8 patchset