develooper Front page | perl.perl5.porters | Postings from April 2013

Re: [perl #117751] POSIX::AUTOLOAD can endlessly recurse on itself

Thread Previous
From:
Brian Fraser
Date:
April 26, 2013 09:29
Subject:
Re: [perl #117751] POSIX::AUTOLOAD can endlessly recurse on itself
Message ID:
CA+nL+nYScBEc37TpWacAvkPZDd9Y+GPxu2UVXuhJ-0AixEbjsA@mail.gmail.com
+1, this fixes it for me:

Without the patch:
$ LD_LIBRARY_PATH=/mnt/asec/perl:/mnt/asec/perl/lib:/mnt/asec/perl/lib/auto
./perl -I../lib -MPOSIX -e1
Can't load '../lib/auto/POSIX/POSIX.so' for module POSIX: Cannot load
library: link_image[1995]: failed to link POSIX.so
 at ../lib/POSIX.pm line 36.
Compilation failed in require.
BEGIN failed--compilation aborted.
$ LD_LIBRARY_PATH=/mnt/asec/perl:/mnt/asec/perl/lib:/mnt/asec/perl/lib/auto
./perl -I../lib run/exit.t
1..17
ok 1 - Normal exit
ok 2 - Normal exit $?
ok 3 - Normal exit ${^CHILD_ERROR_NATIVE}
Deep recursion on subroutine "POSIX::AUTOLOAD" at ../lib/POSIX.pm line 216.
^C

With the patch:
$ LD_LIBRARY_PATH=/mnt/asec/perl:/mnt/asec/perl/lib:/mnt/asec/perl/lib/auto
./perl -I../lib -MPOSIX -e1
Can't load '../lib/auto/POSIX/POSIX.so' for module POSIX: Cannot load
library: link_image[1995]: failed to link POSIX.so
 at ../lib/POSIX.pm line 36.
Compilation failed in require.
BEGIN failed--compilation aborted.
$ LD_LIBRARY_PATH=/mnt/asec/perl:/mnt/asec/perl/lib:/mnt/asec/perl/lib/auto
./perl -I../lib run/exit.t
1..17
ok 1 - Normal exit
ok 2 - Normal exit $?
ok 3 - Normal exit ${^CHILD_ERROR_NATIVE}
ok 4 - Non-zero exit
ok 5 - Non-zero exit $?
ok 6 - Non-zero exit ${^CHILD_ERROR_NATIVE}
ok 7 # skip No POSIX
ok 8 # skip No POSIX
ok 9 # skip No POSIX
not ok 10 - Term by signal
# Failed test 10 - Term by signal at run/exit.t line 81
#      got "0"
# expected "15"
ok 11 - No core dump
not ok 12 - Term by signal $?
# Failed test 12 - Term by signal $? at run/exit.t line 83
#      got "0"
# expected "15"
not ok 13 - Term by signal ${^CHILD_ERROR_NATIVE}
# Failed test 13 - Term by signal ${^CHILD_ERROR_NATIVE} at run/exit.t line
84
# it should not be "0"
# but it is.
ok 14 # skip No POSIX
ok 15 # skip No POSIX
ok 16 # skip No POSIX
ok 17 - Changing $? in END block



On Fri, Apr 26, 2013 at 3:08 AM, Aristotle Pagaltzis <pagaltzis@gmx.de>wrote:

> * Brian Fraser <perlbug-followup@perl.org> [2013-04-25 00:45]:
> > Perhaps POSIX::AUTOLOAD should detect this, somehow, and bail out?
>
> Patch attached.
>

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About