NET_RECEIVE INITIAL not vectorized translation needs set_globals_from_prop#3640
Conversation
|
✔️ f0524bb -> Azure artifacts URL |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3640 +/- ##
=======================================
Coverage 68.55% 68.55%
=======================================
Files 686 686
Lines 116791 116791
=======================================
+ Hits 80065 80069 +4
+ Misses 36726 36722 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
✔️ f0524bb -> artifacts URL |
|
Would be useful to add a test, like the most minimal mod file imaginable (does this work, or do we need something else?): and then a corresponding minimal Python script that runs it (I see most mod file tests are in https://github.com/neuronsimulator/nrn/tree/master/test/hoctests, and the Python/HOC scripts in https://github.com/neuronsimulator/nrn/tree/master/test/hoctests/tests, and since we glob files, no CMake changes are necessary), but that would still trigger the segfault, just to make sure it works as intended. |
I agree and will do so. |
|
|
✔️ 13ac83b -> Azure artifacts URL |
|
✔️ 13ac83b -> artifacts URL |
|
The test fails on master with: Shouldn't it trigger a segfault? |
That is a puzzle. It does on my machine with master Are you sure that netrec_init.mod was translated by the master version of nocmodl? But if translated by this pr version it should have succeeded instead of failing at |
Pretty sure, yes. I started from a fresh project, did
In general, you can pass a regex pattern to |
|
I believe your test workflow is valid. In my case from a fresh clone The puzzle is that you do not get a segfault, however the assertion fails. Ie. is not a segfault at because _iml happens to be a valid number and _ml happens to also be a valid address your machine when _net_init is called (albeit on your machine the evaluation of nri.foo is wrong and hence the assertion failure). I wonder if you would get a segfault if there were several instances of NetRecInit |
|
Okay this is once again related to build flags; by default NEURON uses
I don't really understand why the behavior is different; is it possible to come up with a test that will segfault on both? |
Probably, but it might be tricky since the segfault depends on having a pointer that points to invalid memory and std::vector that underlies the range variable foo may be valid for the value of and I suppose the VERBATIM should have some version conditionals. |
|
To answer my own question, I can actually trigger the segfault also with which will trigger the segfault: (gdb) p _ml->fpfield<1>(_iml)
Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
neuron::cache::MechanismRange<2ul, 3ul>::data_array<1, 1> (this=0x7fffffffc910, instance=1)
at build/include/neuron/cache/mechanism_range.hpp:101
101 return std::next(m_data_ptrs[variable], array_size * (m_data_offset + instance));
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwind-on-signal on".
Evaluation of the expression containing the function
(neuron::cache::MechanismRange<2ul, 3ul>::fpfield<1>(unsigned long)) will be abandoned.
When the function is done executing, GDB will silently stop.The use of macros makes the debugging a bit annoying, but in any case, this PR fixes the UB, so we can proceed. |



Closes #3638
Actually, it is needed only if the NET_RECEIVE INITIAL block references a RANGE variable.