Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Sam Liddicott Newsgroups: gnu.bash.bug Subject: Re: leaks fd for internal functions but not external command Date: Fri, 20 Mar 2020 11:28:38 +0000 Lines: 32 Approved: bug-bash@gnu.org Message-ID: References: <5c34ecd5-c8b2-7000-46bc-1bbe3f71f163@case.edu> <78679ee9-fdaf-5180-d32f-81d92b936538@case.edu> <40109c28-c4a8-2ea0-cc77-e46a584dc011@case.edu> <38bf161d-8170-69ba-77d0-638aa0852ad9@case.edu> <7a33daac-16ba-b98a-54ca-e005fd8b041e@case.edu> <8761ae1a-f51c-e468-0a32-3447bfa7f287@case.edu> <91868af9-f8a6-bbe2-2983-187683ab5a87@case.edu> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: usenet.stanford.edu 1584703773 27833 209.51.188.17 (20 Mar 2020 11:29:33 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org, bash@packages.debian.org To: Chester Ramey Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=liddicott-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8cekKyVZjY0ZTk1+qyzQxTZG6urbRt3Lfii7wKeGqBM=; b=p9Syb5/4VWr77l1Gkwbiv63mOEjpN/sk8OlmKfh1lnPYIhKycbzR5MhnLY/O4yKkxx 6kuKZy6+f81X4RRGsdTJtevX8VubbQT2nrOX1MdiWu3IYkm5/8KoCu/N+vSmeWTUFoa6 LqrKBOot+IB+4zAU8w7J5rOHmgNTtPRDMDiLP65tl2eoERtbIVDgyWIRsndsWx9OnHFk XOp1evMZIykUMHS5YTUzMW1TGtgVsoKkr1BLNh3bHRqcvfWgkR6oRp8wUPocJ2/0lPsr tDGEetWO/E7nl8hRytQ/q1qM7JRIALOYYB6xzzwE+kCzIJsnm2WYZbl4ADZc+ZxWez64 Oe0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8cekKyVZjY0ZTk1+qyzQxTZG6urbRt3Lfii7wKeGqBM=; b=LsQn8T0rQyY5Q7H8l7piypA96dA9lZC7orhN/s9xYA0+30BLJ8vmXY10F5jIJHc0eE EhzE6BuOnYzE/+ELjAug2Dful4nXQq3ccyk44+qonzFPn6cuHKZq2zm9jxqE8M1h1Akq SUikjpRo/YoCoK+KzjSG9aeJWNuAVofZ6T5DInutBdtllYZjCpIFnz29XdHBHwUv1DjG 6ghCsEyYYXIoGWv9dVlKSd5jXxeCl2b4zJuR7eN3iVqj1aON+IxexwMSoEZPp+108gaP gYpvNod9vr5jst7zKJtxN200+wbtdYmDm0nfSsrQvKnctClSwE79RKZTe0ubE9DztacR HXQw== X-Gm-Message-State: ANhLgQ0mneahK6T7MhJ+6Sva3D2DzfT3iCeBLDrToX50GKa2T7PK0Rfi hg/rNJlxdToJeC8T1QE0K1AxK8oI1q8YZCwgtrExsg== X-Google-Smtp-Source: ADFU+vsmj63vbHJn8w/6JJSdq6+XOmvvptqnr+YjpZ/NvCiIEZhvR6KCwPtkcXd4mByXu48E+mfvR/mxWS15lQucJZo= X-Received: by 2002:a2e:97cf:: with SMTP id m15mr4830978ljj.30.1584703765848; Fri, 20 Mar 2020 04:29:25 -0700 (PDT) In-Reply-To: <91868af9-f8a6-bbe2-2983-187683ab5a87@case.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::22f X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <5c34ecd5-c8b2-7000-46bc-1bbe3f71f163@case.edu> <78679ee9-fdaf-5180-d32f-81d92b936538@case.edu> <40109c28-c4a8-2ea0-cc77-e46a584dc011@case.edu> <38bf161d-8170-69ba-77d0-638aa0852ad9@case.edu> <7a33daac-16ba-b98a-54ca-e005fd8b041e@case.edu> <8761ae1a-f51c-e468-0a32-3447bfa7f287@case.edu> <91868af9-f8a6-bbe2-2983-187683ab5a87@case.edu> Xref: csiph.com gnu.bash.bug:16039 This just made me sad: tedious_function() { : # lots of stuff } {BASH_XTRACEFD}>/dev/null it would be so cool to be able to disable debug output BASH_XTRACEFD like that whether or not BASH_XTRACEFD was set. I guess the variable would have to be local to the function invocation too. Please add it to the wishlist for bash 5 ;-) On Thu, 25 Jul 2019 at 15:11, Chet Ramey wrote: > On 7/25/19 9:03 AM, Sam Liddicott wrote: > > > Perhaps if the named fd is also closed on the same statement that opened > > it, it could be kept closed rather than saved and re-opened. > > Being closed at the same statement is a strong indicator that it was only > > used to aid fd transplants. Why keep open what the author closed? > > That's an interesting suggestion. I considered it at some point, and > there's even a comment in the code about it. I'll look at it again. > > Chet > > -- > ``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/ >