Perl / perl5

πŸͺ The Perl programming language
https://dev.perl.org/perl5/
Other
1.98k stars 559 forks source link

compiler version on sparc/netbsd #6715

Closed p5pRT closed 4 years ago

p5pRT commented 21 years ago

Migrated from rt.perl.org#23463 (status was 'stalled')

Searchable as RT23463$

p5pRT commented 21 years ago

From alian@cpan.org

Created by alian@cpan.org

This is a bug report for perl from alian@​cpan.org\, generated with the help of perlbug 1.34 running under perl v5.8.0.

----------------------------------------------------------------- There seems to be some problem with gcc before version 3 on sparc Config used for test​: 1/ 1.6 i386 /gcc 2.95.3 2/ 1.6.1 sparc/gcc 2.95.5 3/ 1.6.1 sparc/gcc 3.2.1 4/ 1.5.3 sparc/gcc 2.91

There is problem with 2/ and 4/. So only sparc and gcc-2.something. Last 2 major version of NetBSD affected

Here error on make test\, all config​: t/op/pack............................FAILED at test 187

and the test die some secs after due to an illegal div 0.

There is another failure with thread (only without debugging)​: ext/IO/t/io_xs.......................FAILED at test 0

Perl Info ``` Flags: category=core severity=low Site configuration information for perl v5.8.0: Configured by alian at Thu May 22 14:54:22 GMT 2003. Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=netbsd, osvers=1.6.1, archname=sparc-netbsd uname='netbsd centaure.alianet 1.6.1 netbsd 1.6.1 (generic) #0: wed apr 9 03:02:04 utc 2003 autobuild@tgm.daemon.org:autobuildnetbsd-1-6sparcobjautobuildnetbsd-1-6srcsysarchsparccompilegeneric sparc ' config_args='-Dprefix=/usr/local/perl-5.8.0 -Dcf_email=alian@cpan.org -des' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -I/usr/pkg/include', optimize='-O', cppflags='-fno-strict-aliasing -I/usr/pkg/include' ccversion='', gccversion='2.95.3 20010315 (release) (NetBSD nb3)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -Wl,-rpath,/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/pkg/lib -L/usr/local/lib' libpth=/usr/pkg/lib /usr/local/lib /usr/lib libs=-lm -lc -lposix -lcrypt -lutil perllibs=-lm -lc -lposix -lcrypt -lutil libc=/usr/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-whole-archive -lgcc -Wl,-no-whole-archive -Wl,-E ' cccdlflags='-DPIC -fPIC ', lddlflags='--whole-archive -shared -L/usr/pkg/lib -L/usr/local/lib' Locally applied patches: @INC for perl v5.8.0: /usr/local/perl-5.8.0/lib/5.8.0/sparc-netbsd /usr/local/perl-5.8.0/lib/5.8.0 /usr/local/perl-5.8.0/lib/site_perl/5.8.0/sparc-netbsd /usr/local/perl-5.8.0/lib/site_perl/5.8.0 /usr/local/perl-5.8.0/lib/site_perl . Environment for perl v5.8.0: HOME=/home/alian LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/alian/bin:/usr/local/perl-5.8.0/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/pkg/bin:/usr/pkg/sbin:/usr/games:/usr/local/bin:/usr/local/sbin PERL_BADLANG (unset) SHELL=/usr/pkg/bin/bash ```
p5pRT commented 21 years ago

From alian@cpan.org

There seems to be some problem with gcc before version 3 on sparc Config used for test​: 1/ 1.6 i386 /gcc 2.95.3 2/ 1.6.1 sparc/gcc 2.95.5 3/ 1.6.1 sparc/gcc 3.2.1 4/ 1.5.3 sparc/gcc 2.91

There is problem with 2/ and 4/. So only sparc and gcc-2.something. Last 2 major version of NetBSD affected

Here error on make test\, all config​: t/op/pack............................FAILED at test 187

Last success​: @​19201. First failure​: @​19254. Don't affect perl-5.8.0\, only blead\, may be 5.8.1

and the test die some secs after due to an illegal div 0.

Attached patch for continue test.

There is another failure with thread (only without debugging)​: ext/IO/t/io_xs.......................FAILED at test 0

Last success​: @​19254 First failure​: @​19330

p5pRT commented 21 years ago

From alian@cpan.org

