Bug#522099: [perl #64326] panic: MUTEX_LOCK (22) [op.c:453] in Perl 5.10.0 on Debian

Dave Mitchell davem at iabyn.com
Sun Apr 19 23:58:33 UTC 2009


On Thu, Apr 02, 2009 at 09:07:10PM +0300, Niko Tyni wrote:
> On Tue, Mar 31, 2009 at 11:38:15AM -0700, David F. Skoll wrote:
> > In Perl 5.10.0, it does not seem possible to create an interpreter,
> > destroy it, and create another in the same process by following the
> > perlembed instructions.  The attached test case works fine under
> > Debian Etch (perl 5.8.8); running "./configure && make && ./embperl"
> > prints "I'm very happy!" twice.  On lenny running Perl 5.10.0, the first
> > one works, but then it prints:
> > 
> > panic: MUTEX_LOCK (22) [op.c:453] at script.pl line 1.
> > BEGIN failed--compilation aborted at script.pl line 1.
> > panic: MUTEX_LOCK (22) [op.c:453] at script.pl line 1.
> 
> This is also <http://bugs.debian.org/522099>, and as discussed there,
> it seems to be a misunderstanding about the needed arguments for
> PERL_SYS_INIT3(). The test case calls the macro (twice) with the
> perl_parse() arguments, but apparently the "real" main() argc, argv and
> env are the right ones.
> 
> If this is correct, maybe the attached documentation patch would help
> to avoid similar confusion in the future?

Thanks, applied as 174c68d32e9e7f904e35e6bf157e59aa67b468ab

> diff --git a/pod/perlembed.pod b/pod/perlembed.pod
> index 39364eb..3a16b98 100644
> --- a/pod/perlembed.pod
> +++ b/pod/perlembed.pod
> @@ -202,6 +202,10 @@ of the C runtime environment necessary to run Perl interpreters; since
>  PERL_SYS_INIT3() may change C<env>, it may be more appropriate to provide
>  C<env> as an argument to perl_parse().
>  
> +Also notice that no matter what arguments you pass to perl_parse(),
> +PERL_SYS_INIT3() must be invoked on the C main() argc, argv and env and
> +only once.
> +
>  Now compile this program (I'll call it I<interp.c>) into an executable:
>  
>      % cc -o interp interp.c `perl -MExtUtils::Embed -e ccopts -e ldopts`


-- 
"Foul and greedy Dwarf - you have eaten the last candle."
    -- "Hordes of the Things", BBC Radio.






More information about the Perl-maintainers mailing list