Skip to content

Removed use of the _rec_cache variable in db.py as cached and then re… - #61

Open
pheest wants to merge 1 commit into
epics-modules:masterfrom
pheest:no_cache_records
Open

pheest wants to merge 1 commit into
epics-modules:masterfrom
pheest:no_cache_records

Conversation

@pheest

@pheest pheest commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

See #60

Re-used record instances stored in _rec_cache do not work, as they are invalided by the record instance destructor.

This usage causes segmentation faults and/or unpredictable behaviour as highlighted in #60

Added tests for use of array record types, although the noted issue has turned out to be generic to all types.

…-used record instances do not work.

This usage causes segmentation faults and/or unpredictable behaviour as highlighted in epics-modules#60

Added tests for use of array record types, although the noted issue has turned out to be generic to all types.
@pheest pheest self-assigned this Sep 21, 2026
@mdavidsaver

Copy link
Copy Markdown
Collaborator

Re-used record instances stored in _rec_cache do not work, as they are invalided by the record instance destructor.

To me this describes a premature Py_DECREF leading to a use-after-free situation.

I don't see much performance cost to eliminating _rec_cache. Mainly some extra dbFindRecord(). However, I suspect this would only mask one symptom of some unknown ref. counting bug.

This branch has not been deployed

No deployments
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.

2 participants