From dc73583573a31078c8408e820d749aaeab25bc32 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 31 May 2019 15:39:17 +0200 Subject: crash-testing fdo86059-1.xlsx blind fix since I can't reproduce. But I can see from the reported threads that two different threads are entering SfxItemPool::Put and consequently the debug runtime throws an iterator exception. Change-Id: Idaa6a93b134edc49bda8cd7876bb216d5aec7037 Reviewed-on: https://gerrit.libreoffice.org/73272 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/core/data/table1.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sc') diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index be7d12b50150..b899bbb91cbf 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -2554,6 +2554,10 @@ ScColumnsRange ScTable::GetColumnsRange(SCCOL nColBegin, SCCOL nColEnd) const // out-of-line the cold part of the CreateColumnIfNotExists function void ScTable::CreateColumnIfNotExistsImpl( const SCCOL nScCol ) const { + // When doing multi-threaded load of, e.g. XLS files, we can hit this, which calls + // into SfxItemPool::Put, in parallel with other code that calls into SfxItemPool::Put, + // which is bad since that code is not thread-safe. + SolarMutexGuard aGuard; const SCCOL aOldColSize = aCol.size(); aCol.resize( static_cast< size_t >( nScCol + 1 ) ); for (SCCOL i = aOldColSize; i <= nScCol; i++) -- cgit v1.2.3