Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.85k stars 527 forks source link

perl 5.26: use lib pragma issue in IBM AIX #16709

Closed p5pRT closed 4 years ago

p5pRT commented 5 years ago

Migrated from rt.perl.org#133558 (status was 'resolved')

Searchable as RT133558$

p5pRT commented 5 years ago

From gskallur@gmail.com

perl 5.26 use lib pragma is not working in IBM AIX

use lib "\";

Above code snippet fails to append the DIRPATH to perl INC. Because of which perl is not able to load modules in aix -- Thanks & Regards Gururaj Kallur Mobile​: 91-9845227154

p5pRT commented 5 years ago

From @jkeenan

On Thu\, 04 Oct 2018 11​:28​:40 GMT\, gskallur@​gmail.com wrote​:

perl 5.26 use lib pragma is not working in IBM AIX

use lib "\";

Above code snippet fails to append the DIRPATH to perl INC. Because of which perl is not able to load modules in aix

I have never used AIX\, but unless something is *very* different there I do not think you are correct.

The syntax 'use lib "\";' only makes sense to me if you have a directory whose name is\, literally\, '\' beneath the current working directory. But if you have such a directory\, and if it contains a Perl module\, and if your Perl program is written correctly\, then the module found in that directory can be use-d and its subroutines invoked.

I suspect\, however\, that what the string '\' means to you is a system-wide environmental variable holding a value for a special directory. A properly written Perl program can handle that as well. Consider​:

##### $> cd /tmp $> mkdir '\' # quotes needed because '\<' is a shell metacharacter $> mkdir system_dirpath $> export DIRPATH=system_dirpath $> echo $DIRPATH system_dirpath #####

Now\, place attachment Hello.pm in directory '\'. Place attachment Goodbye.pm in directory system_dirpath. Place program in 133558-use-lib.pl the current directory and run.

##### $ perl 133558-use-lib.pl @​INC​:   /home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0   /home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/x86_64-linux   /home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0   /home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/x86_64-linux   /tmp/system_dirpath   \

Hello world

Goodbye world #####

Thank you very much. -- James E Keenan (jkeenan@​cpan.org)

p5pRT commented 5 years ago

From @jkeenan

133558-use-lib.pl

p5pRT commented 5 years ago

From @jkeenan

Goodbye.pm

p5pRT commented 5 years ago

From @jkeenan

Hello.pm

p5pRT commented 5 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 5 years ago

From @tux

On Thu\, 04 Oct 2018 20​:08​:33 -0700\, "James E Keenan via RT" \perlbug\-followup@&#8203;perl\.org wrote​:

On Thu\, 04 Oct 2018 11​:28​:40 GMT\, gskallur@​gmail.com wrote​:

perl 5.26 use lib pragma is not working in IBM AIX

use lib "\";

Above code snippet fails to append the DIRPATH to perl INC. Because of which perl is not able to load modules in aix

I have never used AIX\, but unless something is *very* different there I do not think you are correct.

You know I can give you access to an AIX box\, right?

* * * Welcome to AIX 5.3.0.0/TL12-05/RD1140/64 * * * * IBM 9115 System p5 505 PowerPC * * 2 CPU's\, 4 Gb RAM * * *

-- H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/ using perl5.00307 .. 5.29 porting perl5 on HP-UX\, AIX\, and openSUSE http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/ http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

p5pRT commented 5 years ago

From gskallur@gmail.com

Here \ means absolute path of the module

I tried your small exercise as below

placed 133558-use-lib.pl in /scratch/gkallur and replaced the line use 5.26.0 wth use 5.26.1 as we are using perl 5.26.1 in 133558-use-lib.pl -bash-4.2$ cat 133558-use-lib.pl #!/usr/bin/env perl use 5.26.1; use warnings;

use lib ('\'\, $ENV{DIRPATH}); say "\@​INC​:"; say " $_" for sort @​INC;

say "";

use Hello; Hello​::hello();

say "";

use Goodbye; Goodbye​::goodbye();

-bash-4.2$ mkdir /scratch/gkallur/system_dirpath -bash-4.2$ export DIRPATH=/scratch/gkallur/system_dirpath -bash-4.2$ echo $DIRPATH -bash-4.2$ /scratch/gkallur/system_dirpath

placed Hello.pm and Goodbye.pm in /scratch/gkallur/system_dirpath

which perl /scratch/gkallur/perl/bin/perl

-bash-4.2$ perl -v

This is perl 5\, version 26\, subversion 1 (v5.26.1) built for aix-thread-multi-64all

Copyright 1987-2017\, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the GNU General Public License\, which may be found in the Perl 5 source kit.

Complete documentation for Perl\, including FAQ lists\, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet\, point your browser at http​://www.perl.org/\, the Perl Home Page.

-bash-4.2$ perl 133558-use-lib.pl Can't locate Hello.pm in @​INC (you may need to install the Hello module) (@​INC contains​: /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1) at 133558-use-lib.pl line 11. BEGIN failed--compilation aborted at 133558-use-lib.pl line 11.

Same thing is working in Linux. And also working with perl 5.22.0 on IBM AIX

Here is the output of 133558-use-lib.pl with perl 5.22.0 on the same AIX machine( replaced the line use 5.26.1 wth use 5.22.0 in 133558-use-lib.pl )

-bash-4.2$ pwd /scratch/gkallur -bash-4.2$ export PATH=/scratch/gkallur/perl522/bin​:$PATH -bash-4.2$ which perl /scratch/gkallur/perl522/bin/perl -bash-4.2$ perl -v

This is perl 5\, version 22\, subversion 0 (v5.22.0) built for aix-thread-multi-64all

Copyright 1987-2015\, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the GNU General Public License\, which may be found in the Perl 5 source kit.

Complete documentation for Perl\, including FAQ lists\, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet\, point your browser at http​://www.perl.org/\, the Perl Home Page.

-bash-4.2$ perl 133558-use-lib.pl @​INC​:   .   ../lib/5.22.0   ../lib/5.22.0/aix-thread-multi-64all   ../lib/site_perl/5.22.0   ../lib/site_perl/5.22.0/aix-thread-multi-64all   /scratch/gkallur/perl522/lib   /scratch/gkallur/perl522/lib/5.22.0   /scratch/gkallur/perl522/lib/5.22.0/aix-thread-multi-64all   /scratch/gkallur/system_dirpath   \

Hello world

Goodbye world

On Fri\, Oct 5\, 2018 at 8​:38 AM James E Keenan via RT \< perlbug-followup@​perl.org> wrote​:

On Thu\, 04 Oct 2018 11​:28​:40 GMT\, gskallur@​gmail.com wrote​:

perl 5.26 use lib pragma is not working in IBM AIX

use lib "\";

Above code snippet fails to append the DIRPATH to perl INC. Because of which perl is not able to load modules in aix

I have never used AIX\, but unless something is *very* different there I do not think you are correct.

The syntax 'use lib "\";' only makes sense to me if you have a directory whose name is\, literally\, '\' beneath the current working directory. But if you have such a directory\, and if it contains a Perl module\, and if your Perl program is written correctly\, then the module found in that directory can be use-d and its subroutines invoked.

I suspect\, however\, that what the string '\' means to you is a system-wide environmental variable holding a value for a special directory. A properly written Perl program can handle that as well. Consider​:

##### $> cd /tmp $> mkdir '\' # quotes needed because '\<' is a shell metacharacter $> mkdir system_dirpath $> export DIRPATH=system_dirpath $> echo $DIRPATH system_dirpath #####

Now\, place attachment Hello.pm in directory '\'. Place attachment Goodbye.pm in directory system_dirpath. Place program in 133558-use-lib.pl the current directory and run.

##### $ perl 133558-use-lib.pl @​INC​: /home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0 /home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/x86_64-linux /home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0

/home/jkeenan/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/x86_64-linux /tmp/system_dirpath \

Hello world

Goodbye world #####

Thank you very much. -- James E Keenan (jkeenan@​cpan.org)

p5pRT commented 5 years ago

From gskallur@gmail.com

It is completely blocking us on AIX. Severity is very high

On Thu\, Oct 4\, 2018 at 4​:58 PM \perlbug\-followup@&#8203;perl\.org wrote​:

Greetings\,

This message has been automatically generated in response to the creation of a perl bug report regarding​: "perl 5.26​: use lib pragma issue in IBM AIX".

There is no need to reply to this message right now. Your ticket has been assigned an ID of [perl #133558].

You can view your ticket at https://rt-archive.perl.org/perl5/Ticket/Display.html?id=133558

Within the next 24 to 72 hours\, your message will be posted to the Perl 5 Porters mailing list. Please be patient!

Please include the string​:

[perl #133558]

in the subject line of all future correspondence about this issue. To do so\, you may reply to this message (please delete unnecessary quotes and text.)

Thank you\, perlbug-followup@​perl.org

------------------------------------------------------------------------- Dkim-Signature​: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version​:from​:date​:message-id​:subject​:to; bh=yLIh/Rc0ocKL/rCDDDkGaZKwfHpPXKKVyYzkDo7E5xg=; b=Hrmia17NmxwQ8m3MN6NE3Pv32ewwe89SqgoJP//ldxx/84uHxXGeJmSSgf+tTQBMoW S2FvtG1+BK+fvJNZa6sAgkhjt5+115hUPICdBjc6LeTf07A5KkdXIMh18MNJuHcDrhxj QsZ2UUSZFhY7db/R9DUrq5sNuMO3SPIvm7lT/QfnDCn+QBAq30F4sLhJwDpKoNeOGTdb +9v8Nfyky2TKCwpn5eNQmgF9JKc4HAOtYORGY0mW4PiJoEwbKfLSOqN45Hnq+KnAC7CH 97G1CyjYZFCwBTIkZZq2L16gn6sKDSVaatHkjvxMWaqA7HGhco2HPmuE2uv2JVkEU87y yjJQ== X-PMX-Version​: 5.6.1.2065439\, Antispam-Engine​: 2.7.2.376379\, Antispam-Data​: 2018.10.4.112116 Return-Path​: \gskallur@&#8203;gmail\.com To​: perlbug@​perl.org X-Spam-Status​: No\, score=-2.0 required=6.0 tests=BAYES_00\,DKIM_SIGNED\, DKIM_VALID\,DKIM_VALID_AU\,FREEMAIL_FROM\,HTML_MESSAGE\,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version​: SpamAssassin 3.3.1 (2010-03-16) on mx3.develooper.com MIME-Version​: 1.0 From gskallur@​gmail.com Thu Oct 4 04​:28​:39 2018 X-Original-To​: rt-perl5@​rtperl.dev From​: Gururaj Kallur \gskallur@&#8203;gmail\.com Message-ID​: \ X-RT-Mail-Extension​: perl5 Delivered-To​: rt-perl5@​rtperl.dev Subject​: perl 5.26​: use lib pragma issue in IBM AIX X-Google-SMTP-Source​: ACcGV63ggL2KipKFUlLPXF2Y5Ziw2ziwKajwI1Pyj9NGDUU2v8AMTJ/rWKXfMcPP923+KziVlWkRTloL6Vd12m35pRM= Date​: Thu\, 4 Oct 2018 16​:58​:08 +0530 Received​: from xx1.develooper.com (xx1.dev [10.0.100.115]) by rtperl.develooper.com (Postfix) with ESMTP id 6656C140 for \rt\-perl5@&#8203;rtperl\.dev; Thu\, 4 Oct 2018 04​:28​:39 -0700 (PDT) Received​: from localhost (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with ESMTP id 39C5D11EF2C for \rt\-perl5@&#8203;rtperl\.dev; Thu\, 4 Oct 2018 04​:28​:39 -0700 (PDT) Received​: from xx1.develooper.com (xx1.develooper.com [127.0.0.1]) by localhost (Postfix) with SMTP id 61EF411F0CE for \rt\-perl5@&#8203;rtperl\.dev; Thu\, 4 Oct 2018 04​:28​:37 -0700 (PDT) Received​: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by xx1.develooper.com (Postfix) with ESMTPS id 8DDFC11EF2C for \perlbug@&#8203;perl\.org; Thu\, 4 Oct 2018 04​:28​:22 -0700 (PDT) Received​: by mail-ed1-f46.google.com with SMTP id c1-v6so8202734ede.5 for \perlbug@&#8203;perl\.org; Thu\, 04 Oct 2018 04​:28​:22 -0700 (PDT) X-GM-Message-State​: ABuFfoif1zhhgZhHi2yo7estvJoMUItTgiCBipOeYAo6HWCtpjEr7rZ2 d4VUKmHwY44dACnTzEx0ByLfw6Wqn7xVKsl8ec6N/MkGrDI= X-Google-Dkim-Signature​: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state​:mime-version​:from​:date​:message-id​:subject​:to; bh=yLIh/Rc0ocKL/rCDDDkGaZKwfHpPXKKVyYzkDo7E5xg=; b=NBEZr7CkkX8s04t5HjKzoTIclES9dxdJbncPH43rCnrIp0FuOZRPAarf3vbiPmGoKA JfkhUrOwIqyCxRU2A5qV9ErJdl+nAR3N+V/r0FF4lEZMXBE9/TToXWwdFiz66lmK5Kj0 rnOLufPXjtD4WGJwHusVRTR4wPqy5RVzp6LE7LHe/Yb30I8GfetIbhGfA/lUv2tdq6mh Rg1yFaz5bx6q7nXOsUgm7nrkZpPCuNYvm+L0ava0QzBRnIvQhizMm/ijzZlTFuPY4duT mVAqjkRlv97hk7LMGhfUHQixc3ndvdQDH7XmiYY6S/OOZ191GVGpgPih53rjwkwcNBY8 sr/A== Content-Type​: multipart/alternative; boundary="000000000000bbb3900577657338" X-Received​: by 2002​:a50​:ee19​:: with SMTP id g25-v6mr7781707eds.66.1538652500635; Thu\, 04 Oct 2018 04​:28​:20 -0700 (PDT) X-PMX-Spam​: Gauge=IIIIIIII\, Probability=8%\, Report=' HTML_50_70 0.1\, HTML_NO_HTTP 0.1\, BODYTEXTH_SIZE_10000_LESS 0\, BODYTEXTP_SIZE_3000_LESS 0\, BODYTEXTP_SIZE_400_LESS 0\, BODY_SIZE_1000_1099 0\, BODY_SIZE_2000_LESS 0\, BODY_SIZE_5000_LESS 0\, BODY_SIZE_7000_LESS 0\, DKIM_ALIGNS 0\, DKIM_SIGNATURE 0\, NO_CTA_URI_FOUND 0\, NO_URI_FOUND 0\, NO_URI_HTTPS 0\, SMALL_BODY 0\, SPF_PASS 0\, WEBMAIL_SOURCE 0\, __C230066_P5 0\, __CT 0\, __CTYPE_HAS_BOUNDARY 0\, __CTYPE_MULTIPART 0\, __CTYPE_MULTIPART_ALT 0\, __DKIM_ALIGNS_1 0\, __DKIM_ALIGNS_2 0\, __DQ_NEG_HEUR 0\, __DQ_NEG_IP 0\, __FRAUD_WEBMAIL 0\, __FRAUD_WEBMAIL_FROM 0\, __FROM_GMAIL 0\, __FUR_RDNS_GMAIL 0\, __HAS_FROM 0\, __HAS_HTML 0\, __HAS_MSGID 0\, __HELO_GMAIL 0\, __HEX28_LC_BOUNDARY 0\, __HTML_TAG_DIV 0\, __MIME_HTML 0\, __MIME_TEXT_H 0\, __MIME_TEXT_H1 0\, __MIME_TEXT_H2 0\, __MIME_TEXT_P 0\, __MIME_TEXT_P1 0\, __MIME_TEXT_P2 0\, __MIME_VERSION 0\, __PHISH_SPEAR_SUBJ_ALERT 0\, __RDNS_WEBMAIL 0\, __RUS_OBFU_PHONE 0\, __SANE_MSGID 0\, __SUBJ_ALPHA_END 0\, __SUBJ_ALPHA_S TART 0\, __TO_MALFORMED_2 0\, __TO_NO_NAME 0\, __X_GOOGLE_DKIM_SIGNATURE 0\, __YOUTUBE_RCVD 0\, __zen.spamhaus.org_ERROR ' X-RT-Interface​: Email

p5pRT commented 5 years ago

From @iabyn

On Fri\, Oct 05\, 2018 at 11​:22​:41AM +0530\, Gururaj Kallur wrote​:

(stuff about 'use lib')

Can you run this one liner under both the good and bad AIX perls and show us the output​:

  $ perl -le'use lib "/foo/bar"; print for @​INC'

-- Wesley Crusher gets beaten up by his classmates for being a smarmy git\, and consequently has a go at making some friends of his own age for a change.   -- Things That Never Happen in "Star Trek" #18

p5pRT commented 5 years ago

From gskallur@gmail.com

With Good Perl

-bash-4.2$ perl -v

This is perl 5\, version 22\, subversion 0 (v5.22.0) built for aix-thread-multi-64all

Copyright 1987-2015\, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the GNU General Public License\, which may be found in the Perl 5 source kit.

Complete documentation for Perl\, including FAQ lists\, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet\, point your browser at http​://www.perl.org/\, the Perl Home Page.

-bash-4.2$ perl -le'use lib "/foo/bar"; print for @​INC' /foo/bar /scratch/gkallur/perl522/lib/5.22.0/aix-thread-multi-64all /scratch/gkallur/perl522/lib/5.22.0 /scratch/gkallur/perl522/lib ../lib/site_perl/5.22.0/aix-thread-multi-64all ../lib/site_perl/5.22.0 ../lib/5.22.0/aix-thread-multi-64all ../lib/5.22.0 .

With Bad perl

-bash-4.2$ perl -v

This is perl 5\, version 26\, subversion 1 (v5.26.1) built for aix-thread-multi-64all

Copyright 1987-2017\, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the GNU General Public License\, which may be found in the Perl 5 source kit.

Complete documentation for Perl\, including FAQ lists\, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet\, point your browser at http​://www.perl.org/\, the Perl Home Page.

-bash-4.2$ perl -le'use lib "/foo/bar"; print for @​INC' /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1

On Mon\, Oct 8\, 2018 at 1​:10 PM Dave Mitchell \davem@&#8203;iabyn\.com wrote​:

On Fri\, Oct 05\, 2018 at 11​:22​:41AM +0530\, Gururaj Kallur wrote​:

(stuff about 'use lib')

Can you run this one liner under both the good and bad AIX perls and show us the output​:

$ perl \-le'use lib "/foo/bar"; print for @&#8203;INC'

-- Wesley Crusher gets beaten up by his classmates for being a smarmy git\, and consequently has a go at making some friends of his own age for a change. -- Things That Never Happen in "Star Trek" #18

p5pRT commented 5 years ago

From @iabyn

On Mon\, Oct 08\, 2018 at 01​:19​:37PM +0530\, Gururaj Kallur wrote​:

With Bad perl

-bash-4.2$ perl -le'use lib "/foo/bar"; print for @​INC' /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all

Interesting.

On the bad system\, do the following​:

$ perl -e'use lib "/foo/bar"; printf "%20s %s\n"\, $_\, $INC{$_} for sort keys %INC'

You should get something like

  Config.pm /usr/lib64/perl5/Config.pm   lib.pm /usr/lib64/perl5/lib.pm   strict.pm /usr/share/perl5/strict.pm   vars.pm /usr/share/perl5/vars.pm   warnings.pm /usr/share/perl5/warnings.pm warnings/register.pm /usr/share/perl5/warnings/register.pm

Then can you include a copy of the file listed for lib.pm for the bad system; for example that would /usr/lib64/perl5/lib.pm on my system\, and should be about 200 lines long.

-- Wesley Crusher gets beaten up by his classmates for being a smarmy git\, and consequently has a go at making some friends of his own age for a change.   -- Things That Never Happen in "Star Trek" #18

p5pRT commented 5 years ago

From gskallur@gmail.com

Here is the output and attached the lib.pm which is listed below

-bash-4.2$ perl -e'use lib "/foo/bar"; printf "%20s %s\n"\, $_\, $INC{$_} for sort keys %INC'   Config.pm /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all/Config.pm   lib.pm /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all/lib.pm   strict.pm /scratch/gkallur/perl/lib/5.26.1/strict.pm   vars.pm /scratch/gkallur/perl/lib/5.26.1/vars.pm   warnings.pm /scratch/gkallur/perl/lib/5.26.1/warnings.pm warnings/register.pm /scratch/gkallur/perl/lib/5.26.1/warnings/register.pm

-bash-4.2$ cat /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all/ lib.pm | wc -l   211

On Mon\, Oct 8\, 2018 at 1​:58 PM Dave Mitchell \davem@&#8203;iabyn\.com wrote​:

On Mon\, Oct 08\, 2018 at 01​:19​:37PM +0530\, Gururaj Kallur wrote​:

With Bad perl

-bash-4.2$ perl -le'use lib "/foo/bar"; print for @​INC' /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all

Interesting.

On the bad system\, do the following​:

$ perl -e'use lib "/foo/bar"; printf "%20s %s\n"\, $_\, $INC{$_} for sort keys %INC'

You should get something like

       Config\.pm /usr/lib64/perl5/Config\.pm
          lib\.pm /usr/lib64/perl5/lib\.pm
       strict\.pm /usr/share/perl5/strict\.pm
         vars\.pm /usr/share/perl5/vars\.pm
     warnings\.pm /usr/share/perl5/warnings\.pm

warnings/register.pm /usr/share/perl5/warnings/register.pm

Then can you include a copy of the file listed for lib.pm for the bad system; for example that would /usr/lib64/perl5/lib.pm on my system\, and should be about 200 lines long.

-- Wesley Crusher gets beaten up by his classmates for being a smarmy git\, and consequently has a go at making some friends of his own age for a change. -- Things That Never Happen in "Star Trek" #18

-- Thanks & Regards Gururaj Kallur Mobile​: 91-9845227154

p5pRT commented 5 years ago

From gskallur@gmail.com

lib.pm

p5pRT commented 5 years ago

From gskallur@gmail.com

There is not much difference between working and non-working perl lib.pm files

-bash-4.2$ diff /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all/ lib.pm /scratch/gkallur/perl522/lib/5.22.0/aix-thread-multi-64all/lib.pm 16c16 \< our $VERSION = '0.64';


our $VERSION = '0.63';

On Mon\, Oct 8\, 2018 at 2​:22 PM Gururaj Kallur \gskallur@&#8203;gmail\.com wrote​:

Here is the output and attached the lib.pm which is listed below

-bash-4.2$ perl -e'use lib "/foo/bar"; printf "%20s %s\n"\, $_\, $INC{$_} for sort keys %INC' Config.pm /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all/Config.pm lib.pm /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all/lib.pm strict.pm /scratch/gkallur/perl/lib/5.26.1/strict.pm vars.pm /scratch/gkallur/perl/lib/5.26.1/vars.pm warnings.pm /scratch/gkallur/perl/lib/5.26.1/warnings.pm warnings/register.pm /scratch/gkallur/perl/lib/5.26.1/warnings/register.pm

-bash-4.2$ cat /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all/ lib.pm | wc -l 211

On Mon\, Oct 8\, 2018 at 1​:58 PM Dave Mitchell \davem@&#8203;iabyn\.com wrote​:

On Mon\, Oct 08\, 2018 at 01​:19​:37PM +0530\, Gururaj Kallur wrote​:

With Bad perl

-bash-4.2$ perl -le'use lib "/foo/bar"; print for @​INC' /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all

Interesting.

On the bad system\, do the following​:

$ perl -e'use lib "/foo/bar"; printf "%20s %s\n"\, $_\, $INC{$_} for sort keys %INC'

You should get something like

       Config\.pm /usr/lib64/perl5/Config\.pm
          lib\.pm /usr/lib64/perl5/lib\.pm
       strict\.pm /usr/share/perl5/strict\.pm
         vars\.pm /usr/share/perl5/vars\.pm
     warnings\.pm /usr/share/perl5/warnings\.pm

warnings/register.pm /usr/share/perl5/warnings/register.pm

Then can you include a copy of the file listed for lib.pm for the bad system; for example that would /usr/lib64/perl5/lib.pm on my system\, and should be about 200 lines long.

-- Wesley Crusher gets beaten up by his classmates for being a smarmy git\, and consequently has a go at making some friends of his own age for a change. -- Things That Never Happen in "Star Trek" #18

-- Thanks & Regards Gururaj Kallur Mobile​: 91-9845227154

-- Thanks & Regards Gururaj Kallur Mobile​: 91-9845227154

p5pRT commented 5 years ago

From @iabyn

On Mon\, Oct 08\, 2018 at 02​:22​:17PM +0530\, Gururaj Kallur wrote​:

Here is the output and attached the lib.pm which is listed below

Thanks. What does this get you on the bad system​:

$ perl -le'unshift @​INC\, "/foo/bar"\, @​INC; print for @​INC'

-- You never really learn to swear until you learn to drive.

p5pRT commented 5 years ago

From gskallur@gmail.com

-bash-4.2$ perl -le'unshift @​INC\, "/foo/bar"\, @​INC; print for @​INC' /foo/bar /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1 /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1

On Mon\, Oct 8\, 2018 at 2​:56 PM Dave Mitchell \davem@&#8203;iabyn\.com wrote​:

On Mon\, Oct 08\, 2018 at 02​:22​:17PM +0530\, Gururaj Kallur wrote​:

Here is the output and attached the lib.pm which is listed below

Thanks. What does this get you on the bad system​:

$ perl -le'unshift @​INC\, "/foo/bar"\, @​INC; print for @​INC'

-- You never really learn to swear until you learn to drive.

p5pRT commented 5 years ago

From @iabyn

On Mon\, Oct 08\, 2018 at 03​:25​:30PM +0530\, Gururaj Kallur wrote​:

-bash-4.2$ perl -le'unshift @​INC\, "/foo/bar"\, @​INC; print for @​INC' /foo/bar /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1 /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1

Is that the exact output\, with most of the lines duplicated\, or was that a cut+paste error?

Can you show the output of 'perl -V' on the bad system.

I'm kind of running out of suggestions here. I think we may have reached the point where you will have to do some diagnosis of this yourself​:

make a backup copy of

  /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all/lib.pm

then start to edit that file\, putting in debugging "print" statements at various points in the 'import' subroutine\, to confirm that with "use lib '/foo/bar'"\,   * the expected lib.pm file is being loaded rather than some other   version;   * the import() sub from that file is being called\, and with the   expected arguments\,   * that import() is executing one or more of the lines which do   * 'unshift @​INC\, ...'\, and print the contents of @​INC just before   and after such lines;   * print the contents of @​INC just before import() returns.   * etc to try and work out what is happening.

-- The Enterprise successfully ferries an alien VIP from one place to another without serious incident.   -- Things That Never Happen in "Star Trek" #7

p5pRT commented 5 years ago

From @iabyn

On Mon\, Oct 08\, 2018 at 11​:37​:50PM +0200\, Tomasz Konojacki wrote​:

Well\, the lines were duplicated because @​INC was also passed as a part of the LIST argument to unshift.

D'oh!

-- Fire extinguisher (n) a device for holding open fire doors.

p5pRT commented 5 years ago

From @xenu

On Mon\, 8 Oct 2018 22​:13​:50 +0100 Dave Mitchell \davem@&#8203;iabyn\.com wrote​:

Is that the exact output\, with most of the lines duplicated\, or was that a cut+paste error?

Well\, the lines were duplicated because @​INC was also passed as a part of the LIST argument to unshift.

p5pRT commented 5 years ago

From gskallur@gmail.com

For AIX and HPUX we need to set below variables for any version of perl.

export PERL5HOME=/scratch/gkallur/perl export PERL_HOME=/scratch/gkallur/perl export PERL5LIB=/scratch/gkallur/perl/lib export PATH=/scratch/gkallur/perl/bin​:$PATH

Only PATH setting will not work on AIX and HPUX.

Here is the output perl -V

-bash-4.2$ perl -V Summary of my perl5 (revision 5 version 26 subversion 1) configuration​:

  Platform​:   osname=aix   osvers=6.1.0.0   archname=aix-thread-multi-64all   uname='aix localhost 1 6 00f6e5954c00 '   config_args='-Dprefix=/scratch/gkallur/perl -Dcc=/usr/local/packages/vac_remote/13-dec2014/opt/IBM/xlC/13.1.0/bin/xlc_r -Doptimize=-O -Dusethreads -Duseithreads -Duserelocatableinc -Uusemymalloc -des -Acppflags=-D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended -Accflags=-D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended -Aldflags=-bexpall -b64 -brtl -Alddlflags=-b64 -bhalt​:4 -bexpall -G -bnoentry -lpthreads -lc'   hint=recommended   useposix=true   d_sigaction=define   useithreads=define   usemultiplicity=define   use64bitint=define   use64bitall=define   uselongdouble=undef   usemymalloc=n   default_inc_excludes_dot=define   bincompat5005=undef   Compiler​:

cc='/usr/local/packages/vac_remote/13-dec2014/opt/IBM/xlC/13.1.0/bin/xlc_r -q64'   ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -q64'   optimize='-O'   cppflags='-D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended'   ccversion=''   gccversion=''   gccosandvers=''   intsize=4   longsize=8   ptrsize=8   doublesize=8   byteorder=87654321   doublekind=4   d_longlong=define   longlongsize=8   d_longdbl=define   longdblsize=8   longdblkind=0   ivtype='long'   ivsize=8   nvtype='double'   nvsize=8   Off_t='off_t'   lseeksize=8   alignbytes=8   prototype=define   Linker and Libraries​:   ld='ld'   ldflags ='-brtl -bdynamic -bexpall -b64 -brtl -L/usr/local/lib -b64'   libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib   libs=-lpthread -lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lpthreads -lc   perllibs=-lpthread -lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc   libc=/lib/libc.a   so=a   useshrplib=false   libperl=libperl.a   gnulibc_version=''   Dynamic Linking​:   dlsrc=dl_aix.xs   dlext=so   d_dlsymun=undef   ccdlflags=' -bE​:.../../lib/5.26.1/aix-thread-multi-64all/CORE/perl.exp'   cccdlflags=' '   lddlflags='-b64 -bhalt​:4 -G -bI​:$(PERL_INC)/perl.exp -bE​:$(BASEEXT).exp -bnoentry -lpthreads -lc -lm -b64 -bhalt​:4 -bexpall -G -bnoentry -lpthreads -lc -L/usr/local/lib'

Characteristics of this binary (from libperl)​:   Compile-time options​:   HAS_TIMES   MULTIPLICITY   PERLIO_LAYERS   PERL_COPY_ON_WRITE   PERL_DONT_CREATE_GVSV   PERL_IMPLICIT_CONTEXT   PERL_MALLOC_WRAP   PERL_OP_PARENT   PERL_PRESERVE_IVUV   PERL_USE_SAFE_PUTENV   USE_64_BIT_ALL   USE_64_BIT_INT   USE_ITHREADS   USE_LARGE_FILES   USE_LOCALE   USE_LOCALE_COLLATE   USE_LOCALE_CTYPE   USE_LOCALE_NUMERIC   USE_LOCALE_TIME   USE_PERLIO   USE_PERL_ATOF   USE_REENTRANT_API   Built under aix   Compiled at Oct 3 2018 11​:50​:11   %ENV​:   PERL5HOME="/scratch/gkallur/perl"   PERL5LIB="/scratch/gkallur/perl/lib"   PERL_HOME="/scratch/gkallur/perl"   @​INC​:   /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all   /scratch/gkallur/perl/lib/5.26.1   /scratch/gkallur/perl/lib   ../lib/site_perl/5.26.1/aix-thread-multi-64all   ../lib/site_perl/5.26.1   ../lib/5.26.1/aix-thread-multi-64all   ../lib/5.26.1

On Tue\, Oct 9\, 2018 at 3​:14 AM Dave Mitchell via RT \< perlbug-followup@​perl.org> wrote​:

On Mon\, Oct 08\, 2018 at 11​:37​:50PM +0200\, Tomasz Konojacki wrote​:

Well\, the lines were duplicated because @​INC was also passed as a part of the LIST argument to unshift.

D'oh!

-- Fire extinguisher (n) a device for holding open fire doors.

p5pRT commented 5 years ago

From gskallur@gmail.com

Added print statements in in the 'import' subroutine of /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all/lib.pm Here is the import subroutine with print statements

sub import {   shift;

  my %names;   print "**** Arguement passed : @​_";   foreach (reverse @​_) {   my $path = $_; # we'll be modifying it\, so break the alias   if ($path eq '') {   require Carp;   Carp​::carp("Empty compile time value given to use lib");   }

  if ($path !~ /\.par$/i && -e $path && ! -d _) {   require Carp;   Carp​::carp("Parameter to use lib must be directory\, not file");   }   unshift(@​INC\, $path);   print "**** After UNSHIFT in foreach loop : @​INC";   # Add any previous version directories we found at configure time   foreach my $incver (@​inc_version_list)   {   my $dir = "$path/$incver";   unshift(@​INC\, $dir) if -d $dir;   }   # Put a corresponding archlib directory in front of $path if it   # looks like $path has an archlib directory below it.   my($arch_auto_dir\, $arch_dir\, $version_dir\, $version_arch_dir)   = _get_dirs($path);   unshift(@​INC\, $arch_dir) if -d $arch_auto_dir;   unshift(@​INC\, $version_dir) if -d $version_dir;   unshift(@​INC\, $version_arch_dir) if -d $version_arch_dir;   }   print "**** After foreach loop : @​INC";

  # remove trailing duplicates   @​INC = grep { ++$names{$_} == 1 } @​INC;   print "**** Before return statement : @​INC";   return; }

And the output is

-bash-4.2$ perl -le'use lib "/foo/bar"; print for @​INC' **** Arguement passed : /foo/bar **** After foreach loop : /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1 **** Before return statement : /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1 /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1

I found that it is not printing the print statement inside the foreach loop ( print "**** After UNSHIFT in foreach loop : @​INC"; )

p5pRT commented 5 years ago

From gskallur@gmail.com

It is not going inside foreach loop in import subroutine. If I remove the "reverse" from the "foreach (reverse @​_) {" in import subroutine Then it is going inside the foreach loop. Here is the output after removing "reverse" from foraeach

-bash-4.2$ perl -le'use lib "/foo/bar"; print for @​INC' **** Arguement passed : /foo/bar **** After UNSHIFT in foreach loop : /foo/bar /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1 **** After foreach loop : /foo/bar /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1 **** Before return statement : /foo/bar /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1 /foo/bar /scratch/gkallur/perl/lib/5.26.1/aix-thread-multi-64all /scratch/gkallur/perl/lib/5.26.1 /scratch/gkallur/perl/lib ../lib/site_perl/5.26.1/aix-thread-multi-64all ../lib/site_perl/5.26.1 ../lib/5.26.1/aix-thread-multi-64all ../lib/5.26.1

p5pRT commented 5 years ago

From gskallur@gmail.com

Modified the import subroutine as below and is working fine. ( defined an array my @​sd=reverse @​_; and used in foreach ) sub import {   shift;

  my %names;   print "**** Arguement passed : @​_";   my @​sd=reverse @​_;   foreach (@​sd) {   my $path = $_; # we'll be modifying it\, so break the alias   if ($path eq '') {   require Carp;   Carp​::carp("Empty compile time value given to use lib");   }

  if ($path !~ /\.par$/i && -e $path && ! -d _) {   require Carp;   Carp​::carp("Parameter to use lib must be directory\, not file");   }   unshift(@​INC\, $path);   print "**** After UNSHIFT in foreach loop : @​INC";   # Add any previous version directories we found at configure time   foreach my $incver (@​inc_version_list)   {   my $dir = "$path/$incver";   unshift(@​INC\, $dir) if -d $dir;   }   # Put a corresponding archlib directory in front of $path if it   # looks like $path has an archlib directory below it.   my($arch_auto_dir\, $arch_dir\, $version_dir\, $version_arch_dir)   = _get_dirs($path);   unshift(@​INC\, $arch_dir) if -d $arch_auto_dir;   unshift(@​INC\, $version_dir) if -d $version_dir;   unshift(@​INC\, $version_arch_dir) if -d $version_arch_dir;   }   print "**** After foreach loop : @​INC";

  # remove trailing duplicates   @​INC = grep { ++$names{$_} == 1 } @​INC;   print "**** Before return statement : @​INC";   return; }

If reverse is inside the foreach then it is not working.

p5pRT commented 5 years ago

From @iabyn

On Tue\, Oct 09\, 2018 at 12​:50​:16PM +0530\, Gururaj Kallur wrote​:

If reverse is inside the foreach then it is not working.

That's very odd.

Can that behaviour be reproduced directly\, rather than just in lib.pm?

E.g. does this line show any output?

  $ perl -le 'sub f { for (reverse @​_) { print "[$_]" } } f("/foo/bar");'   [/foo/bar]   $

-- Diplomacy is telling someone to go to hell in such a way that they'll look forward to the trip

p5pRT commented 5 years ago

From gskallur@gmail.com

No output for the line

-bash-4.2$ perl -le 'sub f { for (reverse @​_) { print "[$_]" } } f("/foo/bar");' -bash-4.2$

I have written small code to test the reverse behaviour. Here is the file reverse.pl -bash-4.2$ cat reverse.pl #!/usr/bin/env perl use strict; use warnings; use 5.26.1;

my @​words = qw(Foo Bar Moo); my @​sdrow = reverse @​words;

foreach (@​sdrow){ print "$_\n"; } -bash-4.2$ perl reverse.pl Moo Bar Foo

After changing the foreach loop as below

-bash-4.2$ cat reverse.pl #!/usr/bin/env perl use strict; use warnings; use 5.26.1;

my @​words = qw(Foo Bar Moo); my @​sdrow = reverse @​words;

foreach (reverse @​words){ print "$_\n"; } -bash-4.2$ perl reverse.pl -bash-4.2$

No output

p5pRT commented 5 years ago

From @iabyn

On Tue\, Oct 09\, 2018 at 02​:24​:56PM +0530\, Gururaj Kallur wrote​:

No output

Thanks.

So\, 1) can you show me the output of

perl -MO=Concise -e' for (reverse @​a) { print }'

2) do you have the facility/ability to build a version of perl-5.26.1 with optimisation disabled and debugging symbols enabled\, and to single step through a C function in the perl src using a debugger like gdb?

The building would involve adding the '-DDEBUGGING' switch to the ./Configure command line in addition to any usual switches.

-- In England there is a special word which means the last sunshine of the summer. That word is "spring".

p5pRT commented 5 years ago

From gskallur@gmail.com

-bash-4.2$ perl -MO=Concise -e' for (reverse @​a) { print }' g \<@​> leave[1 ref] vKP/REFC ->(end) 1 \<0> enter ->2 2 \<;> nextstate(main 1 -e​:1) v​:{ ->3 f \<2> leaveloop vK/2 ->g 7 \<{> enteriter(next->c last->f redo->8) vKS/DEF\,REVERSED ->d - \<0> ex-pushmark s ->3 - \<1> ex-list lKM ->6 3 \<0> pushmark s ->4 - \<1> ex-reverse lKM/1 ->- - \<0> ex-pushmark s ->4 5 \<1> rv2av[t2] sKR/1 ->6 4 \<#> gv[*a] s ->5 6 \<#> gv[*_] s ->7 - \<1> null vK/1 ->f e \<|> and(other->8) vK/1 ->f d \<0> iter s/REVERSED ->e - \<@​> lineseq vK ->- 8 \<;> nextstate(main 3 -e​:1) v ->9 b \<@​> print vK ->c 9 \<0> pushmark s ->a - \<1> ex-rv2sv sK/1 ->b a \<#> gvsv[*_] s ->b c \<0> unstack v ->d -e syntax OK

I will try to build with the debug options. Give me some time. Once done will let you know

p5pRT commented 5 years ago

From gskallur@gmail.com

Compiled perl with -DDEBUGGING and optimisation disabled and debugging symbols enabled

here is the perl -V output

-bash-4.2$ perl -V Summary of my perl5 (revision 5 version 26 subversion 1) configuration​:

  Platform​:   osname=aix   osvers=6.1.0.0   archname=aix-thread-multi-64all   uname='aix localhost 1 6 00f6e5954c00 '   config_args='-Dprefix=/scratch/gkallur/perl_debug/perl -Dcc=/usr/local/packages/vac_remote/13-dec2014/opt/IBM/xlC/13.1.0/bin/xlc_r -Dusethreads -DDEBUGGING -Duseithreads -Duserelocatableinc -Uusemymalloc -des -Acppflags=-D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended -Accflags=-D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended -Aldflags=-bexpall -b64 -brtl -Alddlflags=-b64 -bhalt​:4 -bexpall -G -bnoentry -lpthreads -lc'   hint=recommended   useposix=true   d_sigaction=define   useithreads=define   usemultiplicity=define   use64bitint=define   use64bitall=define   uselongdouble=undef   usemymalloc=n   default_inc_excludes_dot=define   bincompat5005=undef   Compiler​:

cc='/usr/local/packages/vac_remote/13-dec2014/opt/IBM/xlC/13.1.0/bin/xlc_r -q64'   ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended -DNEED_PTHREAD_INIT -DDEBUGGING -I/usr/local/include -q64 -q64'   optimize='-O -g'   cppflags='-D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended'   ccversion=''   gccversion=''   gccosandvers=''   intsize=4   longsize=8   ptrsize=8   doublesize=8   byteorder=87654321   doublekind=4   d_longlong=define   longlongsize=8   d_longdbl=define   longdblsize=8   longdblkind=0   ivtype='long'   ivsize=8   nvtype='double'   nvsize=8   Off_t='off_t'   lseeksize=8   alignbytes=8   prototype=define   Linker and Libraries​:   ld='ld'   ldflags ='-brtl -bdynamic -bexpall -b64 -brtl -L/usr/local/lib -b64'   libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib   libs=-lpthread -lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lpthreads -lc   perllibs=-lpthread -lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc   libc=/lib/libc.a   so=a   useshrplib=false   libperl=libperl.a   gnulibc_version=''   Dynamic Linking​:   dlsrc=dl_aix.xs   dlext=so   d_dlsymun=undef   ccdlflags=' -bE​:.../../lib/5.26.1/aix-thread-multi-64all/CORE/perl.exp'   cccdlflags=' '   lddlflags='-b64 -bhalt​:4 -G -bI​:$(PERL_INC)/perl.exp -bE​:$(BASEEXT).exp -bnoentry -lpthreads -lc -lm -b64 -bhalt​:4 -bexpall -G -bnoentry -lpthreads -lc -L/usr/local/lib'

Characteristics of this binary (from libperl)​:   Compile-time options​:   DEBUGGING   HAS_TIMES   MULTIPLICITY   PERLIO_LAYERS   PERL_COPY_ON_WRITE   PERL_DONT_CREATE_GVSV   PERL_IMPLICIT_CONTEXT   PERL_MALLOC_WRAP   PERL_OP_PARENT   PERL_PRESERVE_IVUV   PERL_TRACK_MEMPOOL   PERL_USE_SAFE_PUTENV   USE_64_BIT_ALL   USE_64_BIT_INT   USE_ITHREADS   USE_LARGE_FILES   USE_LOCALE   USE_LOCALE_COLLATE   USE_LOCALE_CTYPE   USE_LOCALE_NUMERIC   USE_LOCALE_TIME   USE_PERLIO   USE_PERL_ATOF   USE_REENTRANT_API   Built under aix   Compiled at Oct 9 2018 04​:35​:18   %ENV​:   PERL5HOME="/scratch/gkallur/perl_debug/perl"   PERL5LIB="/scratch/gkallur/perl_debug/perl/lib"   PERL_HOME="/scratch/gkallur/perl_debug/perl"   @​INC​:   /scratch/gkallur/perl_debug/perl/lib/5.26.1/aix-thread-multi-64all   /scratch/gkallur/perl_debug/perl/lib/5.26.1   /scratch/gkallur/perl_debug/perl/lib   ../lib/site_perl/5.26.1/aix-thread-multi-64all   ../lib/site_perl/5.26.1   ../lib/5.26.1/aix-thread-multi-64all   ../lib/5.26.1

p5pRT commented 5 years ago

From @iabyn

On Tue\, Oct 09\, 2018 at 05​:27​:29PM +0530\, Gururaj Kallur wrote​:

Compiled perl with -DDEBUGGING and optimisation disabled and debugging symbols enabled

Ok thanks. Run this and show me the output​:

$ perl -Dst -le '@​a = qw(/foo/bar); for (reverse @​a) { print }'

EXECUTING...

  =>
(-e​:0) enter   =>
(-e​:0) nextstate   =>
(-e​:1) pushmark   => *
(-e​:1) const(PV("/foo/bar"\0))   => * PV("/foo/bar"\0)
(-e​:1) pushmark   => * PV("/foo/bar"\0) *
(-e​:1) gv(main​::a)   => * PV("/foo/bar"\0) * GV()
(-e​:1) rv2av   => * PV("/foo/bar"\0) * AV()
(-e​:1) aassign   =>
(-e​:1) nextstate   =>
(-e​:1) pushmark   => *
(-e​:1) gv(main​::a)   => * GV()
(-e​:1) rv2av   => * AV()
(-e​:1) gv(main​::_)   => * AV() GV()
(-e​:1) enteriter   =>
(-e​:1) iter   =>
(-e​:1) nextstate   =>
(-e​:1) pushmark   => *
(-e​:1) gvsv(main​::_)   => * PV("/foo/bar"\0)
(-e​:1) print /foo/bar   => SV_YES
(-e​:1) unstack   =>
(-e​:1) iter   => SV_NO
(-e​:1) leaveloop   =>
(-e​:1) leave

-- I took leave and went to hear Mrs Turner's daughter play on the harpsicon\, but Lord\, it was enough to make any man sick to hear her; yet I was forced to commend her highly.   -- The Diary of Samuel Pepys\, 1 May 1663

p5pRT commented 5 years ago

From @tux

On Tue\, 9 Oct 2018 13​:06​:00 +0100\, Dave Mitchell \davem@&#8203;iabyn\.com wrote​:

perl -Dst -le '@​a = qw(/foo/bar); for (reverse @​a) { print }'

Just for reference ...

AIX 5.3.0.0/TL12-05 IBM\,9115-505 PowerPC_POWER5/1898(2) 3920 Mb This is perl 5\, version 14\, subversion 2 (v5.14.2) built for aix-64all -V output at the bottom

$ perl -Dst -le '@​a = qw(/foo/bar); for (reverse @​a) { print }'

EXECUTING...

  => (-e​:0) enter   => (-e​:0) nextstate   => (-e​:1) pushmark   => * (-e​:1) const(PV("/foo/bar"\0))   => * PV("/foo/bar"\0) (-e​:1) pushmark   => * PV("/foo/bar"\0) * (-e​:1) gv(main​::a)   => * PV("/foo/bar"\0) * GV() (-e​:1) rv2av   => * PV("/foo/bar"\0) * AV() (-e​:1) aassign   => (-e​:1) nextstate   => (-e​:1) pushmark   => * (-e​:1) gv(main​::a)   => * GV() (-e​:1) rv2av   => * AV() (-e​:1) gv(main​::_)   => * AV() GV() (-e​:1) enteriter   => (-e​:1) iter   => SV_YES (-e​:1) and   => (-e​:1) nextstate   => SV_YES (-e​:1) pushmark   => SV_YES * (-e​:1) gvsv(main​::_)   => SV_YES * PV("/foo/bar"\0) (-e​:1) print /foo/bar   => SV_YES SV_YES (-e​:1) unstack   => SV_YES (-e​:1) iter   => SV_YES SV_NO (-e​:1) and   => SV_YES SV_NO (-e​:1) leaveloop   => PVNV(""\0) (-e​:1) leave

Summary of my perl5 (revision 5 version 14 subversion 2) configuration​:

  Platform​:   osname=aix\, osvers=5.3.0.0\, archname=aix-64all   uname='aix i3 3 5 0004898ad300 '   config_args='-Dusedevel -Duse64bitall -Uversiononly -Dinc_version_list=none -des'   hint=recommended\, useposix=true\, d_sigaction=define   useithreads=undef\, usemultiplicity=undef   useperlio=define\, d_sfio=undef\, uselargefiles=define\, usesocks=undef   use64bitint=define\, use64bitall=define\, uselongdouble=undef   usemymalloc=n\, bincompat5005=undef   Compiler​:   cc='xlc -q64'\, ccflags ='-q64 -DDEBUGGING -qlanglvl=extended -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -qlanglvl=extended -I/pro/local/include -q64 -DUSE_64_BIT_ALL -q64'\,   optimize='-O'\,   cppflags='-DDEBUGGING -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -I/pro/local/include'   ccversion='11.1.0.8'\, gccversion=''\, gccosandvers=''   intsize=4\, longsize=8\, ptrsize=8\, doublesize=8\, byteorder=87654321   d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=8   ivtype='long'\, ivsize=8\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8   alignbytes=8\, prototype=define   Linker and Libraries​:   ld='ld'\, ldflags ='-L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/local/lib -brtl -bdynamic -b64'   libpth=/usr/local/ppc64/lib64 /lib /usr/lib /usr/ccs/lib /usr/local/lib /usr/lib64   libs=-lbind -lnsl -ldbm -ldb -ldl -lld -lm -lcrypt -lc   perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc   libc=/lib/libc.a\, so=a\, useshrplib=false\, libperl=libperl.a   gnulibc_version=''   Dynamic Linking​:   dlsrc=dl_aix.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags=' -bE​:/pro/lib/perl5/5.14.2/aix-64all/CORE/perl.exp'   cccdlflags=' '\, lddlflags='-b64 -bhalt​:4 -G -bI​:$(PERL_INC)/perl.exp -bE​:$(BASEEXT).exp -bnoentry -lc -lm -L/usr/local/ppc64/lib64 -L/pro/local/lib'

Characteristics of this binary (from libperl)​:   Compile-time options​: DEBUGGING PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP   PERL_PRESERVE_IVUV PERL_USE_DEVEL USE_64_BIT_ALL   USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO   USE_PERL_ATOF   Built under aix   Compiled at May 11 2012 16​:36​:53   @​INC​:   /pro/lib/perl5/site_perl/5.14.2/aix-64all   /pro/lib/perl5/site_perl/5.14.2   /pro/lib/perl5/5.14.2/aix-64all   /pro/lib/perl5/5.14.2   .

-- H.Merijn Brand http​://tux.nl Perl Monger http​://amsterdam.pm.org/ using perl5.00307 .. 5.29 porting perl5 on HP-UX\, AIX\, and openSUSE http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org/ http​://qa.perl.org http​://www.goldmark.org/jeff/stupid-disclaimers/

p5pRT commented 5 years ago

From gskallur@gmail.com

Here is the output -bash-4.2$ perl -Dst -le '@​a = qw(/foo/bar); for (reverse @​a) { print }'

EXECUTING...

  => (-e​:0) enter   => (-e​:0) nextstate   => (-e​:1) pushmark   => * (-e​:1) const(PV("/foo/bar"\0))   => * PV("/foo/bar"\0) (-e​:1) pushmark   => * PV("/foo/bar"\0) * (-e​:1) gv(main​::a)   => * PV("/foo/bar"\0) * GV() (-e​:1) rv2av   => * PV("/foo/bar"\0) * AV() (-e​:1) aassign   => (-e​:1) nextstate   => (-e​:1) pushmark   => * (-e​:1) gv(main​::a)   => * GV() (-e​:1) rv2av   => * AV() (-e​:1) gv(main​::_)   => * AV() GV() (-e​:1) enteriter   => (-e​:1) iter   => SV_NO (-e​:1) and   => SV_NO (-e​:1) leaveloop   => (-e​:1) leave

p5pRT commented 5 years ago

From @iabyn

On Wed\, Oct 10\, 2018 at 10​:52​:24AM +0530\, Gururaj Kallur wrote​:

(-e​:1) enteriter => (-e​:1) iter => SV_NO

The iterator erroneously thinks that there's nothing left to iterate over.

I'd now like you to use a debugger to single-step through the Perl_pp_iter() function\, showing the path it takes\, and also the values of a couple of variables. The lines of interest are these in pp_hot.c​:

  2978 case CXt_LOOP_ARY​: /* for (@​ary) */   2979
  2980 av = cx->blk_loop.state_u.ary.ary;   2981 inc = 1 - (PL_op->op_private & OPpITER_REVERSED);   2982 ix = (cx->blk_loop.state_u.ary.ix += inc);   2983 if (UNLIKELY(inc > 0   2984 ? ix > AvFILL(av)   2985 : ix \< 0)   2986 )   2987 goto retno;   2988
  2989 if (UNLIKELY(SvRMAGICAL(av))) {

I think for some reason your machine is taking the 'goto retno' path.

Here's an annotated example session under gdb​:

  $ gdb ./perl

Set a breakpoint and run the code​:

  (gdb) b Perl_pp_iter   (gdb) run -le '@​a = qw(/foo/bar); for (reverse @​a) { print }'   Breakpoint 1\, Perl_pp_iter (my_perl=0xacd260) at pp_hot.c​:2865   2865 {

Then single step through a few lines until 'inc' gets assigned to​:

  (gdb) n   2876 cx = CX_CUR();   (gdb) n   2877 itersvp = CxITERVAR(cx);   (gdb) n   2878 assert(itersvp);   (gdb)   2880 switch (CxTYPE(cx)) {   (gdb)   2980 av = cx->blk_loop.state_u.ary.ary;   (gdb) n   2981 inc = 1 - (PL_op->op_private & OPpITER_REVERSED);   (gdb)   2982 ix = (cx->blk_loop.state_u.ary.ix += inc);

Then display the current value of inc\, and also show its type​:

  (gdb) p inc   $1 = 0xffffffffffffffff   (gdb) ptype inc   type = long

Then execute the next line (which assigns to ix) and show that var's info too​:

  (gdb) n   2983 if (UNLIKELY(inc > 0   (gdb) p ix   $2 = 0x0   (gdb) ptype ix   type = long

Now call the sv_dump() function to show what the array being iterated over looks like​:

  (gdb) call Perl_do_sv_dump(my_perl\, 0\, Perl_PerlIO_stderr(my_perl)\, av\, 0\, 4\, 0\, 200)   SV = PVAV(0xad1f90) at 0xaff9e8   REFCNT = 2   FLAGS = ()   ARRAY = 0xaf4408   FILL = 0   MAX = 3   FLAGS = (REAL)   Elt No. 0   SV = PV(0xad0df8) at 0xad0228   REFCNT = 1   FLAGS = (POK\,IsCOW\,pPOK)   PV = 0xafdd88 "/foo/bar"\0   CUR = 8   LEN = 10   COW_REFCNT = 1

Finally\, execute the conditional test\, and see which branch it takes. On a 'good' system the test condition is false and so it ends up on this line​:

  (gdb) n   2989 if (UNLIKELY(SvRMAGICAL(av))) {   (gdb)

-- This email is confidential\, and now that you have read it you are legally obliged to shoot yourself. Or shoot a lawyer\, if you prefer. If you have received this email in error\, place it in its original wrapping and return for a full refund. By opening this email\, you accept that Elvis lives.

p5pRT commented 5 years ago

From gskallur@gmail.com

While setting breakpoint getting the warnings and also not able to run single step

-bash-4.2$ gdb ./perl GNU gdb 6.3 Copyright 2004 Free Software Foundation\, Inc. GDB is free software\, covered by the GNU General Public License\, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-ibm-aix5.2.0.0"... (gdb) b Perl_pp_iter warning​: (Internal error​: pc 0x1001cf584 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf5a8 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf5d0 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf5e0 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf5f0 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf600 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf628 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf630 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf680 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf6d4 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf6e4 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf6fc in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf71c in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf720 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf740 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf748 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf758 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf774 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf788 in read in psymtab\, but not in symtab.)

warning​: (Internal error​: pc 0x1001cf79c in read in psymtab\, but not in symtab.)

Breakpoint 1 at 0x1d9fe0​: file pp_hot.c\, line 2435. (gdb) run -le '@​a = qw(/foo/bar); for (reverse @​a) { print }'

warning​: (Internal error​: pc 0x1001cf79c in read in psymtab\, but not in symtab.)

Warning​: Cannot insert breakpoint 1. Error accessing memory address 0x1d9fe0​: There is an input or output error..

I tried in some other AIX m/cs also. perl 5.26.1 behavior is same. But other perls are working fine (5.14.4\, 5.22.0\, 5.10.0\, 5.14.1) And the same 5.26.1 is working fine in Linux and HPUX.

p5pRT commented 5 years ago

From gskallur@gmail.com

I manually searched the Perl_pp_iter in pp_hot.c. I could not find the Perl_pp_iter in that file.

p5pRT commented 5 years ago

From @iabyn

On Wed\, Oct 10\, 2018 at 05​:38​:15PM +0530\, Gururaj Kallur wrote​:

I manually searched the Perl_pp_iter in pp_hot.c. I could not find the Perl_pp_iter in that file.

it appears in the src as

  PP(pp_iter)

where the PP macro adds the Perl_ prefix

-- No matter how many dust sheets you use\, you will get paint on the carpet.

p5pRT commented 5 years ago

From gskallur@gmail.com

Not able to proceed with gdb. Any suggestion

p5pRT commented 5 years ago

From gskallur@gmail.com

-bash-4.2$ ./perl -Ilib Porting/expand-macro.pl UNLIKELY Can't open perl script "Porting/expand-macro.pl"​: A file or directory in the path name does not exist.

On Sat\, Oct 13\, 2018 at 7​:33 AM Craig A. Berry \craig\.a\.berry@&#8203;gmail\.com wrote​:

On Thu\, Oct 11\, 2018 at 2​:31 AM Gururaj Kallur \gskallur@&#8203;gmail\.com wrote​:

Not able to proceed with gdb. Any suggestion

What does the UNLIKELY macro expand to? Check like so​:

$ ./perl -Ilib Porting/expand-macro.pl UNLIKELY

-- Thanks & Regards Gururaj Kallur Mobile​: 91-9845227154

p5pRT commented 5 years ago

From @iabyn

I don't know enough about AIX to know why gdb won't work for you. In the absence of being able to use a debugger\, could you apply the attached patch to your debugging build of perl\, re-run 'make'\, then run the following​:

  $ ./perl -Dq -le '@​a = qw(/foo/bar); for (reverse @​a) { print }'

  CXt_LOOP_ARY​:   inc=-1; ix=0; fill=0   inc>0​: 0; ix>fill​: 0; ix\<0​: 0   /foo/bar

  CXt_LOOP_ARY​:   inc=-1; ix=-1; fill=0   inc>0​: 0; ix>fill​: 0; ix\<0​: 1   goto retno

-- I don't want to achieve immortality through my work... I want to achieve it through not dying.   -- Woody Allen

p5pRT commented 5 years ago

From @iabyn

0001-add-debugging-output-in-pp_iter.patch ```diff From a6f1646af0765f5f7abdf265dd37f15ce0d0ff4b Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Mon, 15 Oct 2018 13:24:27 +0100 Subject: [PATCH] add debugging output in pp_iter --- pp_hot.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pp_hot.c b/pp_hot.c index 56e3cbe6e1..22eb00f3c0 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -3949,11 +3949,21 @@ PP(pp_iter) av = cx->blk_loop.state_u.ary.ary; inc = 1 - (PL_op->op_private & OPpITER_REVERSED); ix = (cx->blk_loop.state_u.ary.ix += inc); + DEBUG_q(PerlIO_printf(Perl_debug_log, "\nCXt_LOOP_ARY:\n")); + DEBUG_q(PerlIO_printf(Perl_debug_log, + "inc=%" IVdf "; ix=%" IVdf "; fill=%" IVdf "\n", + inc, ix, (IV)AvFILL(av))); + DEBUG_q(PerlIO_printf(Perl_debug_log, + "inc>0: %" IVdf "; ix>fill: %" IVdf "; ix<0: %" IVdf "\n", + (IV)(inc>0), (IV)(ix > AvFILL(av)), (IV)(ix<0))); if (UNLIKELY(inc > 0 ? ix > AvFILL(av) : ix < 0) ) + { + DEBUG_q(PerlIO_printf(Perl_debug_log, "goto retno\n")); goto retno; + } if (UNLIKELY(SvRMAGICAL(av))) { SV * const * const svp = av_fetch(av, ix, FALSE); -- 2.14.4 ```
p5pRT commented 5 years ago

From gskallur@gmail.com

Applied the patch and recompiled the perl. Here is the output

-bash-4.2$ ./perl -Dq -le '@​a = qw(/foo/bar); for (reverse @​a) { print }' goto retno

p5pRT commented 5 years ago

From @iabyn

On Tue\, Oct 16\, 2018 at 12​:32​:01PM +0530\, Gururaj Kallur wrote​:

Applied the patch and recompiled the perl. Here is the output

-bash-4.2$ ./perl -Dq -le '@​a = qw(/foo/bar); for (reverse @​a) { print }' goto retno

Err\, that wasn't a cut'n'paste error was it? Are you absolutely sure that there weren't a couple of line of output before the 'goto retno'\, along the lines of​:

  CXt_LOOP_ARY​:   inc=-1; ix=-1; fill=0   inc>0​: 0; ix>fill​: 0; ix\<0​: 1

failing that\, are you absolutely sure that the patch was applied correctly?

-- Art is anything that has a label (especially if the label is "untitled 1")

p5pRT commented 5 years ago

From gskallur@gmail.com

Better to attach full file pp_hot.c and I will replace and recompile it once again. Please send me full file with debugging statements. I am recompiling perl one more time with patch

p5pRT commented 5 years ago

From @iabyn

On Tue\, Oct 16\, 2018 at 01​:07​:59PM +0530\, Gururaj Kallur wrote​:

Better to attach full file pp_hot.c and I will replace and recompile it once again. Please send me full file with debugging statements. I am recompiling perl one more time with patch

Attached is a modified pp_hot.c against release 5.26.0.

-- Fire extinguisher (n) a device for holding open fire doors.

p5pRT commented 5 years ago

From @iabyn

pp_hot.c

p5pRT commented 5 years ago

From gskallur@gmail.com

Thanks\,

Replaced pp_hot.c with attached one and recompiled the perl.

Here is the output

-bash-4.2$ ./perl -Dq -le '@​a = qw(/foo/bar); for (reverse @​a) { print }'

CXt_LOOP_ARY​: inc=4294967295; ix=4294967296; fill=0 inc>0​: 1; ix>fill​: 1; ix\<0​: 0 goto retno

p5pRT commented 5 years ago

From @craigberry

On Mon\, Oct 15\, 2018 at 12​:36 AM Gururaj Kallur \gskallur@&#8203;gmail\.com wrote​:

-bash-4.2$ ./perl -Ilib Porting/expand-macro.pl UNLIKELY Can't open perl script "Porting/expand-macro.pl"​: A file or directory in the path name does not exist.

Sorry\, I didn't mention that this has to be run from the top level of your Perl build directory after Perl is built. I don't expect it to reveal much\, but this macro is involved in the if statement that determines whether "goto retno" gets run\, so it seems worth knowing exactly how it expands on the problem system.

On Sat\, Oct 13\, 2018 at 7​:33 AM Craig A. Berry \craig\.a\.berry@&#8203;gmail\.com wrote​:

On Thu\, Oct 11\, 2018 at 2​:31 AM Gururaj Kallur \gskallur@&#8203;gmail\.com wrote​:

Not able to proceed with gdb. Any suggestion

What does the UNLIKELY macro expand to? Check like so​:

$ ./perl -Ilib Porting/expand-macro.pl UNLIKELY

-- Thanks & Regards Gururaj Kallur Mobile​: 91-9845227154

p5pRT commented 5 years ago

From @iabyn

On Tue\, Oct 16\, 2018 at 03​:10​:14PM +0530\, Gururaj Kallur wrote​:

Thanks\,

Replaced pp_hot.c with attached one and recompiled the perl.

Here is the output

-bash-4.2$ ./perl -Dq -le '@​a = qw(/foo/bar); for (reverse @​a) { print }'

CXt_LOOP_ARY​: inc=4294967295; ix=4294967296; fill=0 inc>0​: 1; ix>fill​: 1; ix\<0​: 0 goto retno

Thanks. What's the full output of

  ./perl -Ilib -V

in the build directory of that debugging perl?

-- It's not that I'm afraid to die\, I just don't want to be there when it happens.   -- Woody Allen

p5pRT commented 5 years ago

From gskallur@gmail.com

-bash-4.2$ ./perl -Ilib -V Summary of my perl5 (revision 5 version 26 subversion 1) configuration​:

  Platform​:   osname=aix   osvers=6.1.0.0   archname=aix-thread-multi-64all   uname='aix localhost 1 6 00f6e5954c00 '   config_args='-Dprefix=/scratch/gkallur/perl_debug/perl -Dcc=/usr/local/packages/vac_remote/13-dec2014/opt/IBM/xlC/13.1.0/bin/xlc_r -DDEBUGGING -Dusethreads -Duseithreads -Duserelocatableinc -Uusemymalloc -des -Acppflags=-D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended -Accflags=-D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended -Aldflags=-bexpall -b64 -brtl -Alddlflags=-b64 -bhalt​:4 -bexpall -G -bnoentry -lpthreads -lc'   hint=recommended   useposix=true   d_sigaction=define   useithreads=define   usemultiplicity=define   use64bitint=define   use64bitall=define   uselongdouble=undef   usemymalloc=n   default_inc_excludes_dot=define   bincompat5005=undef   Compiler​:

cc='/usr/local/packages/vac_remote/13-dec2014/opt/IBM/xlC/13.1.0/bin/xlc_r -q64'   ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended -DNEED_PTHREAD_INIT -DDEBUGGING -I/usr/local/include -q64 -q64'   optimize='-O -g'   cppflags='-D_ALL_SOURCE -D_THREAD_SAFE -DAIXRIOS -D_ANSI_C_SOURCE -DPERL_USE_SAFE_PUTENV -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/usr/local/include -q64 -DUSE_64_BIT_ALL -qlanglvl=extended'   ccversion=''   gccversion=''   gccosandvers=''   intsize=4   longsize=8   ptrsize=8   doublesize=8   byteorder=87654321   doublekind=4   d_longlong=define   longlongsize=8   d_longdbl=define   longdblsize=8   longdblkind=0   ivtype='long'   ivsize=8   nvtype='double'   nvsize=8   Off_t='off_t'   lseeksize=8   alignbytes=8   prototype=define   Linker and Libraries​:   ld='ld'   ldflags ='-brtl -bdynamic -bexpall -b64 -brtl -L/usr/local/lib -b64'   libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib   libs=-lpthread -lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lpthreads -lc   perllibs=-lpthread -lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc   libc=/lib/libc.a   so=a   useshrplib=false   libperl=libperl.a   gnulibc_version=''   Dynamic Linking​:   dlsrc=dl_aix.xs   dlext=so   d_dlsymun=undef   ccdlflags=' -bE​:.../../lib/5.26.1/aix-thread-multi-64all/CORE/perl.exp'   cccdlflags=' '   lddlflags='-b64 -bhalt​:4 -G -bI​:$(PERL_INC)/perl.exp -bE​:$(BASEEXT).exp -bnoentry -lpthreads -lc -lm -b64 -bhalt​:4 -bexpall -G -bnoentry -lpthreads -lc -L/usr/local/lib'

Characteristics of this binary (from libperl)​:   Compile-time options​:   DEBUGGING   HAS_TIMES   MULTIPLICITY   PERLIO_LAYERS   PERL_COPY_ON_WRITE   PERL_DONT_CREATE_GVSV   PERL_IMPLICIT_CONTEXT   PERL_MALLOC_WRAP   PERL_OP_PARENT   PERL_PRESERVE_IVUV   PERL_TRACK_MEMPOOL   PERL_USE_SAFE_PUTENV   USE_64_BIT_ALL   USE_64_BIT_INT   USE_ITHREADS   USE_LARGE_FILES   USE_LOCALE   USE_LOCALE_COLLATE   USE_LOCALE_CTYPE   USE_LOCALE_NUMERIC   USE_LOCALE_TIME   USE_PERLIO   USE_PERL_ATOF   USE_REENTRANT_API   Built under aix   Compiled at Oct 16 2018 02​:28​:20   %ENV​:   PERL5HOME="/scratch/gkallur/perl_debug/perl"   PERL5LIB="/scratch/gkallur/perl_debug/perl/lib"   PERL_HOME="/scratch/gkallur/perl_debug/perl"   @​INC​:   lib   /scratch/gkallur/perl_debug/perl/lib/5.26.1/aix-thread-multi-64all   /scratch/gkallur/perl_debug/perl/lib/5.26.1   /scratch/gkallur/perl_debug/perl/lib   ./../lib/site_perl/5.26.1/aix-thread-multi-64all   ./../lib/site_perl/5.26.1   ./../lib/5.26.1/aix-thread-multi-64all   ./../lib/5.26.1

p5pRT commented 5 years ago

From @iabyn

On Tue\, Oct 16\, 2018 at 05​:58​:33PM +0530\, Gururaj Kallur wrote​:

-bash-4.2$ ./perl -Ilib -V Summary of my perl5 (revision 5 version 26 subversion 1) configuration​:

And for the final piece of the jigsaw\, can you run this command​:

  $ grep U8TYPE config.h handy.h

-- Monto Blanco... scorchio!