Skip Menu |

This queue is for tickets about the Math-Histogram CPAN distribution.

Report information
The Basics
Id: 103035
Status: resolved
Priority: 0/
Queue: Math-Histogram

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.03
Fixed in: (no value)



Subject: Test suite fails since perl 5.21.7
With bleadperl two tests fail when running the test suite: Caught error while trying to reinstantiate axis from hash dump (Missing 'bins' and 'nbins' hash entries at t/210axisdump.t line 27. ). Hash was: $VAR1 = {}; # Tests were run but no plan was declared and done_testing() was not seen. # Looks like your test exited with 255 just after 4. t/210axisdump.t ........ Dubious, test returned 255 (wstat 65280, 0xff00) All 4 subtests passed ... Need 'axises' hash element as an array reference at t/330histodump.t line 16. # Tests were run but no plan was declared and done_testing() was not seen. # Looks like your test exited with 255 just after 1. t/330histodump.t ....... Dubious, test returned 255 (wstat 65280, 0xff00) All 1 subtests passed Tests pass until (including) perl 5.21.6.
On Mon Mar 23 16:39:54 2015, SREZIC wrote: Show quoted text
> With bleadperl two tests fail when running the test suite: > > Caught error while trying to reinstantiate axis from hash dump > (Missing 'bins' and 'nbins' hash entries at t/210axisdump.t line 27. > ). Hash was: > $VAR1 = {}; > # Tests were run but no plan was declared and done_testing() was not > seen. > # Looks like your test exited with 255 just after 4. > t/210axisdump.t ........ > Dubious, test returned 255 (wstat 65280, 0xff00) > All 4 subtests passed > > ... > > Need 'axises' hash element as an array reference at t/330histodump.t > line 16. > # Tests were run but no plan was declared and done_testing() was not > seen. > # Looks like your test exited with 255 just after 1. > t/330histodump.t ....... > Dubious, test returned 255 (wstat 65280, 0xff00) > All 1 subtests passed > > Tests pass until (including) perl 5.21.6.
Starting with perl revision v5.21.6-135-g6d59e61 perl always #includes assert.h, and for non-debugging builds, defines NDEBUG. This means that this code in Histogram.xs: if (MH_AXIS_ISFIXBIN(axis)) { assert( hv_stores(hash, "nbins", newSVuv(MH_AXIS_NBINS(axis))) ); assert( hv_stores(hash, "min", newSVnv(MH_AXIS_MIN(axis))) ); assert( hv_stores(hash, "max", newSVnv(MH_AXIS_MAX(axis))) ); } no longer actually calls hv_stores(). You *could* put: #undef NDEBUG before your: #include "assert.h" but the above code is an abuse of assert(), ideally the expression supplied to assert() shouldn't have side-effects. It also slows down some of the code to perl debugging build speed, since all of the assertions in perl's macros that are normally skipped for non-debug builds will be tested. Ideally you should either test each hv_stores() for failure: if (!hv_stores(hash, "nbins", newSVuv(MH_AXIS_NBINS(axis)))) croak("hv_stores nbins failed"); or define a new macro that behaves the way you want. Tony
Subject: Re: [rt.cpan.org #103035] Test suite fails since perl 5.21.7
Date: Tue, 07 Apr 2015 09:12:05 +0200
To: bug-Math-Histogram [...] rt.cpan.org
From: Steffen Mueller <smueller [...] cpan.org>
Hi Tony, I'm sorry that you had to spend so much effort on debugging my (in this case admittedly very wrong) code just because I didn't get to it in time. On 04/07/2015 04:04 AM, TONYC via RT wrote: Show quoted text
> Starting with perl revision v5.21.6-135-g6d59e61 perl always #includes > assert.h, and for non-debugging builds, defines NDEBUG. > > This means that this code in Histogram.xs: > > if (MH_AXIS_ISFIXBIN(axis)) { > assert( hv_stores(hash, "nbins", newSVuv(MH_AXIS_NBINS(axis))) ); > assert( hv_stores(hash, "min", newSVnv(MH_AXIS_MIN(axis))) ); > assert( hv_stores(hash, "max", newSVnv(MH_AXIS_MAX(axis))) ); > } > > no longer actually calls hv_stores(). > > You *could* put: > > #undef NDEBUG > > before your: > > #include "assert.h" > > but the above code is an abuse of assert(), ideally the expression > supplied to assert() shouldn't have side-effects. > > It also slows down some of the code to perl debugging build speed, > since all of the assertions in perl's macros that are normally skipped > for non-debug builds will be tested. > > Ideally you should either test each hv_stores() for failure: > > if (!hv_stores(hash, "nbins", newSVuv(MH_AXIS_NBINS(axis)))) > croak("hv_stores nbins failed"); > > or define a new macro that behaves the way you want.
Yes, either one of those. If read that code today I'd faceplant. Thank you! --Steffen
Subject: Re: [rt.cpan.org #103035] Test suite fails since perl 5.21.7
Date: Tue, 07 Apr 2015 09:15:38 +0200
To: bug-Math-Histogram [...] rt.cpan.org
From: Steffen Mueller <smueller [...] cpan.org>
On 04/07/2015 04:04 AM, TONYC via RT wrote: Show quoted text
> Starting with perl revision v5.21.6-135-g6d59e61 perl always #includes > assert.h, and for non-debugging builds, defines NDEBUG.
I do also want to say that that's a bit dodgy and I'd expect more trouble to surface from it. --Steffen
Thank you! Fixed in release 1.04.