develooper Front page | perl.perl5.porters | Postings from January 2001

[ID 20010125.022] Not OK: perl v5.7.0 +DEVEL8530 oni586-linux-64all-ld 2.2.16-22 (UNINSTALLED)

January 25, 2001 09:39
[ID 20010125.022] Not OK: perl v5.7.0 +DEVEL8530 oni586-linux-64all-ld 2.2.16-22 (UNINSTALLED)
Message ID:
This is a build failure report for perl from,
generated with the help of perlbug 1.33 running under perl v5.7.0.

[Please enter your report here]

Just for fun, I tried to compile with -Accflags=-DPERL_Y2KWARN.

This caused quite a fair number of warnings (and at least one
failure where the test didn't like things coming out of stderr)
of the form "Possible Y2K bug: about to append an integer to '19'
at xxx/yyyyyy.t line zzz.". When I looked at the lines, they all
appeared to be of the form C<print "ok $n\n">; presumably, this
happened when $n was 19. (./perl harness bore this out since
such y2k warnings often came just after '18/xx' had been printed.)
Don't know why Perl considered \n to be numeric, though, or where
this came from. Anyway, here are the affected places:

io/open.t line 18
op/magic.t line 14
op/regmesg.t line 133
op/sprintf.t line 56, <DATA> line 221
op/substr.t line 26
pragma/locale.t line 59
lib/1_compile.t line 64
lib/dumper.t line 40
../lib/ line 85 (called from lib/ftmp-tempfile.t)
lib/opcode.t line 89
lib/safe1.t line 42

There was also a y2k warning in ../lib/ line 86, <READ>
line 5; this appears to be due to the concatenation C<"GEN" . $genseq++>.

But here's the killer: pragma/warnings.t gave this output:

# pp_hot.c [pp_concat]
use warnings 'y2k';
use Config;
    unless ($Config{ccflags} =~ /Y2KWARN/) {
        print "SKIPPED\n# perl not built with -DPERL_Y2KWARN";
        exit 0;
my $x;
my $yy = 78;
$x     = "19$yy\n";
$x     = "19" . $yy . "\n";
$x     = "319$yy\n";
$x     = "319" . $yy . "\n";
no warnings 'y2k';
$x     = "19$yy\n";
$x     = "19" . $yy . "\n";
Possible Y2K bug: about to append an integer to '19' at - line 12.
Possible Y2K bug: about to append an integer to '19' at - line 13.

FAILED at test 315

So the test that was supposed to test for Y2K warnings, failed!

After having a look at pp_concat, I must confess I'm not quite
sure how it's supposed to work, anyway. Here's the relevant bit:

#if defined(PERL_Y2KWARN)
    if ((SvIOK(right) || SvNOK(right)) && ckWARN(WARN_Y2K)) {
        STRLEN n;
        char *s = SvPV(TARG,n);
        if (n >= 2 && s[n-2] == '1' && s[n-1] == '9'
            && (n == 2 || !isDIGIT(s[n-3])))
            Perl_warner(aTHX_ WARN_Y2K, "Possible Y2K bug: %s",
                        "about to append an integer to '19'");

However, it comes *after* sv_catsv(TARG, right) (or equivalent)
has been called. As I understand it, this bit of code makes C<s>
point to the string part of TARG, and C<n> gives the length of
that string. Then the test is whether the last two characters
of TARG are '19', not preceded by a digit, and whether C<right>
is an integer (IOK) or a floating-point number (NOK) (which would
mean that the warning is not quite correct, since it could be
a floating-point number rather than an integer).

But if this code comes after the catsv, won't TARG be the
result of the concatenation? This would appear to me to mean that
the error could only come if a number is appended to something
and the result ends in 19, not preceded by a digit -- for example,
C<'ok ' . 19>.

Even so, consider the following:

./perl -Ilib -MDevel::Peek -e '$a=19;Dump($a);$b="ok ".$a;Dump($b);$c=78;Dump($c);$d="19".$c;Dump($d)'
SV = IV(0x815b57c) at 0x8158edc
  REFCNT = 1
  IV = 19
SV = PV(0x8150140) at 0x815c0b8
  REFCNT = 1
  PV = 0x8157d08 "ok 19"\0
  CUR = 5
  LEN = 6
SV = IV(0x815b57c) at 0x815f13c
  REFCNT = 1
  IV = 78
SV = PV(0x8150104) at 0x815c3c4
  REFCNT = 1
  PV = 0x8157ff8 "1978"\0
  CUR = 4
  LEN = 5

This is run with the Perl I just built. It shows that $a is IOK,
yet when it is added to "ok " to give a string of length 5, no
warning is produced even though s[3] == '1' and s[4] == '9', and
s[2] is not a digit. And in the second test, showing the real Y2K
problem with '19' . '78', no warning is produced, either, even though
C<right> is again IOK.

When I tested with ./perl harness in ./t, I got the following:

Failed Test       Status Wstat Total Fail  Failed  List of Failed
lib/open3.t               29  7424    22    5  22.73%  18-22
op/magic.t                 9  2304    35   17  48.57%  19-35
pragma/constant.t                     82    1   1.22%  36
pragma/locale.t                      116    1   0.86%  111
pragma/warnings.t                    421    1   0.24%  315
9 tests and 80 subtests skipped.
Failed 5/279 test scripts, 98.21% okay. 25/20883 subtests failed, 99.88% okay.

And warnings during these tests:

io/open.t line 18
op/magic.t line 14 (which caused the test to die and all subsequent
                    subtest to fail)
op/regmesg.t line 133
op/sprintf.t line 56, <DATA> line 221
op/substr.t line 26
pragma/locale.t line 59
lib/1_compile.t line 64
lib/dumper.t line 40
../lib/ line 85 in lib/ftmp-tempfile test 19
lib/opcode.t line 89
../lib/ line 86, <READ> line 5 in lib/open3 test 18(?);
  this apparently caused the rest of the tests to fail:
  lib/open3...........ok 17/22Possible Y2K bug: about to append an integer to '19' at ../lib/ line 86, <READ> line 5.
          Test returned status 29 (wstat 7424, 0x1d00)
  DIED. FAILED tests 18-22
          Failed 5/22 tests, 77.27% okay
lib/safe1.t line 42

Which are the same places that `make test` gave warnings, but I
thought I'd mention them again because of the two die problems.

And pragma/constant failed test 36 (1/82) (this had also occurred
during `make test`, but I hadn't noticed it at first). And
pragma/locale.t failed test 111 both times (the Red Hat fa_IR
thingy). pragma/constant test 36 appears to be this:

test 36, @warnings == 0, join "\n", "unexpected warning", @warnings;

And the reason is (running './perl pragma/constant.t'):

ok 33
ok 34
ok 35
not ok 36
# 36 : unexpected warning
# 36 : Possible Y2K bug: about to append an integer to '19' at pragma/constant.t line 31.
ok 37
ok 38

With pragma/constant.t being C<print "ok $num\n";>. So more
of the same.

Other than that, things appear to work fine :-)


[Please do not change anything below this line]
Site configuration information for perl v5.7.0:

Configured by pne at Thu Jan 25 14:19:55 GMT 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration:
    osname=linux, osvers=2.2.16-22, archname=i586-linux-64all-ld
    uname='linux penderel 2.2.16-22 #1 tue aug 22 16:16:55 edt 2000 i586 unknown '
    config_args='-Accflags=-DPERL_Y2KWARN -Dcc=gcc -Dprefix=/home/pne -Uinstallusrbinperl -Dusedevel -Duse64bitall -Duselongdouble -Doptimize=-g -Uusemymalloc'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=define uselongdouble=define
    cc='gcc', ccflags ='-DPERL_Y2KWARN -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    cppflags='-DPERL_Y2KWARN -DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.0)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lgdbm -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.7.0:

Environment for perl v5.7.0:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)
    SHELL=/bin/sh Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About