Skip to content

Python 3.11 wheels + fudge RxD test teardown#2071

Merged
pramodk merged 5 commits into
masterfrom
olupton/fudge-rxd-teardown-macos
Nov 11, 2022
Merged

Python 3.11 wheels + fudge RxD test teardown#2071
pramodk merged 5 commits into
masterfrom
olupton/fudge-rxd-teardown-macos

Conversation

@olupton

@olupton olupton commented Nov 8, 2022

Copy link
Copy Markdown
Collaborator

Hopefully fixing nrn-build-ci failures with macOS, Python 3.11 and the latest pytest/pytest-cov.
It seems that the weakref magic in RxD teardown is fragile and breaks with the latest versions.
I did not immediately find any documented change in behaviour in 3.11, so I assume this was never guaranteed to work.
Also start building 3.11 wheels in this repository.

Example failures:

Example Python traceback of the error:

test/rxd/test_parameter_reaction.py .Fatal Python error: Segmentation fault

Current thread 0x000000010d460600 (most recent call first):
  File "/Users/olupton/build/nrn-prime/build/lib/python/neuron/rxd/section1d.py", line 42 in __setitem__
  File "/Users/olupton/build/nrn-prime/build/lib/python/neuron/rxd/section1d.py", line 229 in _delete
  File "/Users/olupton/build/nrn-prime/build/lib/python/neuron/rxd/species.py", line 1865 in __del__
  File "/Users/olupton/build/nrn-prime/build/test/rxdmod_tests/rxd_mpi_tests/test/rxd/conftest.py", line 63 in neuron_nosave_instance
  File "/Users/olupton/build/nrn-prime/nrn_venv/lib/python3.11/site-packages/_pytest/fixtures.py", line 916 in _teardown_yield_fixture
  File "/Users/olupton/build/nrn-prime/nrn_venv/lib/python3.11/site-packages/_pytest/fixtures.py", line 1029 in finish
  File "/Users/olupton/build/nrn-prime/nrn_venv/lib/python3.11/site-packages/_pytest/fixtures.py", line 684 in <lambda>
  File "/Users/olupton/build/nrn-prime/nrn_venv/lib/python3.11/site-packages/_pytest/runner.py", line 523 in teardown_exact
  File "/Users/olupton/build/nrn-prime/nrn_venv/lib/python3.11/site-packages/_pytest/runner.py", line 180 in pytest_runtest_teardown
...

Example C++ traceback of the error:

=================================================================
==9884==ERROR: AddressSanitizer: SEGV on unknown address 0x00010b3145db (pc 0x000125f081b8 bp 0x7ff7b6308810 sp 0x7ff7b6308800 T0)
==9884==The signal is caused by a READ memory access.
    #0 0x125f081b8 in o2sec(Object*) nrnpy_nrn.cpp:473
    #1 0x125c3d48d in append(void*) seclist.cpp:60
    #2 0x125cee275 in hoc_call_ob_proc(Object*, Symbol*, int) hoc_oop.cpp:680
    #3 0x125cf03cb in hoc_object_component() hoc_oop.cpp:1116
    #4 0x125ef05d9 in component(PyHocObject*) nrnpy_hoc.cpp:454
    #5 0x125eef45e in fcall(void*, void*) nrnpy_hoc.cpp:647
    #6 0x125b803b8 in OcJump::fpycall(void* (*)(void*, void*), void*, void*) ocjump.cpp:138
    #7 0x125eee0cf in hocobj_call(PyHocObject*, _object*, _object*) nrnpy_hoc.cpp:747
    #8 0x10b1cd885 in _PyObject_MakeTpCall+0x7d (Python:x86_64+0x86885)

Run with this branch but no Azure URL for the wheels (oops):

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

@azure-pipelines

Copy link
Copy Markdown

✔️ 741804251bd8267a59480b8fda69e60fbbf76735 -> Azure artifacts URL

@olupton olupton force-pushed the olupton/fudge-rxd-teardown-macos branch from 7418042 to a299c79 Compare November 9, 2022 07:13
@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #83371 (:no_entry:) have been uploaded here!

Status and direct links:

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #83373 (:no_entry:) have been uploaded here!

Status and direct links:

@azure-pipelines

Copy link
Copy Markdown

✔️ 89bdef2 -> Azure artifacts URL

@olupton

olupton commented Nov 9, 2022

Copy link
Copy Markdown
Collaborator Author

@olupton olupton requested a review from alexsavulescu November 9, 2022 09:28

@alexsavulescu alexsavulescu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@olupton olupton changed the title Fudge RxD test teardown Python 3.11 wheels + fudge RxD test teardown Nov 9, 2022
@olupton

olupton commented Nov 9, 2022

Copy link
Copy Markdown
Collaborator Author

@ramcdougal @adamjhn are you OK with this workaround? Without it, the RxD tests do not pass with Python 3.11, at least in the macOS/HomeBrew setups that are included in the https://github.com/neuronsimulator/nrn-build-ci pipelines.

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #83704 (:no_entry:) have been uploaded here!

Status and direct links:

@bbpbuildbot

Copy link
Copy Markdown
Collaborator

Logfiles from GitLab pipeline #83718 (:white_check_mark:) have been uploaded here!

Status and direct links:

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #2071 (a88537c) into master (cccadab) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2071   +/-   ##
=======================================
  Coverage   48.85%   48.85%           
=======================================
  Files         521      521           
  Lines      115995   115995           
=======================================
  Hits        56675    56675           
  Misses      59320    59320           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@azure-pipelines

Copy link
Copy Markdown

✔️ a88537c -> Azure artifacts URL

@adamjhn adamjhn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This workaround looks good. I am curious why garbage collection became a problem, maybe something to do with the SectionList we're using to keep track of where species are defined.

@pramodk

pramodk commented Nov 11, 2022

Copy link
Copy Markdown
Member

thanks, @adamjhn for the review! I will go ahead with the merge and get other CIs going!

@olupton : did you check this with Python 3.11 on Linux? If it's reproducible on Linux, maybe Adam can see what's specific things involved in rxd part.

@pramodk pramodk merged commit e9f8d45 into master Nov 11, 2022
@pramodk pramodk deleted the olupton/fudge-rxd-teardown-macos branch November 11, 2022 15:11
alexsavulescu pushed a commit that referenced this pull request Dec 8, 2022
* fudge RxD test teardown for python 3.11 (disable garbage collection)
* build Python 3.11 wheels.
* latest numpy for latest python
alexsavulescu pushed a commit that referenced this pull request Dec 15, 2022
* fudge RxD test teardown for python 3.11 (disable garbage collection)
* build Python 3.11 wheels.
* latest numpy for latest python
alexsavulescu pushed a commit that referenced this pull request Dec 15, 2022
* fudge RxD test teardown for python 3.11 (disable garbage collection)
* build Python 3.11 wheels.
* latest numpy for latest python
@alexsavulescu alexsavulescu mentioned this pull request Dec 15, 2022
25 tasks
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.

6 participants