pkgsrc-Users archive

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

Re: perl v5.42 segfault



Thomas Klausner <wiz%gatalith.at@localhost> wrote:
> On Wed, Oct 15, 2025 at 04:54:18PM +0100, James Cook wrote:
> > James Cook <falsifian%falsifian.org@localhost> wrote:
> > > mlelstv%serpens.de@localhost (Michael van Elst) wrote:
> > > > falsifian%falsifian.org@localhost (James Cook) writes:
> > > > 
> > > > >	perl -E 'for my($x,$y)($a->foo){}'
> > > > 
> > > > 
> > > > This looks like a variant of:
> > > > 
> > > >    https://github.com/perl/perl5/issues/23405
> > > > 
> > > > 
> > > > The issue mentions a fix, but unclear if that can be backported.
> > > 
> > > Oops, I missed your email. Thanks for finding it.
> > > 
> > > I am surprised this made it to a released version of perl. It seems quite
> > > easy to trigger: you just need to use the "indexed" function (lexically
> > > imported) in the most natural way imaginable.
> > > 
> > > Maybe I'll ask #perl on libera.chat for advice about backporting the fix.
> > 
> > Update: cherry-picking commit 96673a4bb36 on top of perl's v5.42.0 tag
> > fixes the problem. I can confirm that perl's "make test" passes. People
> > in #perl on libera.chat seem to think this is a reasonable approach.
> > 
> > I have not tried applying the fix in pkgsrc, but hopefully it should be
> > as simple as adding a patch from commit 96673a4bb36.
> 
> I've tried applying just the single patch, but the perl built this way still says:
> 
> # ./work/.destdir/usr/pkg/bin/perl -E 'for my($x,$y)($a->foo){}'
> Memory fault (core dumped)
> 
>  Thomas

I just submitted a pkgsrc patch at https://gnats.netbsd.org/59831 .
(I forgot to bump PKGREVISION in that patch, but I don't know how to
comment on the gnats report now that I've submitted it.)

It seems to fix the problem for me. Sorry, Thomas, I don't know why the
patch I suggested didn't work for you, but maybe you could try the
pkgsrc patch, which should amount to the same thing.

The perl I built with that patch is kind of broken, but I think that's
unrelated, because even before patching it, my attempts to build perl
from pkgsrc haven't really worked: see my post from earlier this year
at https://marc.info/?l=pkgsrc-users&m=174848776417600&w=2
(Summary: I am getting 'Shared object "libperl.so" not found' errors.)

However, the one-liner discussed here (perl -E 'for my($x,$y)($a->foo){}')
does not trigger the libperl.so not found error, so at least I have
been able to verify the patch I submitted to GNATS fixes perl in that
case.

-- 
James


Home | Main Index | Thread Index | Old Index