pack.t.patch ```diff --- perl-current/t/op/pack.t~ Thu Jun 19 08:17:56 2003 +++ perl-current/t/op/pack.t Wed Aug 20 20:37:27 2003 @@ -445,7 +445,7 @@ } else { $calc_sum = $total; # Shift into range by some multiple of the total - my $mult = int ($total / $max_p1); + my $mult = $max_p1 ? int ($total / $max_p1) : undef; # Need this to make sure that -1 + (~0+1) is ~0 (ie still integer) $calc_sum = $total - $mult; $calc_sum -= $mult * $max; ```
p5pRT commented 21 years ago

From @nwc10

On Wed\, Aug 20\, 2003 at 01​:11​:36PM -0000\, Alain wrote​:

There seems to be some problem with gcc before version 3 on sparc Config used for test​: 1/ 1.6 i386 /gcc 2.95.3 2/ 1.6.1 sparc/gcc 2.95.5 3/ 1.6.1 sparc/gcc 3.2.1 4/ 1.5.3 sparc/gcc 2.91

There is problem with 2/ and 4/. So only sparc and gcc-2.something. Last 2 major version of NetBSD affected

Here error on make test\, all config​: t/op/pack............................FAILED at test 187

and the test die some secs after due to an illegal div 0.

There is another failure with thread (only without debugging)​:

So the pack failure occurs both with and without debugging? Is compiler optimisation turned on all the time?

pack.t's tests are really really hard to work back from the number to the line. This helps. It's somewhere in the 'c' numbers test. Not worked out precisely what yet.

Nicholas Clark

Inline Patch ```diff --- t/op/pack.t.orig 2003-08-06 15:45:20.000000000 +0100 +++ t/op/pack.t 2003-08-21 22:14:14.000000000 +0100 @@ -160,7 +160,7 @@ sub list_eq ($$) { { - # test exceptions + print "# test exceptions\n"; my $x; eval { $x = unpack 'w', pack 'C*', 0xff, 0xff}; like($@, qr/^Unterminated compressed integer/); @@ -225,8 +225,7 @@ sub list_eq ($$) { } -# -# test the "p" template +print "# test the 'p' template\n"; # literals is(unpack("p",pack("p","foo")), "foo"); @@ -255,8 +254,8 @@ like(pack("p", undef), qr/^\0+/); # see #ifdef __osf__ in pp.c pp_unpack is((unpack("i",pack("i",-1))), -1); -# test the pack lengths of s S i I l L -# test the pack lengths of n N v V +print "# test the pack lengths of s S i I l L n N v V\n"; + my @lengths = qw(s 2 S 2 i -4 I -4 l 4 L 4 n 2 N 4 v 2 V 4); while (my ($format, $expect) = splice @lengths, 0, 2) { my $len = length(pack($format, 0)); @@ -270,7 +269,8 @@ while (my ($format, $expect) = splice @l } -# test unpack-pack lengths +print "# test unpack-pack lengths\n"; + my @templates = qw(c C i I s S l L n N v V f d q Q); foreach my $t (@templates) { @@ -367,7 +367,7 @@ foreach ( } } -# packing native shorts/ints/longs +print "# packing native shorts/ints/longs\n"; is(length(pack("s!", 0)), $Config{shortsize}); is(length(pack("i!", 0)), $Config{intsize}); @@ -389,6 +389,7 @@ sub numbers_with_total { $total += $_; } } + print "# numbers test for $format\n"; foreach (@_) { SKIP: { my $out = eval {unpack($format, pack($format, $_))}; @@ -522,7 +523,7 @@ numbers_with_total ('Q', sub { 0, 1,9223372036854775807, 9223372036854775808, 18446744073709551615); -# pack nvNV byteorders +print "# pack nvNV byteorders\n"; is(pack("n", 0xdead), "\xde\xad"); is(pack("v", 0xdead), "\xad\xde"); ```
p5pRT commented 21 years ago

From @nwc10

On Wed\, Aug 20\, 2003 at 01​:11​:36PM -0000\, Alain wrote​:

# New Ticket Created by Alain # Please include the string​: [perl #23463] # in the subject line of all future correspondence about this issue. # \<URL​: http​://rt.perl.org/rt2/Ticket/Display.html?id=23463 >

This is a bug report for perl from alian@​cpan.org\, generated with the help of perlbug 1.34 running under perl v5.8.0.

----------------------------------------------------------------- There seems to be some problem with gcc before version 3 on sparc Config used for test​: 1/ 1.6 i386 /gcc 2.95.3 2/ 1.6.1 sparc/gcc 2.95.5 3/ 1.6.1 sparc/gcc 3.2.1 4/ 1.5.3 sparc/gcc 2.91

There is problem with 2/ and 4/. So only sparc and gcc-2.something. Last 2 major version of NetBSD affected

Here error on make test\, all config​: t/op/pack............................FAILED at test 187

and the test die some secs after due to an illegal div 0.

Do you know which line this is? I infer that it's in &numbers_with_total with $format 'c' and $_ 53

and it's somewhere after

  ok(defined $sum);

ie in the big block of maths that starts with the comment

  # Our problem with testing this portably is that the checksum code in   # pp_unpack is able to cast signed to unsigned\, and do modulo 2**n   # arithmetic in unsigned ints\, which perl has no operators to do.

And there's more than one division in there.

Nicholas Clark

p5pRT commented 21 years ago

From alian@cpan.org

There seems to be some problem with gcc before version 3 on sparc Config used for test​: 1/ 1.6 i386 /gcc 2.95.3 2/ 1.6.1 sparc/gcc 2.95.5 3/ 1.6.1 sparc/gcc 3.2.1 4/ 1.5.3 sparc/gcc 2.91

There is problem with 2/ and 4/. So only sparc and gcc-2.something. Last 2 major version of NetBSD affected

Here error on make test\, all config​: t/op/pack............................FAILED at test 187

and the test die some secs after due to an illegal div 0.

Do you know which line this is?

not ok 187 # Failed at t/op/pack.t line 474 # For list (-128\, -1\, 0\, 1\, 127) (total -1) packed with c unpack '%53c' gave 9.00719925474099e+15\, expected 0 ok 188 ok 189 Illegal division by zero at t/op/pack.t line 448. # Looks like you planned 5852 tests but ran 189.

And there's more than one division in there.

Yes but there is only one that cause trouble here. I submit a patch to fail the test without stop\,

http​://nntp.x.perl.org/group/perl.perl5.porters/80600

p5pRT commented 21 years ago

From alian@cpan.org

Nicholas Clark (via RT) wrote​:

On Wed\, Aug 20\, 2003 at 01​:11​:36PM -0000\, Alain wrote​:

There seems to be some problem with gcc before version 3 on sparc Config used for test​: 1/ 1.6 i386 /gcc 2.95.3 2/ 1.6.1 sparc/gcc 2.95.5 3/ 1.6.1 sparc/gcc 3.2.1 4/ 1.5.3 sparc/gcc 2.91

There is problem with 2/ and 4/. So only sparc and gcc-2.something. Last 2 major version of NetBSD affected

Here error on make test\, all config​: t/op/pack............................FAILED at test 187

and the test die some secs after due to an illegal div 0.

There is another failure with thread (only without debugging)​:

So the pack failure occurs both with and without debugging? Is compiler optimisation turned on all the time?

pack.t's tests are really really hard to work back from the number to the line. This helps. It's somewhere in the 'c' numbers test. Not worked out precisely what yet.

Result of your patch of pack test​: http​://www.alianwebserver.com/tmp/pack.t.log.txt

p5pRT commented 21 years ago

From @nwc10

On Sat\, Aug 23\, 2003 at 01​:10​:02PM +0200\, alian wrote​:

Result of your patch of pack test​: http​://www.alianwebserver.com/tmp/pack.t.log.txt

Thanks. Looks like the perl arithmetic is going wrong earlier. It seems that $max_p1 ends up as 0 from this code​:

  my $max = 1 + 2 * (int (2 ** ($len-1))-1); # The max possible checksum   my $max_p1 = $max + 1;

Could you try runing this (with 53 as @​ARGV) and see what it prints?

use Devel​::Peek; use strict;

foreach my $len (@​ARGV) {   print "Length $len​:\n";   my $max = 1 + 2 * (int (2 ** ($len-1))-1);   my $max_p1 = $max + 1;

  Dump $max;   Dump $max_p1; } __END__

I see​:

$ perl sparcmax.pl 53 Length 53​: SV = NV(0x38180) at 0x29fe4   REFCNT = 1   FLAGS = (PADBUSY\,PADMY\,NOK\,pNOK)   NV = 9.00719925474099e+15 SV = NV(0x38190) at 0x39fd8   REFCNT = 1   FLAGS = (PADBUSY\,PADMY\,NOK\,pNOK)   NV = 9.00719925474099e+15

Thanks

Nicholas Clark

p5pRT commented 21 years ago

From alian@cpan.org

Could you try runing this (with 53 as @​ARGV) and see what it prints?

use Devel​::Peek; use strict;

foreach my $len (@​ARGV) { print "Length $len​:\n"; my $max = 1 + 2 * (int (2 ** ($len-1))-1); my $max_p1 = $max + 1;

Dump $max; Dump $max_p1; } __END__

I see​:

$ perl sparcmax.pl 53 Length 53​: SV = NV(0x38180) at 0x29fe4 REFCNT = 1 FLAGS = (PADBUSY\,PADMY\,NOK\,pNOK) NV = 9.00719925474099e+15 SV = NV(0x38190) at 0x39fd8 REFCNT = 1 FLAGS = (PADBUSY\,PADMY\,NOK\,pNOK) NV = 9.00719925474099e+15

Thanks

Nicholas Clark

Two try\, one with perl-5.8.0\, one with blead​:

centaure​:\~/soft/perl-current$ ./perl -Ilib -Iext ~/sparcmax.pl 53 Length 53​: SV = IV(0x14ed14) at 0x14e934   REFCNT = 1   FLAGS = (PADMY\,IOK\,pIOK)   IV = -1 SV = IV(0x14ed1c) at 0x18329c   REFCNT = 1   FLAGS = (PADMY\,IOK\,pIOK)   IV = 0

centaure​:\~/soft/perl-current$ perl ~/sparcmax.pl 53 Length 53​: SV = PVNV(0x13c5b8) at 0x12de30   REFCNT = 1   FLAGS = (PADBUSY\,PADMY\,NOK\,pIOK\,pNOK\,IsUV)   UV = 4294967295   NV = 9.00719925474099e+15   PV = 0 SV = NV(0x139028) at 0x14c7a4   REFCNT = 1   FLAGS = (PADBUSY\,PADMY\,NOK\,pNOK)   NV = 9.00719925474099e+15 centaure​:\~/soft/perl-current$ more .patch 20856 centaure​:\~/soft/perl-current$ perl -v

This is perl\, v5.8.0 built for sparc-netbsd

Copyright 1987-2002\, 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.com/\, the Perl Home Page.

p5pRT commented 21 years ago

From @nwc10

On Sat\, Aug 23\, 2003 at 05​:59​:28PM +0200\, alian wrote​:

Could you try runing this (with 53 as @​ARGV) and see what it prints?

I see​:

$ perl sparcmax.pl 53 Length 53​: SV = NV(0x38180) at 0x29fe4 REFCNT = 1 FLAGS = (PADBUSY\,PADMY\,NOK\,pNOK) NV = 9.00719925474099e+15 SV = NV(0x38190) at 0x39fd8 REFCNT = 1 FLAGS = (PADBUSY\,PADMY\,NOK\,pNOK) NV = 9.00719925474099e+15

Er. That was silly of me. That was 5.6.1. With patchlevel 20858 I see​:

Length 53​: SV = PVNV(0x1387b8) at 0x11fa6c   REFCNT = 1   FLAGS = (PADBUSY\,PADMY\,NOK\,pIOK\,pNOK\,IsUV)   UV = 4294967295   NV = 9.00719925474099e+15   PV = 0 SV = NV(0x124188) at 0x133e80   REFCNT = 1   FLAGS = (PADBUSY\,PADMY\,NOK\,pNOK)   NV = 9.00719925474099e+15

(Debian sparc. Shouldn't be any different from Debian anything else\, but as I have access to a sparc box\, I thought I'd try it there)

Two try\, one with perl-5.8.0\, one with blead​:

I take it that this is blead​:

centaure​:\~/soft/perl-current$ ./perl -Ilib -Iext ~/sparcmax.pl 53 Length 53​: SV = IV(0x14ed14) at 0x14e934 REFCNT = 1 FLAGS = (PADMY\,IOK\,pIOK) IV = -1 SV = IV(0x14ed1c) at 0x18329c REFCNT = 1 FLAGS = (PADMY\,IOK\,pIOK) IV = 0

And this is the installed 5.8.0

centaure​:\~/soft/perl-current$ perl ~/sparcmax.pl 53 Length 53​: SV = PVNV(0x13c5b8) at 0x12de30 REFCNT = 1 FLAGS = (PADBUSY\,PADMY\,NOK\,pIOK\,pNOK\,IsUV) UV = 4294967295 NV = 9.00719925474099e+15 PV = 0 SV = NV(0x139028) at 0x14c7a4 REFCNT = 1 FLAGS = (PADBUSY\,PADMY\,NOK\,pNOK) NV = 9.00719925474099e+15

centaure​:\~/soft/perl-current$ more .patch 20856

Mmmm. That arithmetic has gone very wrong. What happens if you run this with your blead?

use Devel​::Peek; use strict;

foreach my $len (@​ARGV) {   print "Length $len​:\n";   my $a = $len - 1;   Dump $a;   my $b = 2 ** $a;   Dump $b;   my $c = int $b;   Dump $b;   Dump $c;   my $d = $c - 1;   Dump $d;   my $e = 2 * $d;   Dump $e;   my $max = 1 + $e;   Dump $max;

  my $max_p1 = $max + 1;

  Dump $max;   Dump $max_p1; } __END__

Nicholas Clark

p5pRT commented 21 years ago

From alian@cpan.org

I can give you ssh access to this/my host/lan if you want. You will find a sparc linux on Debian too :-) http​://62.212.98.196​:8080/mrtg/

Mmmm. That arithmetic has gone very wrong. What happens if you run this with your blead?

use Devel​::Peek; use strict;

foreach my $len (@​ARGV) { print "Length $len​:\n"; my $a = $len - 1; Dump $a; my $b = 2 ** $a; Dump $b; my $c = int $b; Dump $b; Dump $c; my $d = $c - 1; Dump $d; my $e = 2 * $d; Dump $e; my $max = 1 + $e; Dump $max;

my $max_p1 = $max + 1;

Dump $max; Dump $max_p1; } __END__

centaure​:\~/soft/perl-current$ ./perl -Ilib -Iext ~/sparcmax2.pl 53 Length 53​: SV = IV(0x14ecf8) at 0x14e934   REFCNT = 1   FLAGS = (PADMY\,IOK\,pIOK)   IV = 52 SV = PVNV(0x174e00) at 0x14ea00   REFCNT = 1   FLAGS = (PADMY\,NOK\,pIOK\,pNOK\,IsUV)   UV = 4294967295   NV = 4.5035996273705e+15   PV = 0 SV = PVNV(0x174e00) at 0x14ea00   REFCNT = 1   FLAGS = (PADMY\,NOK\,pIOK\,pNOK\,IsUV)   UV = 4294967295   NV = 4.5035996273705e+15   PV = 0 SV = NV(0x157818) at 0x1832c0   REFCNT = 1   FLAGS = (PADMY\,NOK\,pNOK)   NV = 0.5 SV = NV(0x157820) at 0x14ea78   REFCNT = 1   FLAGS = (PADMY\,NOK\,pNOK)   NV = -0.5 SV = NV(0x157828) at 0x185224   REFCNT = 1   FLAGS = (PADMY\,NOK\,pNOK)   NV = -1 SV = IV(0x14ecd0) at 0x185260   REFCNT = 1   FLAGS = (PADMY\,IOK\,pIOK)   IV = 0 SV = IV(0x14ecd0) at 0x185260   REFCNT = 1   FLAGS = (PADMY\,IOK\,pIOK)   IV = 0 SV = IV(0x14ed10) at 0x18529c   REFCNT = 1   FLAGS = (PADMY\,IOK\,pIOK)   IV = 1

p5pRT commented 21 years ago

From alian@cpan.org

(Debian sparc. Shouldn't be any different from Debian anything else\, but as I have access to a sparc box\, I thought I'd try it there)

my debian sparc pass this test on linux with blead​: http​://nntp.x.perl.org/group/perl.daily-build.reports/7944

The failure on ext/IO/t/io_multihomed.t is just a timeout. (limited to 3s\, pass in 4s\, something like this).

p5pRT commented 21 years ago

From @nwc10

