-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QSRV probable ref. leak #6
Comments
I think this is resolved by epics-base/pvAccessCPP@6055dbb. |
Leaked refs.
|
Not a blocker for 7.0.1-rc1. |
I'm coming to the conclusion that this isn't an explicit ref. loop. Rather, an extra Monitor ref. is being held by the dbEvent worker thread (the only other involved). This ref is held through the "interested" list of Monitors to allow unlocking for Monitor callbacks. To handle adding/removing Monitors while iteration I'm used a somewhat convoluted scheme with a pair of lists (interested_add and interested_remove) to accumulate changes made while iterating. The interested_remove list holds shared_ptr<>s to keep removed Monitors alive while being iterated. So this may be involved as well. I still don't see why a |
Ok, I see it. Ownership rule number 1 is being violated. PDBSingleChannel has a strong ref. to PDBProvider via PDBSinglePV. This prevents automatic closure of Channels when the Provider goes out of scope. http://mdavidsaver.github.io/pvAccessCPP/providers.html#provides_client_ownership |
This isn't an actual ref. leak. In practice it's a race when the a Channel is closed concurrently with a dbEvent callback. The result is that the Channel, and by extension Provider are destroyed in the dbEvent callback. The practical effect of this is a possible deadlock on process exit (db_close_events() called from dbEvent callback). |
Does this trigger when you start
The process does exit properly. |
The first is to be expected with the exit() proc. Actually this message probably doesn't need to be printed by default. The other two are symptoms of this issue. |
epics-base/pvAccessCPP@457d035 demotes the still active and closing message from Info to Debug level, so it is no longer shown by default. |
I haven't seen this in some time. |
So far only observed on travis-ci.org with
testpdb
when built against Base 3.15. Loop includes at least:https://travis-ci.org/mdavidsaver/pva2pva/jobs/303771863
The text was updated successfully, but these errors were encountered: