bug-bash
[Top][All Lists]
Advanced

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

Re: bash closes fd twice.


From: Eric Blake
Subject: Re: bash closes fd twice.
Date: Fri, 11 Dec 2015 07:06:48 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 12/11/2015 06:42 AM, Chet Ramey wrote:
> On 12/11/15 12:40 AM, Yoriyuki Yamagata wrote:
>> Dear list, 
>>
>> I found that bash tries to close the same fd twice, consecutively.  I’m 
>> using Mac OS X Yosemite, and bash is the newest available (bash-master from 
>> http://tiswww.case.edu/php/chet/bash/bashtop.html yesterday).
> 
> That's harmless.

Only if bash is single-threaded (it is) and if no signal handler can
create fds (that, I'm less sure of).  It is absolutely harmful in a
multi-threaded program, or in a program where a signal handler might
open an fd and the signal can occur in the window between the two close()s.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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