zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh workers <zsh-workers@zsh.org>
Subject: Re: PATCH: Fix leak during Y shortcircuit glob qualifier
Date: Thu, 24 Sep 2015 05:38:03 +0200	[thread overview]
Message-ID: <CAHYJk3QnWQPVzBcgpmES=ka11tD5ra53fsA-C9cFpUHN0zEpdA@mail.gmail.com> (raw)
In-Reply-To: <150923201201.ZM32285@torch.brasslantern.com>

On Thu, Sep 24, 2015 at 5:12 AM, Bart Schaefer
<schaefer@brasslantern.com> wrote:
> On Sep 23, 11:54pm, Mikael Magnusson wrote:
> } Subject: PATCH: Fix leak during Y shortcircuit glob qualifier
> }
> } The closedir(lock) is the leak I actually did see in usage, I have no
> } idea if the other part is needed/harmful though. I'll commit just the
> } closedir if nobody has any opinions.
>
> Since scanner() is being called recursively, it's not clear that the
> recursive call won't have already done an equivalent restoredir()
> in the first two "return" cases -- but I do suspect it's needed in
> the case where the closedir(lock) plugs a leak.
>
> Is the current directory munged in the situation where you found a leak?

Oops, I see that I forgot to include the actual test case in the
message. I think I had it typed out in gmail and then decided to look
into the code instead and forgot to put it in the git send-email.

% : ./*(-.Y1N); ls -l /proc/$$/fd

was my test case, so not much would happen to $PWD in that particular
case. I tried */*/*(-.Y5N) instead now, and nothing untoward seemed to
happen then either (without and with my patch, so no weird pwd
changing or errors about double frees, respectively).

-- 
Mikael Magnusson


  reply	other threads:[~2015-09-24  3:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23 21:54 Mikael Magnusson
2015-09-24  3:12 ` Bart Schaefer
2015-09-24  3:38   ` Mikael Magnusson [this message]
2015-09-24  5:18     ` Bart Schaefer
2015-09-24 18:55       ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHYJk3QnWQPVzBcgpmES=ka11tD5ra53fsA-C9cFpUHN0zEpdA@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).