Re: Error build with option -O

2017-04-27 Thread David Griffiths1
My suggestion would be to split sv.c into two, svc1.c and svc2.c. Compile 
one with -O and one without. See if it works, swap to compiling the other 
with -O if necessary. Repeat that process to binary chop and find out 
exactly which function in sv.c is failing. If you can narrow down to a 
simple test case even better.

Or another approach: if you still have access to an older version of z/OS 
can you compile sv.c with the assembler listing option on (-Wc,list) then 
do the same with z/OS 2.02 both with and without -O and then we can do a 
diff. (I found a bug in the latest metal C compiler just recently using 
this approach. Use "cut" to get rid of unwanted junk from the listings).

Cheers,

Dave Griffiths
z/OS Developer
IBM United Kingdom Limited, Hursley Park, Winchester, SO21 2JN, UK
 



From:   Yaroslav Kuzmin 
To: "perl-mvs@perl.org" , "perl5-port...@perl.org" 

Date:   18/04/2017 09:11
Subject:    Error build with option -O



Hi All

We switched to a new version of z/OS 2.02 

SO a new version XLC with option -O , building perl with error.


 > (02:56) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> make miniperl
 > echo @`sh  cflags "optimize='-O'" opmini.o`  -DPERL_IS_MINIPERL 
-DPERL_EXTERNAL_GLOB opmini.c
 > @c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname 
-qxplink -qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS 
-D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC 
-D_POSIX_SOURCE=1 -D_OPEN_SYS_FILE_EXT=1 -O -DPERL_IS_MINIPERL 
-DPERL_EXTERNAL_GLOB opmini.c
 > echo @`sh  cflags "optimize='-O'" perlmini.o`  -DPERL_IS_MINIPERL 
-DPERL_EXTERNAL_GLOB perlmini.c@c99 -c -DPERL_CORE 
-qlanglvl=extended:extc89:extc99 -qlongname -qxplink -qdll -qfloat=ieee 
-qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS 
-D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC -D_POSIX_SOURCE=1 
-D_OPEN_SYS_FILE_EXT=1 -O -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB 
perlmini.c
...
 > c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname -qxplink 
-qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS 
-D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC -D_POSIX_SOURCE=1 
-D_OPEN_SYS_FILE_EXT=1 -O sv.c
...

 > c99 -qxplink -qdll -o miniperl  opmini.o perlmini.o  gv.o toke.o 
perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o 
hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o 
regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o 
numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o 
time64.o  miniperlmain.o  -lm -lc 

 > ./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '' || sh -c 
'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1
 > 'Invalid version object at 
/u/pdkuzm/ussport/perl/perl-5.24.0_O/dist/Exporter/lib/Exporter.pm line 3.
 > Compilation failed in require.
 > BEGIN failed--compilation aborted.
 > Failed to build miniperl. Please run make minitest
 > makefile:378: recipe for target 'lib/buildcustomize.pl' failed
 > make: *** [lib/buildcustomize.pl] Error 1


Running a small script 

--- test.pl 
require 5.006;
printf "test\n"
---

(02:58) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> ./miniperl test.pl
Invalid version object at test.pl line 2.

BUT 

If compiling only one file (sv.c)  without option -O  All corectlly
 
 > c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname -qxplink 
-qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS 
-D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC -D_POSIX_SOURCE=1 
-D_OPEN_SYS_FILE_EXT=1  sv.c
 > c99 -qxplink -qdll -o miniperl  opmini.o perlmini.o  gv.o toke.o 
perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o 
hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o 
regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o 
numeric.o mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o 
time64.o  miniperlmain.o  -lm -lc 

 > (03:01) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> ./miniperl 
test.pl
 > test

Error message (Invalid version object)  in function Perl_vcmp()

And 

Adding debugging information (-DDEBUGGING) is all correct ,


There are ideas for debugging !?

-- 

Regards,

Yaroslav Kuzmin
Developer C/C++ ,z/OS , Linux
3 Zhukovskiy Street · Miass, Chelyabinsk region 456318 · Russia
Tel:  +7.922.2.38.33.38
Email: ykuz...@rocketsoftware.com
Web: www.rocketsoftware.com


Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 
02451 ■ Main Office Toll Free Number: +1 877.328.2932
Contact Customer Support: 
https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport
Unsubscribe from Marketing Messages

Re: Error build with option -O

2017-04-26 Thread Karl Williamson

On 04/18/2017 01:22 AM, Yaroslav Kuzmin wrote:

Hi All

We switched to a new version of z/OS 2.02

SO a new version XLC with option -O , building perl with error.


 > (02:56) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> make miniperl
 > echo @`sh  cflags "optimize='-O'" opmini.o`  -DPERL_IS_MINIPERL
-DPERL_EXTERNAL_GLOB opmini.c
 > @c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname
-qxplink -qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS
-D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC
-D_POSIX_SOURCE=1 -D_OPEN_SYS_FILE_EXT=1 -O -DPERL_IS_MINIPERL
-DPERL_EXTERNAL_GLOB opmini.c
 > echo @`sh  cflags "optimize='-O'" perlmini.o`  -DPERL_IS_MINIPERL
-DPERL_EXTERNAL_GLOB perlmini.c@c99 -c -DPERL_CORE
-qlanglvl=extended:extc89:extc99 -qlongname -qxplink -qdll -qfloat=ieee
-qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS
-D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC -D_POSIX_SOURCE=1
-D_OPEN_SYS_FILE_EXT=1 -O -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
...
 > c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname
-qxplink -qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS
-D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC
-D_POSIX_SOURCE=1 -D_OPEN_SYS_FILE_EXT=1 -O sv.c
...

 > c99 -qxplink -qdll -o miniperl  opmini.o perlmini.o  gv.o toke.o
perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o
keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o
doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o
perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o
caretx.o dquote.o time64.o  miniperlmain.o  -lm -lc

 > ./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '' || sh -c
'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1
 > 'Invalid version object at
/u/pdkuzm/ussport/perl/perl-5.24.0_O/dist/Exporter/lib/Exporter.pm line 3.
 > Compilation failed in require.
 > BEGIN failed--compilation aborted.
 > Failed to build miniperl. Please run make minitest
 > makefile:378: recipe for target 'lib/buildcustomize.pl' failed
 > make: *** [lib/buildcustomize.pl] Error 1


Running a small script

--- test.pl 
require 5.006;
printf "test\n"
---

(02:58) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> ./miniperl test.pl
Invalid version object at test.pl line 2.

BUT

If compiling only one file (sv.c)  without option -O  All corectlly

 > c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname
-qxplink -qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS
-D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC
-D_POSIX_SOURCE=1 -D_OPEN_SYS_FILE_EXT=1  sv.c
 > c99 -qxplink -qdll -o miniperl  opmini.o perlmini.o  gv.o toke.o
perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o
keywords.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o
doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o
perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o
caretx.o dquote.o time64.o  miniperlmain.o  -lm -lc

 > (03:01) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> ./miniperl
test.pl
 > test

Error message (Invalid version object)  in function Perl_vcmp()

And

Adding debugging information (-DDEBUGGING) is all correct ,


There are ideas for debugging !?



This can be from

1) a bug in the new compiler, though my experience is that this is unlikely.

2) an alignment issue

3) use of some construct which has undefined behavior, but the earlier 
compiler gave the expected behavior.


4) probably lots of other things.

If there exists some tool that looks for out-of-bounds kinds of things, 
I'd start with that.  valgrind or purify or various other ones are 
available on some systems.


 Getting a stack trace would be helpful.  Opening a file in C and 
writing the invalid version object out to it might be helpful.


Error build with option -O

2017-04-18 Thread Yaroslav Kuzmin
Hi All

We switched to a new version of z/OS 2.02

SO a new version XLC with option -O , building perl with error.


 > (02:56) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> make miniperl
 > echo @`sh  cflags "optimize='-O'" opmini.o`  -DPERL_IS_MINIPERL 
 > -DPERL_EXTERNAL_GLOB opmini.c
 > @c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname -qxplink 
 > -qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS 
 > -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC -D_POSIX_SOURCE=1 
 > -D_OPEN_SYS_FILE_EXT=1 -O -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB opmini.c
 > echo @`sh  cflags "optimize='-O'" perlmini.o`  -DPERL_IS_MINIPERL 
 > -DPERL_EXTERNAL_GLOB perlmini.c@c99 -c -DPERL_CORE 
 > -qlanglvl=extended:extc89:extc99 -qlongname -qxplink -qdll -qfloat=ieee 
 > -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS 
 > -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC -D_POSIX_SOURCE=1 
 > -D_OPEN_SYS_FILE_EXT=1 -O -DPERL_IS_MINIPERL -DPERL_EXTERNAL_GLOB perlmini.c
...
 > c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname -qxplink 
 > -qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS 
 > -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC -D_POSIX_SOURCE=1 
 > -D_OPEN_SYS_FILE_EXT=1 -O sv.c
...

 > c99 -qxplink -qdll -o miniperl  opmini.o perlmini.o  gv.o toke.o perly.o 
 > pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o 
 > run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o 
 > utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o 
 > mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o  
 > miniperlmain.o  -lm -lc

 > ./miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e '' || sh -c 'echo 
 > >&2 Failed to build miniperl.  Please run make minitest; exit 1
 > 'Invalid version object at 
 > /u/pdkuzm/ussport/perl/perl-5.24.0_O/dist/Exporter/lib/Exporter.pm line 3.
 > Compilation failed in require.
 > BEGIN failed--compilation aborted.
 > Failed to build miniperl. Please run make minitest
 > makefile:378: recipe for target 'lib/buildcustomize.pl' failed
 > make: *** [lib/buildcustomize.pl] Error 1


Running a small script

--- test.pl 
require 5.006;
printf "test\n"
---

(02:58) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> ./miniperl test.pl
Invalid version object at test.pl line 2.

BUT

If compiling only one file (sv.c)  without option -O  All corectlly

 > c99 -c -DPERL_CORE -qlanglvl=extended:extc89:extc99 -qlongname -qxplink 
 > -qdll -qfloat=ieee -qhaltonmsg=3296:4108 -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS 
 > -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC -D_POSIX_SOURCE=1 
 > -D_OPEN_SYS_FILE_EXT=1  sv.c
 > c99 -qxplink -qdll -o miniperl  opmini.o perlmini.o  gv.o toke.o perly.o 
 > pad.o regcomp.o dump.o util.o mg.o reentr.o mro_core.o keywords.o hv.o av.o 
 > run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o 
 > utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o 
 > mathoms.o locale.o pp_pack.o pp_sort.o caretx.o dquote.o time64.o  
 > miniperlmain.o  -lm -lc

 > (03:01) RS12 : PDKUZM | ~/ussport/perl/perl-5.24.0_O :> ./miniperl test.pl
 > test

Error message (Invalid version object)  in function Perl_vcmp()

And

Adding debugging information (-DDEBUGGING) is all correct ,


There are ideas for debugging !?


--

Regards,

Yaroslav Kuzmin
Developer C/C++ ,z/OS , Linux
3 Zhukovskiy Street · Miass, Chelyabinsk region 456318 · Russia
Tel:  +7.922.2.38.33.38
Email: ykuz...@rocketsoftware.com
Web: www.rocketsoftware.com



Rocket Software, Inc. and subsidiaries ■ 77 Fourth Avenue, Waltham MA 02451 ■ 
Main Office Toll Free Number: +1 877.328.2932
Contact Customer Support: 
https://my.rocketsoftware.com/RocketCommunity/RCEmailSupport
Unsubscribe from Marketing Messages/Manage Your Subscription Preferences - 
http://www.rocketsoftware.com/manage-your-email-preferences
Privacy Policy - http://www.rocketsoftware.com/company/legal/privacy-policy


This communication and any attachments may contain confidential information of 
Rocket Software, Inc. All unauthorized use, disclosure or distribution is 
prohibited. If you are not the intended recipient, please notify Rocket 
Software immediately and destroy all copies of this communication. Thank you.