Skip to content

Adjust PDL::Primitive::stats use to avoid issues in 2.068+ #801

@nerdstrike

Description

@nerdstrike

A segfault was created in PDL 2.069-2.077 because we are calling the stats() function on empty arrays. A memory allocation change in PDL now causes an error where previously it was working by happy accident. As of PDL 2.078 an exception will be thrown if we attempt this behaviour:

Error in medover:cannot process empty ndarray at ../../blib/lib/PDL/PP.pm line 1065

and this can be seen in t/60-autoqc-results-sequence_error.t where calls to reverse_average_percent_error() invoke the PDL stats function. Compatibility with future versions can be ensured by trapping assignment of undefs into pdl(), as in any case the result would be 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions