Merge lp:~michihenning/unity-scopes-api/fix-leak-and-warnings into lp:unity-scopes-api
Status: | Merged |
---|---|
Approved by: | Paweł Stołowski |
Approved revision: | 285 |
Merged at revision: | 292 |
Proposed branch: | lp:~michihenning/unity-scopes-api/fix-leak-and-warnings |
Merge into: | lp:unity-scopes-api |
Diff against target: |
315 lines (+52/-35) 14 files modified
HACKING (+12/-8) include/unity/scopes/internal/QueryCtrlObjectBase.h (+1/-1) include/unity/scopes/internal/QueryObjectBase.h (+1/-1) include/unity/scopes/internal/ReplyObject.h (+1/-1) include/unity/scopes/internal/ScopeObjectBase.h (+1/-1) include/unity/scopes/internal/smartscopes/SmartScopesClient.h (+0/-1) include/unity/scopes/utility/BufferedResultForwarder.h (+5/-3) scoperegistry/scoperegistry.cpp (+5/-6) smartscopesproxy/smartscopesproxy.cpp (+5/-3) src/scopes/internal/Logger.cpp (+1/-1) src/scopes/internal/smartscopes/SmartScopesClient.cpp (+0/-1) src/scopes/internal/zmq_middleware/ZmqMiddleware.cpp (+11/-8) src/scopes/utility/BufferedResultForwarder.cpp (+4/-0) test/gtest/scopes/internal/smartscopes/smartscopesproxy/smartscopesproxy_test.cpp (+5/-0) |
To merge this branch: | bzr merge lp:~michihenning/unity-scopes-api/fix-leak-and-warnings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Paweł Stołowski (community) | Approve | ||
Review via email:
|
Commit message
Fixed memory leak in BufferedResultF
warnings for clang build. Minor updates to HACKING.
During the tests for revision 282, we got a core dump from the smartscopesproxy test.
The core dump was caused by rapid startup and shutdown of the RuntimeImpl instances used by the smartscopesproxy test. That allowed a zmq endpoint to linger behind after the previous RuntimeImpl was destroyed, causing the next RuntimeImpl to throw because the endpoint was still bound. (zmq context destruction is asynchronous, unfortunately.) In turn, that exposed a life cycle issue where ZmqMiddleware was calling into an already-destroyed logger instance, because the signal handlers in the registry and smartscopes registry were keeping the ZmqMiddleware instance alive beyond the life time of the RuntimeImpl.
Solution was two-fold:
- Don't log from the ZmqMiddleware destructor. No information is lost because the same exception information is provided by wait_for_
- Added 300 ms delay to the smartscopesproxy test when the runtime is destroyed. This gives zmq time to close its server sockets, so we don't get a double-bind failure.
Description of the change
Fixed memory leak in BufferedResultF
warnings for clang build. Minor updates to HACKING.
During the tests for revision 282, we got a core dump from the smartscopesproxy test.
The core dump was caused by rapid startup and shutdown of the RuntimeImpl instances used by the smartscopesproxy test. That allowed a zmq endpoint to linger behind after the previous RuntimeImpl was destroyed, causing the next RuntimeImpl to throw because the endpoint was still bound. (zmq context destruction is asynchronous, unfortunately.) In turn, that exposed a life cycle issue where ZmqMiddleware was calling into an already-destroyed logger instance, because the signal handlers in the registry and smartscopes registry were keeping the ZmqMiddleware instance alive beyond the life time of the RuntimeImpl.
Solution was two-fold:
- Don't log from the ZmqMiddleware destructor. No information is lost because the same exception information is provided by wait_for_
- Added 300 ms delay to the smartscopesproxy test when the runtime is destroyed. This gives zmq time to close its server sockets, so we don't get a double-bind failure.
PASSED: Continuous integration, rev:281 jenkins. qa.ubuntu. com/job/ unity-scopes- api-ci/ 546/ jenkins. qa.ubuntu. com/job/ unity-scopes- api-vivid- amd64-ci/ 73 jenkins. qa.ubuntu. com/job/ unity-scopes- api-vivid- armhf-ci/ 71 jenkins. qa.ubuntu. com/job/ unity-scopes- api-vivid- armhf-ci/ 71/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ unity-scopes- api-vivid- i386-ci/ 72
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- scopes- api-ci/ 546/rebuild
http://