On Sat\, Aug 23\, 2003 at 06​:43​:59PM +0200\, alian wrote​:

I can give you ssh access to this/my host/lan if you want. You will find a sparc linux on Debian too :-) http​://62.212.98.196​:8080/mrtg/

oooh. and the sparc openbsd machine.

Mmmm. That arithmetic has gone very wrong. What happens if you run this with your blead?

use Devel​::Peek; use strict;

foreach my $len (@​ARGV) { print "Length $len​:\n"; my $a = $len - 1; Dump $a; my $b = 2 ** $a; Dump $b; my $c = int $b; Dump $b; Dump $c;

centaure​:\~/soft/perl-current$ ./perl -Ilib -Iext ~/sparcmax2.pl 53 Length 53​: SV = IV(0x14ecf8) at 0x14e934 REFCNT = 1 FLAGS = (PADMY\,IOK\,pIOK) IV = 52 SV = PVNV(0x174e00) at 0x14ea00 REFCNT = 1 FLAGS = (PADMY\,NOK\,pIOK\,pNOK\,IsUV) UV = 4294967295 NV = 4.5035996273705e+15 PV = 0 SV = PVNV(0x174e00) at 0x14ea00 REFCNT = 1 FLAGS = (PADMY\,NOK\,pIOK\,pNOK\,IsUV) UV = 4294967295 NV = 4.5035996273705e+15 PV = 0 SV = NV(0x157818) at 0x1832c0 REFCNT = 1 FLAGS = (PADMY\,NOK\,pNOK) NV = 0.5

Nice. :-)

So you'd be seeing 0.5 as the output from ./perl -le 'print int (2**52)' ?

If so\, I think we have our troublemaker here. And I was tempted to think that it was actually the ** operator\, as pp_pow has been tweaked.

Nicholas Clark

p5pRT commented 21 years ago

From alian@cpan.org

I can give you ssh access to this/my host/lan if you want. You will find a sparc linux on Debian too :-) http​://62.212.98.196​:8080/mrtg/

oooh. and the sparc openbsd machine.

Yep. The-machine-who-hang-one-smoke-on-15-and-I-don't-know-why.

Nice. :-)

So you'd be seeing 0.5 as the output from ./perl -le 'print int (2**52)' ?

If so\, I think we have our troublemaker here. And I was tempted to think that it was actually the ** operator\, as pp_pow has been tweaked.

I really don't know what is it. Only one thing​: this is something between @​19201 and @​19254. Period of configure/perl.h update for modfl & co.

Always 2 tests​: one with 5.8.0\, one with blead​:

centaure​:\~/soft/perl-current$ perl -MDevel​::Peek -le '$a = int (2**52); print $a\,"\n"; Dump($a)' 4.5035996273705e+15

SV = PVNV(0x1500a0) at 0x12de3c   REFCNT = 1   FLAGS = (NOK\,POK\,pIOK\,pNOK\,pPOK\,IsUV)   UV = 4294967295   NV = 4.5035996273705e+15   PV = 0x133a30 "4.5035996273705e+15"\0   CUR = 19   LEN = 35

centaure​:\~/soft/perl-current$ ./perl -Ilib -Iext -MDevel​::Peek -le '$a = int (2**52); print $a\,"\n"; Dump($a)' 0

SV = PVNV(0x172c68) at 0x14cd10   REFCNT = 1   FLAGS = (NOK\,POK\,pNOK\,pPOK)   IV = 0   NV = 0   PV = 0x13ce08 "0"\0   CUR = 1   LEN = 35

p5pRT commented 21 years ago

From @nwc10

On Sat\, Aug 23\, 2003 at 10​:25​:37PM +0200\, alian wrote​:

I can give you ssh access to this/my host/lan if you want. You will find a sparc linux on Debian too :-) http​://62.212.98.196​:8080/mrtg/

oooh. and the sparc openbsd machine.

Yep. The-machine-who-hang-one-smoke-on-15-and-I-don't-know-why.

Nice. :-)

So you'd be seeing 0.5 as the output from ./perl -le 'print int (2**52)' ?

If so\, I think we have our troublemaker here. And I was tempted to think that it was actually the ** operator\, as pp_pow has been tweaked.

I really don't know what is it. Only one thing​: this is something between @​19201 and @​19254. Period of configure/perl.h update for modfl & co.

I'm afraid that I couldn't work out how to make the test smoke viewer at http​://cpanplus.keradel.com/cgi-bin/smoke_db.cgi tell me this information\, but it seems that the last pass was at 19174​:

http​://www.mail-archive.com/daily-build-reports@​perl.org/msg03908.html

And the first recorded fail at 19622​:

http​://www.mail-archive.com/daily-build-reports@​perl.org/msg03668.html

I suspect that the culprit is this patch​:

http​://public.activestate.com/cgi-bin/perlbrowse?patch=19218

which rearranges the innards of pp_int

Nicholas Clark

p5pRT commented 21 years ago

From alian@cpan.org

I'm afraid that I couldn't work out how to make the test smoke viewer at http​://cpanplus.keradel.com/cgi-bin/smoke_db.cgi tell me this information\,

Go to "filter" page. Select os => netbsd\, archi => sparc and all others fields "All". Submit. Then select "last failures" page.

but it seems that the last pass was at 19174​:

http​://www.mail-archive.com/daily-build-reports@​perl.org/msg03908.html

If you browse "last failures" page with these filters\, you will find 19201 as last success\, and 19254 as first failure for pack.

p5pRT commented 21 years ago

From @nwc10

I think that the appended patch to t/op/int.t will fail on netbsd until we get this problem fixed\, and pass everywhere else. However\, it's a lot less obscure a failure than something in the bowels of pack.

On Sat\, Aug 23\, 2003 at 10​:25​:37PM +0200\, alian wrote​:

I really don't know what is it. Only one thing​: this is something between @​19201 and @​19254. Period of configure/perl.h update for modfl & co.

Could you try the attached patch\, which should back out the change to pp.c only\, and see if that fixes it.

Nicholas Clark

Inline Patch ```diff --- t/op/int.t.orig 2002-07-20 00:50:10.000000000 +0100 +++ t/op/int.t 2003-08-24 15:30:13.000000000 +0100 @@ -5,7 +5,7 @@ BEGIN { @INC = '../lib'; } -print "1..14\n"; +print "1..16\n"; # compile time evaluation @@ -96,3 +96,20 @@ if ($y == 4745162525730) { print "not ok 14 # int(279964589018079/59) is $y, not 4745162525730\n" } +$x = 2**53; +$y = int ($x); + +if ($x == $y) { + print "ok 15\n" +} else { + print "not ok 15 # int($x) is $y, not $x\n" +} + +$x = -$x; +$y = int ($x); + +if ($x == $y) { + print "ok 16\n" +} else { + print "not ok 16 # int($x) is $y, not $x\n" +} ```
p5pRT commented 21 years ago

From @nwc10

380-370.patch ```diff --- pp.c#380 Sun Aug 24 14:13:50 2003 +++ pp.c#379 Sun Aug 24 14:15:21 2003 @@ -1,4 +1,4 @@ -//depot/perl/pp.c#380 - edit change 19218 (text) +//depot/perl/pp.c#379 - edit change 19163 (text) /* pp.c * * Copyright (c) 1991-2003, Larry Wall @@ -2891,14 +2891,24 @@ PP(pp_int) SETu(U_V(value)); } else { #if defined(SPARC64_MODF_WORKAROUND) - (void)sparc64_workaround_modf(value, &value); -#elif defined(HAS_MODFL_POW32_BUG) -/* some versions of glibc split (i + d) into (i-1, d+1) for 2^32 <= i < 2^64 */ - NV offset = Perl_modf(value, &value); - (void)Perl_modf(offset, &offset); - value += offset; + (void)sparc64_workaround_modf(value, &value); #else - (void)Perl_modf(value, &value); +# if defined(HAS_MODFL) || defined(LONG_DOUBLE_EQUALS_DOUBLE) +# ifdef HAS_MODFL_POW32_BUG +/* some versions of glibc split (i + d) into (i-1, d+1) for 2^32 <= i < 2^64 */ + { + NV offset = Perl_modf(value, &value); + (void)Perl_modf(offset, &offset); + value += offset; + } +# else + (void)Perl_modf(value, &value); +# endif +# else + double tmp = (double)value; + (void)Perl_modf(tmp, &tmp); + value = (NV)tmp; +# endif #endif SETn(value); } @@ -2907,17 +2917,24 @@ PP(pp_int) if (value > (NV)IV_MIN - 0.5) { SETi(I_V(value)); } else { -#if defined(SPARC64_MODF_WORKAROUND) - (void)sparc64_workaround_modf(-value, &value); -#elif defined(HAS_MODFL_POW32_BUG) +#if defined(HAS_MODFL) || defined(LONG_DOUBLE_EQUALS_DOUBLE) +# ifdef HAS_MODFL_POW32_BUG /* some versions of glibc split (i + d) into (i-1, d+1) for 2^32 <= i < 2^64 */ - NV offset = Perl_modf(-value, &value); - (void)Perl_modf(offset, &offset); - value += offset; -#else + { + NV offset = Perl_modf(-value, &value); + (void)Perl_modf(offset, &offset); + value += offset; + } +# else (void)Perl_modf(-value, &value); +# endif + value = -value; +#else + double tmp = (double)value; + (void)Perl_modf(-tmp, &tmp); + value = -(NV)tmp; #endif - SETn(-value); + SETn(value); } } } ```
p5pRT commented 15 years ago

From @smpeters

On Sun Aug 24 07​:58​:08 2003\, nicholas wrote​:

I think that the appended patch to t/op/int.t will fail on netbsd until we get this problem fixed\, and pass everywhere else. However\, it's a lot less obscure a failure than something in the bowels of pack.

On Sat\, Aug 23\, 2003 at 10​:25​:37PM +0200\, alian wrote​:

I really don't know what is it. Only one thing​: this is something between @​19201 and @​19254. Period of configure/perl.h update for modfl & co.

Could you try the attached patch\, which should back out the change to pp.c only\, and see if that fixes it.

Nicholas Clark

--- t/op/int.t.orig 2002-07-20 00​:50​:10.000000000 +0100 +++ t/op/int.t 2003-08-24 15​:30​:13.000000000 +0100 @​@​ -5\,7 +5\,7 @​@​ BEGIN { @​INC = '../lib'; }

-print "1..14\n"; +print "1..16\n";

# compile time evaluation

@​@​ -96\,3 +96\,20 @​@​ if ($y == 4745162525730) { print "not ok 14 # int(279964589018079/59) is $y\, not 4745162525730\n" }

+$x = 2**53; +$y = int ($x); + +if ($x == $y) { + print "ok 15\n" +} else { + print "not ok 15 # int($x) is $y\, not $x\n" +} + +$x = -$x; +$y = int ($x); + +if ($x == $y) { + print "ok 16\n" +} else { + print "not ok 16 # int($x) is $y\, not $x\n" +}

Six years without a response from the original poster. This bug is stalled.

Steve

p5pRT commented 15 years ago

@smpeters - Status changed from 'open' to 'stalled'

jkeenan commented 4 years ago

From @smpeters

On Sun Aug 24 07​:58​:08 2003, nicholas wrote​:

I think that the appended patch to t/op/int.t will fail on netbsd until we get this problem fixed, and pass everywhere else. However, it's a lot less obscure a failure than something in the bowels of pack. On Sat, Aug 23, 2003 at 10​:25​:37PM +0200, alian wrote​:

I really don't know what is it. Only one thing​: this is something between @​19201 and @​19254. Period of configure/perl.h update for modfl & co.

Could you try the attached patch, which should back out the change to pp.c only, and see if that fixes it. Nicholas Clark --- t/op/int.t.orig 2002-07-20 00​:50​:10.000000000 +0100 +++ t/op/int.t 2003-08-24 15​:30​:13.000000000 +0100 @​@​ -5,7 +5,7 @​@​ BEGIN { @​INC = '../lib'; } -print "1..14\n"; +print "1..16\n";

compile time evaluation

@​@​ -96,3 +96,20 @​@​ if ($y == 4745162525730) { print "not ok 14 # int(279964589018079/59) is $y, not 4745162525730\n" } +$x = 2**53; +$y = int ($x); + +if ($x == $y) {

  • print "ok 15\n" +} else {
  • print "not ok 15 # int($x) is $y, not $x\n" +}
  • +$x = -$x; +$y = int ($x);

  • +if ($x == $y) {

  • print "ok 16\n" +} else {
  • print "not ok 16 # int($x) is $y, not $x\n" +}

Six years without a response from the original poster. This bug is stalled.

Steve

10-1/2 years more without a response. Closing.