bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My script makes a defunct subshell and sticks on read


From: Chet Ramey
Subject: Re: My script makes a defunct subshell and sticks on read
Date: Wed, 31 Jan 2018 10:09:00 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 1/31/18 6:09 AM, Øyvind Hvidsten wrote:

> 
> It will also lock up when run like this, without opening and closing the
> file descriptor repeatedly. A missed signal, perhaps?
> 
> exec {fd}<> <(:); for ((i=0; ; i++)); do ((i%100)) || echo $i; read -t
> 0.001 -u $fd; done

It might be a signal problem. I'll take a look.

> Note I also turned the pipe around so it's opened for read only instead of
> write :)

It still seems problematic that Linux allows the /dev/fd file to be
opened read-write when the underlying file descriptor is read-only. A
different (BSD) implementation rejects the open altogether.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]