#236 pdl() constructor crashes perl for mixed ref/piddle args

critical
closed-fixed
core (120)
9
2011-03-27
2010-06-05
Chris Marshall
No

$c[0][0]=pdl(0,4,2,1);
$c[1][0]=pdl(0,0,1,1);
$c[2][0]=pdl(0,0,0,1);
$c[0][1]=pdl(0,0,3,1);
$c[1][1]=pdl(0,0,2,1);
$c[2][1]=pdl(5,1,1,1);
$d = pdl(@c);

Causes a crash in PDL-2.4.6_008. A preliminary look shows
that the crash happens in the pdl_avref routine. This problem
was reported by Jim Magnuson on the perldl mailing list.

Thanks, Jim!

Discussion

1 2 3 4 > >> (Page 1 of 4)
  • Chris Marshall
    Chris Marshall
    2010-06-06

    • priority: 9 --> 5
     
  • Chris Marshall
    Chris Marshall
    2010-06-06

    It looks like a documentation bug, first. Then, one should
    not get a core dump from mixed arg inputs. Eventually,
    it would be good to handle the more general input case.

     
  • Chris Marshall
    Chris Marshall
    2010-08-01

    This is the highest priority outstanding PDL bug to
    be resolved before a PDL-2.4.7 release is made.

     
  • Chris Marshall
    Chris Marshall
    2010-08-01

    • milestone: --> critical
    • summary: pdl() constructor crashes for mixed array ref/piddle args --> pdl() constructor crashes perl for mixed ref/piddle args
    • priority: 5 --> 9
     
  • Chris Marshall
    Chris Marshall
    2010-08-01

    • assigned_to: nobody --> zowie
     
  • Chris Marshall
    Chris Marshall
    2010-08-10

    • priority: 9 --> 3
    • status: open --> open-postponed
     
  • Chris Marshall
    Chris Marshall
    2010-08-10

    The bug reported here was more extensive than originally
    thought. I've marked this bug postponed as the final bit
    of triage in preparation for our PDL-2.4.7 release. The
    priority has also been lowered accordingly to reflect the
    re-prioritization of this ticket w.r.t. the PDL-2.4.7 release.

     
  • Chris Marshall
    Chris Marshall
    2010-09-28

    With the latest git, the core.t no longer crashes perl.
    However, it does not pass all in t/core.t:

    not ok 25 - Piddlifing two piddles catenates them and pads to length
    # Failed test 'Piddlifing two piddles catenates them and pads to length'
    # at core.t line 118.
    not ok 27 - Can catenate mixed-dim piddles: hairy case
    # Failed test 'Can catenate mixed-dim piddles: hairy case'
    # at core.t line 127.
    not ok 28 - undefval works for padding
    # Failed test 'undefval works for padding'
    # at core.t line 133.

    If I replace the ok all() tests with ok all(tapprox())) equivalent
    then all tests pass execpt for the last. In the perldl shell, here
    are the values created by the constructor for the 3 failing tests:

    pdl> $a = pdl( zeroes(5), ones(3) );

    pdl> p $a

    [
    [ 0 0 0 0 0]
    [ 1 1 1 1.0981569e-300 1.821236e-296]
    ]

    pdl> $c = pdl [1], pdl[2,3,4], pdl[5];

    pdl:/cygdrive/f/chm/pdl/git/pdl/t> p $c

    [
    [
    [1 0 0]
    [0 0 0]
    ]
    [
    [ 2 3 4]
    [ 5 0 1.8321365e-296]
    ]
    ]

    pdl> do { local($PDL::undefval) = 99; $c = pdl [1], pdl[2,3,4], pdl[5]; }

    pdl> p $c

    [
    [
    [ 1 99 99]
    [99 99 99]
    ]
    [
    [ 2 3 4]
    [ 5 99 1.820088e-296]
    ]
    ]

    I'm not sure why the value for zero is not identically zero
    but clearly, the answer is correct withing floating point
    tolerances so it may be some additional conversion or
    type coercion that is taking place.

    In the third test, the last value is not being converted to
    the 99 undefval.

     
  • Chris Marshall
    Chris Marshall
    2010-10-05

    The CPAN Testers reports from the PDL-2.4.7_002 developers
    release show failures for subtests 25, 27-28 on all platforms....
    No crashes though, as far as I can tell.

     
  • Chris Marshall
    Chris Marshall
    2010-10-07

    Here is an odd datum: I just tried running the latest t/core.t
    using a PDL-2.4.7_001 install and it passes. Running the
    test with perl -Mblib t/core.t fails in the same way as other
    platforms. I don't see anything in the git log that could
    suggest why it worked..... I'll have to try it out on a clean
    install.

     
1 2 3 4 > >> (Page 1 of 4)