develooper Front page | perl.perl5.porters | Postings from May 2013

[perl #118159] SvTRUE changed behavior in 5.18

Thread Next
From:
Greg Lindahl
Date:
May 25, 2013 00:27
Subject:
[perl #118159] SvTRUE changed behavior in 5.18
Message ID:
rt-3.6.HEAD-2650-1369428172-861.118159-75-0@perl.org
# New Ticket Created by  Greg Lindahl 
# Please include the string:  [perl #118159]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=118159 >



This is a bug report for perl from lindahl@pbm.com,
generated with the help of perlbug 1.39 running under perl 5.18.0.


-----------------------------------------------------------------
[Please describe your issue here]

In upgrading the blekko search engine backend to Perl 5.18.0, one of
our engineers noticed a change in the behavior in SvTRUE.

$ perl -MScalar::Util=dualvar -le 'print $]; $a = dualvar 1, ""; print $a ? "true" : "false";'
5.008008
false

$ perl -MScalar::Util=dualvar -le 'print $]; $a = dualvar 1, ""; print $a ? "true" : "false";'
5.016000
false

$ perl -MScalar::Util=dualvar -le 'print $]; $a = dualvar 1, ""; print $a ? "true" : "false";'
5.018000
true

Is this intended? We were surprised.

It became visible to us because some Graphics Magik functions return
an XS-generated return value which is typically 1 and '' (indicating 1
image extracted and no error), and our code then uses "if" to test for
an error.

Graphics Magick	doesn't	document this return value and does not	test it.

We don't have an opinion about what behavior is correct here, but it
is surprising that something so fundamental would change.

Thanks!

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=medium
---
Site configuration information for perl 5.18.0:

Configured by keith at Thu May 23 11:25:49 PDT 2013.

Summary of my perl5 (revision 5 version 18 subversion 0) configuration:
   
  Platform:
    osname=linux, osvers=2.6.18-308.16.1.el5, archname=x86_64-linux
    uname='linux robert-desk 2.6.18-308.16.1.el5 #1 smp tue oct 2 22:01:43 edt 2012 x86_64 x86_64 x86_64 gnulinux '
    config_args='-des -Dprefix=/pm/bpm/live/sw/perl/2013-05-23_11.25.48 -Duserelocatableinc -Dprivlib=.../../perl -Darchlib=.../../perl -Dsitelib=.../../perl -Dsitearch=.../../perl -Dman3ext=3pm -Dpager=/usr/bin/less -isr -Accflags=-DPERL_USE_SAFE_PUTENV -Dstartperl=#!/usr/bin/env perl -DEBUGGING=-g -Dusesitecustomize'
    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='cc', ccflags ='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O2 -g',
    cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
    ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-52)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64
    libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
    libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.5'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector'

Locally applied patches:
    

---
@INC for perl 5.18.0:
    /home/keith/blekko/perl
    /home/keith/blekko/perl
    .

---
Environment for perl 5.18.0:
    HOME=/home/keith
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LC_CTYPE=en_US.UTF-8
    LD_LIBRARY_PATH=/home/keith/blekko/lib
    LOGDIR (unset)
    PATH=/home/keith/pkg/inst/bin:/home/keith/blekko/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
    PERL_BADLANG (unset)
    SHELL=/bin/bash


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About