Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nerdstrike opened this issue Apr 1, 2022 · 0 comments
Open

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

nerdstrike opened this issue Apr 1, 2022 · 0 comments
Labels

Comments

@nerdstrike
Copy link
Contributor

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.

@nerdstrike nerdstrike added the bug label Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant