fix(hardware): open bpod without a pybpod workspace (GC segfault) - #72
Merged
Conversation
Opening the collection's bpod with a pybpod workspace_path (the session folder) makes pybpodapi keep a persistent Session; a task that builds a new StateMachine every trial then segfaults during garbage collection on real hardware (the crash is in StateMachine.__init__ under GC). The pre-#63 device-collection path never set a workspace - workspace_path=None ran clean on the rigs - so setting it when bpod opening moved into TaskProcess was the regression. Open bpod without a workspace, matching the known-good behaviour. Sim uses SimBpod so this only manifests on a real Bpod; validate on-rig via clean plot/camera shutdown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Opening the device-collection's bpod with a pybpod
workspace_path(the session folder) makes pybpodapi keep a persistentSession. A task that builds a newStateMachineevery trial then segfaults during garbage collection on real hardware — the fault log shows the crash inStateMachine.__init__under GC.Regression: the pre-#63 device-collection path opened bpod with
workspace_path=Noneand ran clean on the rigs (msw-core 0.27.1). When bpod opening moved intoTaskProcess(#63), I "restored" the oldconnect_bpodworkspace — but the collection path never set it, so that was the regression. This reverts to opening bpod without a workspace.Root cause confirmed by version bisect on the rig: 0.27.1 (workspace=None) runs clean; 0.27.2+ (workspace set) crashes; workspace is the only pybpod-relevant diff between them.
Validation: sim uses
SimBpod, so this never manifests under--simulate(confirmed — bench runs don't crash). It only bites a real Bpod over a full session. On-rig validation is via clean plot-window + camera-acquisition shutdown (the orphaning was caused by the mid-session crash skipping cleanup). Full suite + device tests green;set_workspaceretained (unused) with its unit tests.