----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/ -----------------------------------------------------------
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description -------
indicationmgr: fixed deadlock when re-starting the namager thread.
When the indication manager thread was stopped, it destroys its mutex and creates new one. If pthread_mutex_destroy() fails because the mutex is locked, the new mutex is not created -> the old one is used, but it's already locked -> deadlock.
So let's make sure the mutex is unlocked when destroying the thread.
Rewrite of indication manager thread is needed to have the manage() function interruptible when waiting for events, e.g. using a pipe and select(), this pthread_cancel leads to memory leaks.
Diffs -----
src/indmanager/ind_manager.c 7d6bc7545647589178ed2a858c0d136c4806b7b0
Diff: http://reviewboard-openlmi.rhcloud.com/r/1291/diff/
Testing -------
Thanks,
Jan Safranek
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/#review1791 -----------------------------------------------------------
Autoscan failed: /home/jsafrane/project/system-management/scanbot/make-review-covscan.sh: line 61: pushd: openlmi-providers: No such file or directory Already up-to-date. /home/jsafrane/project/system-management/scanbot/make-review-covscan.sh: line 69: ./make-release.sh: No such file or directory
- scanbot
On Nov. 26, 2013, 11:15 a.m., Jan Safranek wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/
(Updated Nov. 26, 2013, 11:15 a.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
indicationmgr: fixed deadlock when re-starting the namager thread.
When the indication manager thread was stopped, it destroys its mutex and creates new one. If pthread_mutex_destroy() fails because the mutex is locked, the new mutex is not created -> the old one is used, but it's already locked -> deadlock.
So let's make sure the mutex is unlocked when destroying the thread.
Rewrite of indication manager thread is needed to have the manage() function interruptible when waiting for events, e.g. using a pipe and select(), this pthread_cancel leads to memory leaks.
Diffs
src/indmanager/ind_manager.c 7d6bc7545647589178ed2a858c0d136c4806b7b0
Diff: http://reviewboard-openlmi.rhcloud.com/r/1291/diff/
Testing
Thanks,
Jan Safranek
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/#review1792 -----------------------------------------------------------
Ship it!
Agreed, as discussed.
I've put some more ideas in the indmanager rewrite tracker bug: https://bugzilla.redhat.com/show_bug.cgi?id=1028090#c3
- Tomáš Bžatek
On Nov. 26, 2013, 11:15 a.m., Jan Safranek wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/
(Updated Nov. 26, 2013, 11:15 a.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
indicationmgr: fixed deadlock when re-starting the namager thread.
When the indication manager thread was stopped, it destroys its mutex and creates new one. If pthread_mutex_destroy() fails because the mutex is locked, the new mutex is not created -> the old one is used, but it's already locked -> deadlock.
So let's make sure the mutex is unlocked when destroying the thread.
Rewrite of indication manager thread is needed to have the manage() function interruptible when waiting for events, e.g. using a pipe and select(), this pthread_cancel leads to memory leaks.
Diffs
src/indmanager/ind_manager.c 7d6bc7545647589178ed2a858c0d136c4806b7b0
Diff: http://reviewboard-openlmi.rhcloud.com/r/1291/diff/
Testing
Thanks,
Jan Safranek
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/#review1793 -----------------------------------------------------------
Ship it!
src/indmanager/ind_manager.c http://reviewboard-openlmi.rhcloud.com/r/1291/#comment1030
I'd just mention, that the mutex must not be locked by the thread we want to cancel. Otherwise both sentences suggest that we want to have the mutex locked forever which does not make sense.
- Michal Minar
On Nov. 26, 2013, 11:15 a.m., Jan Safranek wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/
(Updated Nov. 26, 2013, 11:15 a.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
indicationmgr: fixed deadlock when re-starting the namager thread.
When the indication manager thread was stopped, it destroys its mutex and creates new one. If pthread_mutex_destroy() fails because the mutex is locked, the new mutex is not created -> the old one is used, but it's already locked -> deadlock.
So let's make sure the mutex is unlocked when destroying the thread.
Rewrite of indication manager thread is needed to have the manage() function interruptible when waiting for events, e.g. using a pipe and select(), this pthread_cancel leads to memory leaks.
Diffs
src/indmanager/ind_manager.c 7d6bc7545647589178ed2a858c0d136c4806b7b0
Diff: http://reviewboard-openlmi.rhcloud.com/r/1291/diff/
Testing
Thanks,
Jan Safranek
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/#review1794 -----------------------------------------------------------
Autoscan started for review(s) 1291,1290
- scanbot
On Nov. 26, 2013, 11:15 a.m., Jan Safranek wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/
(Updated Nov. 26, 2013, 11:15 a.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
indicationmgr: fixed deadlock when re-starting the namager thread.
When the indication manager thread was stopped, it destroys its mutex and creates new one. If pthread_mutex_destroy() fails because the mutex is locked, the new mutex is not created -> the old one is used, but it's already locked -> deadlock.
So let's make sure the mutex is unlocked when destroying the thread.
Rewrite of indication manager thread is needed to have the manage() function interruptible when waiting for events, e.g. using a pipe and select(), this pthread_cancel leads to memory leaks.
Diffs
src/indmanager/ind_manager.c 7d6bc7545647589178ed2a858c0d136c4806b7b0
Diff: http://reviewboard-openlmi.rhcloud.com/r/1291/diff/
Testing
Thanks,
Jan Safranek
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/ -----------------------------------------------------------
(Updated Nov. 26, 2013, 1:04 p.m.)
Status ------
This change has been marked as submitted.
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description -------
indicationmgr: fixed deadlock when re-starting the namager thread.
When the indication manager thread was stopped, it destroys its mutex and creates new one. If pthread_mutex_destroy() fails because the mutex is locked, the new mutex is not created -> the old one is used, but it's already locked -> deadlock.
So let's make sure the mutex is unlocked when destroying the thread.
Rewrite of indication manager thread is needed to have the manage() function interruptible when waiting for events, e.g. using a pipe and select(), this pthread_cancel leads to memory leaks.
Diffs -----
src/indmanager/ind_manager.c 7d6bc7545647589178ed2a858c0d136c4806b7b0
Diff: http://reviewboard-openlmi.rhcloud.com/r/1291/diff/
Testing -------
Thanks,
Jan Safranek
----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/#review1803 -----------------------------------------------------------
Autoscan finished with errors: Error: LOCK (CWE-667): openlmi-providers-0.4.1_62_g4d87f52/src/indmanager/ind_manager.c:1211: lock: "pthread_mutex_lock(pthread_mutex_t *)" locks "manager->_t_mutex". openlmi-providers-0.4.1_62_g4d87f52/src/indmanager/ind_manager.c:1214: missing_unlock: Returning without unlocking "manager->_t_mutex".
Scanned reviews: 1290,1291
- scanbot
On Nov. 26, 2013, 12:04 p.m., Jan Safranek wrote:
This is an automatically generated e-mail. To reply, visit: http://reviewboard-openlmi.rhcloud.com/r/1291/
(Updated Nov. 26, 2013, 12:04 p.m.)
Review request for OpenLMI Developers.
Repository: openlmi-providers
Description
indicationmgr: fixed deadlock when re-starting the namager thread.
When the indication manager thread was stopped, it destroys its mutex and creates new one. If pthread_mutex_destroy() fails because the mutex is locked, the new mutex is not created -> the old one is used, but it's already locked -> deadlock.
So let's make sure the mutex is unlocked when destroying the thread.
Rewrite of indication manager thread is needed to have the manage() function interruptible when waiting for events, e.g. using a pipe and select(), this pthread_cancel leads to memory leaks.
Diffs
src/indmanager/ind_manager.c 7d6bc7545647589178ed2a858c0d136c4806b7b0
Diff: http://reviewboard-openlmi.rhcloud.com/r/1291/diff/
Testing
Thanks,
Jan Safranek
openlmi-reviews@lists.fedorahosted.org