Skip to content

Segfault when running tests with PyNN #3638

@JCGoran

Description

@JCGoran

Context

https://github.com/NeuralEnsemble/PyNN/ uses NEURON. It is also part of the EBRAINS 2.0 software distribution (ESD).

NOTE: in order to make NEURON 9 part of the next ESD release, this needs to be resolved by 17-10-2025.

Overview of the issue

I've added fixes for NEURON 9 compatibility in PyNN here: NeuralEnsemble/PyNN#822
Unfortunately, the test here segfaults: https://github.com/neuronsimulator/PyNN/blob/766233794eef65f79de52b368d780becd393c224/test/system/scenarios/test_connectors.py#L51

Note that running just that test works, so I'm guessing NEURON does not clean-up or set-up certain objects properly since the tests all share the same NEURON instance.

Expected result/behavior

No segfault.

NEURON setup

  • Version: 9.0.0 and newer
  • Installation method: any

Minimal working example - MWE

git clone --branch jelic/neuron_9_compat https://github.com/neuronsimulator/PyNN
cd PyNN
python3 -m venv env && source env/bin/activate
pip install pytest matplotlib 'neuron>=9' .
python -m pytest -vvv

Output:

test/system/scenarios/test_connectors.py::test_fixed_number_pre_no_replacement[neuron] Fatal Python error: Segmentation fault

Current thread 0x000075e3a35f9080 (most recent call first):
  File "PyNN/pyNN/neuron/simulator.py", line 266 in reset
  File "PyNN/pyNN/neuron/simulator.py", line 257 in clear
  File "PyNN/pyNN/neuron/control.py", line 44 in setup
  File "PyNN/test/system/scenarios/test_connectors.py", line 52 in test_fixed_number_pre_no_replacement

Compiling NEURON with Debug type gives the source of the problem the following mod file:

in _net_init (_pnt=0x2dbb350, _args=0x2dbb550, _lflag=0) at PyNN/pyNN/neuron/nmodl/x86_64/tsodyksmarkram.cpp:316
316      t_last = t ;

which comes from here: https://github.com/neuronsimulator/PyNN/blob/766233794eef65f79de52b368d780becd393c224/pyNN/neuron/nmodl/tsodyksmarkram.mod#L37-L40

Metadata

Metadata

Assignees

Labels

bugreverse dependenciesIssue/PR involving NEURON's reverse dependencies (software which depends on NEURON)time-sensitiveIssue/PR that is time sensitive (has deadline, etc.)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions