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

Re: [perl #66584] Devel::Peek fails 2 tests when perl is built with NO_PERL_PRESERVE_IVUV

Thread Previous | Thread Next
From:
Brian Fraser
Date:
August 31, 2013 05:06
Subject:
Re: [perl #66584] Devel::Peek fails 2 tests when perl is built with NO_PERL_PRESERVE_IVUV
Message ID:
CA+nL+naDUj2kKtF2JT=wuPLGKW9wNCAyA6FE8etg4ehUOmD37A@mail.gmail.com
On Sun, Dec 11, 2011 at 3:27 PM, James E Keenan via RT <
perlbug-followup@perl.org> wrote:

> On Sun Jun 14 18:20:59 2009, sisyphus1@optusnet.com.au wrote:
> >
> > Not sure of the approved way of building perl with
> > NO_PERL_PRESERVE_IVUV on
> > Win32.
> > I simply placed a '#define NO_PERL_PRESERVE_IVUV' at the beginning of
> > perl.h.
> >
> > Tests 21 and 23 of ext/Devel/Peek/t/Peek.t are the only tests that
> > failed
> > during the running of the test suite. The output I get for those 2
> > tests is
> > given below.
> >
> > Not sure if the garbage (for want of a better word) in the "expected"
> > output
> > is part of the failure, but I note that the "got" output terminates
> > with:
> >
> > #       REFCNT = 1
> > #       FLAGS = (IOK,NOK,pIOK,pNOK)
> > #       IV = 456
> > #       NV = 456
> > #       PV = 0
> >
> > whereas the "expected" output terminates with:
> >
> > #       REFCNT = 1
> > #       FLAGS = \(IOK,pIOK\)
> > #       IV = 456\Z)/
> >
> > Anyway, here's the full output for those tests:
> > [snip]
>
> It seems to me that there are two, connected issues raised in this ticket.
>
> One is the general problem of how one would build Perl with
> 'NO_PERL_PRESERVE_IVUV' and the circumstances where one would want to do
> that.
>
> The other is any Win32-specific problem, such as getting tests to pass
> once we have figured out how to build with this option.
>
> For the reference of anyone who can address this ticket, here's some
> relevant source code:
>
> from perl.h:
> ###
> #ifndef NO_PERL_PRESERVE_IVUV
> #define PERL_PRESERVE_IVUV      /* We like our integers to stay integers.
> */
> #endif
> ###
>
> ... and this comments precedes several tests in ext/Devel-Peek/t/Peek.t
> ###
> # If perl is built with PERL_PRESERVE_IVUV then maths is done as integers
> # where possible and this scalar will be an IV. If NO_PERL_PRESERVE_IVUV
> then
> # maths is done in floating point always, and this scalar will be an NV.
> # ([NI]) captures the type, referred to by \1 in this regexp and $type for
> # building subsequent regexps.
> ###
>
> Rob, have you had any further experience with this bug since originally
> filing the ticket?
>

It's possible to reproduce this failure by compiling perl like this:
./Configure -des -Dusedevel -Dccflags='-DNO_PERL_PRESERVE_IVUV'

I imagine that building a perl with that option would give you a different
performance profile, at the price of getting possibly questionable behavior.
Coincidentally, I am in the process of reviewing ifdefs like this, and was
writing about this and other undocumented symbols, but I'll leave that for
another mail.

It's not clear to me if Peek.t should be fixed to accommodate perls built
like this. In a sense, we're implicitly saying that this is supporting by
checking if the symbol is defined. But on the other hand, we could treat
this like NO_TAINT_SUPPORT -- the option is there, but we don't guarantee
that the resulting perl will be equally functional.

Thread Previous | 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