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

Re: perl upgrade fails

(switched a separate cloned bug, #479711. I think we can leave
 debian-devel at this point, interested people can subscribe to the bug.)

On Wed, May 07, 2008 at 09:27:28AM +0200, Raphael Hertzog wrote:

> We already had this issue with the perl 5.6 -> 5.8 move, see
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=158835
> So I'll add the pre-dependency back but we might want to investigate
> the work-around mentionned in the bug above to avoid other
> similar bugs with debconf usage... (thus CCing debconf maintainers).

Great, now I understand the problem better. I suppose it could be
considered a feature since there's a way to turn it off from the Perl

The dlopen(3) call is done with RTLD_LAZY by default, postponing all
symbol resolution for later. Afterwards, there's no way for the linker
to signal a symbol resolving failure short of killing off the process.

Using PERL_DL_NONLAZY=1, as it sets the RTLD_NOW flag instead and dlopen()
fails with an error that can be caught with the eval statement.

The claim in #158835 that this changed between 5.6 and 5.8 seems to
be wrong.

The only room for improvement that I can see here is to always set
PERL_DL_NONLAZY=1 when executing an eval statement. This sounds a bit
intrusive, but arguably anybody using an eval wants to catch any
exceptions immediately.

I'll bring this up on p5p; if the idea is rejected outright, I think at
least Dpkg::Gettext and Debconf::Gettext should use the PERL_DL_NONLAZY=1
trick so we don't hit this in future transitions.  This one can only be
solved with pre-dependencies anyway, as we can't do anything about the
Etch perl.

Some more documentation is in order any way, of course. I'll try to
come up with a patch.

# perl -e 'local $ENV{PERL_DL_NONLAZY}=0; eval "require Locale::gettext"; print "got: $@" if $@; exit 0'; echo $?
perl: symbol lookup error: /usr/lib/perl5/auto/Locale/gettext/gettext.so: undefined symbol: Perl_Istack_sp_ptr

# perl -e 'local $ENV{PERL_DL_NONLAZY}=1; eval "require Locale::gettext"; print "got: $@" if $@; exit 0'; echo $?
got: Can't load '/usr/lib/perl5/auto/Locale/gettext/gettext.so' for module Locale::gettext: /usr/lib/perl5/auto/Locale/gettext/gettext.so: undefined symbol: Perl_Imarkstack_ptr_ptr at /usr/lib/perl/5.8/DynaLoader.pm line 225.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.

Niko Tyni   ntyni@debian.org

Reply to: