Skip to content

Fix race condition in ServiceManager

Marco Clemencic requested to merge 237-segfault-in-servicemanager into master

Accesses to ServiceManager::m_listsvc must be synchronized, otherwise we may end up with a segmentation fault due to an access to a partially constructed element in the list (see #237 (closed)).

All write accesses are protected except for one and this MR adds the missing protection.

As discussed in #237 (closed), this might not be enough because patterns like

auto it = find( name );
if ( it != m_listsvc.end() ) {

may incur in race conditions.

Closes #237 (closed)

Edited by Marco Clemencic

Merge request reports