[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [ID 20020504.002] 1 == 1 but 0 != 0



On Sat, May 04, 2002 at 02:35:31AM -0500, Ben Winslow wrote:
> This is a bug report for perl from rain@bluecherry.net,
> generated with the help of perlbug 1.33 running under perl v5.6.1.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> I'll keep it short and sweet:
> 
> ----8<----snip----8<----
> rain@hmm:/tmp$ perl -e 'print((1 == 1) . "\n");'
> 1
> rain@hmm:/tmp$ perl -e 'print((0 == 0) . "\n");'

perl5.6.1 -e 'print((0 == 0) . "\n");'
1

Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
    osname=linux, osvers=2.2.13, archname=arm-linux
    uname='linux medusa 2.2.13 #334 wed dec 29 04:49:54 gmt 1999 armv3l unknown '
    config_args='-Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=arm-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.6.1 -Darchlib=/usr/lib/perl/5.6.1 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.6.1 -Dsitearch=/usr/local/lib/perl/5.6.1 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Dotherlibdirs=/usr/lib/perl5/5.6:/usr/lib/perl5/5.005 -Duseshrplib -Dlibperl=libperl.so.5.6.1 -Dd_dosuid -Doptimize=-O1 -des'
    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=undef use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O1',
    cppflags='-DDEBIAN -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.4 20010604 (Debian prerelease)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    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=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lgdbm -ldbm -ldb -ldl -lm -lc -lcrypt
    perllibs=-ldl -lm -lc -lcrypt
    libc=/lib/libc-2.2.3.so, so=so, useshrplib=true, libperl=libperl.so.5.6.1
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at Jun 24 2001 04:22:44
  @INC:
    /usr/local/lib/perl/5.6.1
    /usr/local/share/perl/5.6.1
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.6.1
    /usr/share/perl/5.6.1
    /usr/local/lib/site_perl/arm-linux
    /usr/local/lib/site_perl
    /usr/lib/perl5/5.6
    /usr/lib/perl5/5.005/arm-linux
    /usr/lib/perl5/5.005
    .

> rain@hmm:/tmp$
> ----8<----snip----8<----
> 
> I put in the appropriate data below since I had to run perlbug on
> another host (it failed to run on the problematic host due to the
> bug.)
> 
> Other possibly relevant information:
> Linux version 2.4.18-rmk1-tux1 (root@halcyon) (gcc version 2.95.3
> 20010315 (release)) #30 Tue Mar 5 21:22:35 CST 2002
> 
> rain@hmm:~$ perl -e 'print((0 eq 0) . "\n");'
> 1
> 
> I assumed the system library was to blame at first, but I was
> unable to get strto<f,d,l> to misbehave (I haven't gone troving
> through perl's source to see what means it uses to convert the
> numbers...).

I still doubt it's a perl bug. Almost everything I've ever hit on arm has
either been K StrongARM bugs (I have a K) or gcc optimiser bugs.

I've just run that perl -V on:

Linux Bagpuss.unfortu.net 2.4.17-rmk1 #3 Thu Jan 10 14:16:59 GMT 2002 armv4l unknown

Do you have NWFPE or FAST_FPE? Having just RTFM it seems that FAST_FPE is now
full precision, but I've not tried it since it wasn't full precision, and
therefore definitely wasn't suitable for perl. The result I gave above was
NWFPE.

perl will be using strtoul (this section of toke.c):

        if (!floatit) {
            IV iv;
            UV uv;
            errno = 0;
            if (*PL_tokenbuf == '-')
                iv = Strtol(PL_tokenbuf, (char**)NULL, 10);
            else
                uv = Strtoul(PL_tokenbuf, (char**)NULL, 10);
            if (errno)
                floatit = TRUE; /* Probably just too large. */
            else if (*PL_tokenbuf == '-')
                sv_setiv(sv, iv);
            else if (uv <= IV_MAX)
                sv_setiv(sv, uv); /* Prefer IVs over UVs. */
            else
                sv_setuv(sv, uv);
        }

in 5.6.1. [All this stuff changes in 5.8]

> Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
>   Platform:
>     osname=linux, osvers=2.2.19, archname=arm-linux
>     uname='linux europa 2.2.19 #1 sun apr 15 23:02:03 bst 2001 armv4l
> unknown '

I forget what europa is, but if things are so bad that 0 != 0, then I
can't believe that the regression test won't pass, or for that matter the
build would even complete.

I suspect it's some combination of things on your particular ARM system
causing it, but that's not to say there is no problem, as many other people
might be about to reach the same combination of things and hence hit this.

Nicholas Clark
-- 
Even better than the real thing:	http://nms-cgi.sourceforge.net/


-- 
To UNSUBSCRIBE, email to debian-arm-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: