-
Notifications
You must be signed in to change notification settings - Fork 370
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
Fix access of first element of an empty vector in pynestkernel #2162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I suggest a quick merge as this solves a real problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a tiny typo.
@niltonlk The failure is curious and likely related to using multiple test runners (if several tests write to files of the same name, we will get into trouble). Could you for now change nest-simulator/testsuite/do_tests.sh Line 102 in 12a897a
nest-simulator/testsuite/do_tests.sh Line 473 in 12a897a
|
following request by @heplesser as a possible cause for the failure in one of the matrix jobs (several tests write to file of the same name)
I had another look at the code and am certain that nothing went wrong in the past, because for an empty memcpy(array_data, &vector_ptr.front(), vector_ptr.size() * sizeof(vector_value_t)); would not have copied anything. But it is clearly incorrect to request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good now.
This PR fix out of bound access in pynestkernel, reported in #2101.
With this fix, the two pynest examples (recording_demo.py and balancedneuron.py) reported in #2101 now succeed.