Skip to content

Conversation

@henryiii
Copy link
Member

Important fix, requiring 2.3.1.

Nicer error message and avoids catching a C++ error if possible.

@github-actions github-actions bot added the needs changelog Might need a changelog entry label Feb 15, 2022
Comment on lines +201 to +203
auto cpp_values = py::cast<std::vector<unsigned>>(values);
py::gil_scoped_release release;
return bh::algorithm::project(self,
py::cast<std::vector<unsigned>>(values));
return bh::algorithm::project(self, cpp_values);
Copy link
Member Author

@henryiii henryiii Feb 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix, I was running Python API via py::cast inside a GIL-less section! I'm also now catching this error before it happens in Python, which should make limited EH environments like pyodide happier. Plus we get a nicer error message & error class.

@henryiii henryiii merged commit f9327bd into develop Feb 15, 2022
@henryiii henryiii deleted the henryiii/fix/segfaultproj branch February 15, 2022 18:35
@henryiii henryiii removed the needs changelog Might need a changelog entry label Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants