git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Sergey Vlasov <vsu@altlinux.ru>
Cc: git@vger.kernel.org, Eric Wong <normalperson@yhbt.net>,
	A Large Angry SCM <gitzilla@gmail.com>,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] git-svn: write memoized data explicitly to avoid Storable  bug
Date: Tue, 20 Jul 2010 17:32:31 +0000	[thread overview]
Message-ID: <AANLkTime7QQZGLXmXg_X3W7CsbyLe5NbPKcqs9dp0oaa@mail.gmail.com> (raw)
In-Reply-To: <1279455469-6384-1-git-send-email-vsu@altlinux.ru>

On Sun, Jul 18, 2010 at 12:17, Sergey Vlasov <vsu@altlinux.ru> wrote:
> Apparently using the Storable module during global destruction is
> unsafe - there is a bug which can cause segmentation faults:
>
>  http://rt.cpan.org/Public/Bug/Display.html?id=36087
>  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=482355

I did some investigation into the upstream issue:
https://rt.cpan.org/Ticket/Display.html?id=36087#txn-806832

> The persistent memoization support introduced in commit 8bff7c538
> relied on global destruction to write cached data, which was leading
> to segfaults in some Perl configurations.  Calling Memoize::unmemoize
> in the END block forces the cache writeout to be performed earlier,
> thus avoiding the bug.

Maybe I'm missing something obvious, but this seems like the wrong
solution. The core issue is that we don't want to clean up during
global destruction, but then we should just do:

       sub DESTROY {
               return if not $memoized;
               $memoized = 0;

               Memoize::unmemoize 'lookup_svn_merge';
               Memoize::unmemoize 'check_cherry_pick';
               Memoize::unmemoize 'has_no_changes';
       }

That should work since memoize_svn_mergeinfo_functions(); is being
called in find_extra_svn_parents, which is a Git::SVN object
method. Can you try this and confirm/deny? I can't because I can't get
the original to segfault on my box when run within git-svn.

  parent reply	other threads:[~2010-07-20 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-18 12:17 [PATCH] git-svn: write memoized data explicitly to avoid Storable bug Sergey Vlasov
2010-07-19  6:39 ` Eric Wong
2010-07-19 16:37   ` Junio C Hamano
2010-07-20 17:32 ` Ævar Arnfjörð Bjarmason [this message]
2010-07-20 19:02   ` Eric Wong

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=AANLkTime7QQZGLXmXg_X3W7CsbyLe5NbPKcqs9dp0oaa@mail.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=gitzilla@gmail.com \
    --cc=normalperson@yhbt.net \
    --cc=vsu@altlinux.ru \
    /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.
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).