On Tue, Jun 02, 2015 at 03:12:51PM +0200, Noel Grandin wrote: > On 2015-06-02 03:07 PM, Lionel Elie Mamane wrote: >> I found a race condition between
>> 1) connectivity::hsqldb::ODriverDelegator::flushConnections() >> (in file connectivity/source/drivers/hsqldb/HDriver.cxx around line 620) >> walking over m_aConnections >> 2) connectivity::hsqldb::ODriverDelegator::disposing() >> (same file around line 565) >> calling >> m_aConnections.clear(); >> TWeakPairVector().swap(m_aConnections); >> which invalidates the iterators used by flushConnection() >> Plus also probably, race condition between flushConnections() calling >> flush() and disposing() disposing the underlying connection (although >> this is probably handled correctly by the exception catching...). > I would suggest something like this in ODriverDelegator::flushConnections(): > take_mutex(); > std::vector<Connection> tmp = m_aConnections; > release_mutex(); > for (Connection conn : tmp) > conn.flush(); > so that the mutex is not held during the problematic phase That makes sense. Will try that. Thanks! -- Lionel _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice