#337 rangeb() broken for 64bit index support on 32bit perl

critical
closed-fixed
None
9
2015-01-30
2013-08-11
No

For the current PDL-2.006_04 release, rangeb() has a bug
on 32bit perls with the new 64bit index code. I think
the problem is from something being 32bits and needing to
be 64bits (or vice versa). The problem doesn't show for
64bit perls.

Here is a simple test program that fails on 32bit SPP
using the new code but passes using the PDL-2.006 code
without 64bit index support.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#!/usr/bin/perl
#
use PDL;
PDL::Core::set_debugging(1);

$source = pdl q[ [0 0 1 0 1 1]
                 [0 0 0 0 1 1]
                 [0 1 0 0 1 1]
                 [0 0 0 0 1 1]
                 [1 0 0 0 1 1]
                 [0 0 0 0 1 1] ];
$index = zeros(2);
$size = 8 * ones(2);
$bound = 'e';

$aa = $source->rangeb($index,$size,$bound);
print "$aa\n";

and the result for 64bit perls is:

 perl rangeb.t

[
 [0 0 1 0 1 1 1 1]
 [0 0 0 0 1 1 1 1]
 [0 1 0 0 1 1 1 1]
 [0 0 0 0 1 1 1 1]
 [1 0 0 0 1 1 1 1]
 [0 0 0 0 1 1 1 1]
 [0 0 0 0 1 1 1 1]
 [0 0 0 0 1 1 1 1]
]

but for 32bit SPP and the same version of PDL:

perl -Mblib rangeb.t
[0 0 1 0 1 1 1 1]

I'm attaching the rangeb.t test program and the output
from running it on SPP 32bit with PDL-2.006 (pdl32-range-debug.log),
PDL-2.006_04 (pdl64-range-debug.log), and with cygwin perl 64bit
(cyg64-range-debug.log).

4 Attachments

Discussion

  • Chris Marshall

    Chris Marshall - 2013-08-11
     
  • Chris Marshall

    Chris Marshall - 2013-09-14
    • status: open --> pending-fixed
    • assigned_to: Craig DeForest
     
  • Chris Marshall

    Chris Marshall - 2013-09-14
    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.