bin/177674: /bin/sh 'while read X' loop problem

看板FB_bugs作者時間12年前 (2013/04/27 13:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
>Number: 177674 >Category: bin >Synopsis: /bin/sh 'while read X' loop problem >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Apr 06 20:40:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Joe Public >Release: FreeBSD 9.1-RELEASE i386 >Organization: none >Environment: System: FreeBSD 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243826: Tue Dec 4 06:55:39 UTC 2012 root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 >Description: There is some kind of problem with 'read' in a sh(1) loop, but it is only demonstrated with some programs (such as mplayer). >How-To-Repeat: First, create a file with some valid MP3 pathanmes inside, then: OK: while read X; do echo $X; done < FILEWITHMP3PATHNAMES OK: while read X; do ls -l $X; done < FILEWITHMP3PATHNAMES FAIL: while read X; do mplayer $X; done < FILEWITHMP3PATHNAMES This last command line will fail in a mess of corruption, and it is difficult to explain what is actually occurring. With only 1 pathname in the file, it works OK, but with 2 or more, it increasingly results in more and more corruption. >Fix: I don't know what the problem is. I tried inserting sleep(1) commands to make the loop slow and other things, but nothing made any difference. >Release-Note: >Audit-Trail: >Unformatted: _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"
文章代碼(AID): #1HUrkW3p (FB_bugs)
文章代碼(AID): #1HUrkW3p (FB_bugs)