fix tsan data-race

Desktop / LibreOffice - Noel Grandin [collabora.co.uk] - 11 August 2022 18:37 UTC

this check is not necessary, we are using a 32/64 bit counter (depending on platform) for some years now

WARNING: ThreadSanitizer: data race (pid=90197) Atomic write of size 4 at 0x7b08002f474c by thread T90: #0 ScInterpreter::Interpret() interpr4.cxx:? (libsclo.so+0xb99c26) #1 ScFormulaCell::InterpretTail(ScInterpreterContext&, ScFormulaCell::ScInterpretTailParameter) ??:? (libsclo.so+0x95bfeb) #2 ScColumn::CalculateInThread(ScInterpreterContext&, int, unsigned long, unsigned long, unsigned int, unsigned int) column2.cxx:? (libsclo.so+0x754eea) #3 ScTable::CalculateInColumnInThread(ScInterpreterContext&, short, short, int, int, unsigned int, unsigned int) table1.cxx:? (libsclo.so+0x9e692b) #4 ScDocument::CalculateInColumnInThread(ScInterpreterContext&, ScRange const&, unsigned int, unsigned int) documen8.cxx:? (libsclo.so+0x83479f) #5 ScFormulaCell::InterpretFormulaGroupThreading(sc::FormulaLogger::GroupScope&, bool&, bool&, int, int)::Executor::doWork() formulacell.cxx:? (libsclo.so+0x96b5e1) #6 comphelper::ThreadPool::ThreadWorker::execute() threadpool.cxx:? (libcomphelper.so+0x1cb0a1) #7 non-virtual thunk to salhelper::Thread::run() ??:? (libuno_salhelpergcc3.so.3+0x67f7) #8 threadFunc thread.cxx:? (libuno_salhelpergcc3.so.3+0x6aae) #9 osl_thread_start_Impl(void*) thread.cxx:? (libuno_sal.so.3+0x86245)

Previous read of size 4 at 0x7b08002f474c by thread T89: #0 ScFormulaResult::SetToken(formula::FormulaToken const*) formularesult.cxx:? (libsclo.so+0xb0e11f) #1 ScFormulaResult::Assign(ScFormulaResult const&) formularesult.cxx:? (libsclo.so+0xb0e837) #2 ScFormulaCell::InterpretTail(ScInterpreterContext&, ScFormulaCell::ScInterpretTailParameter) ??:? (libsclo.so+0x95caa3) #3 ScColumn::CalculateInThread(ScInterpreterContext&, int, unsigned long, unsigned long, unsigned int, unsigned int) column2.cxx:? (libsclo.so+0x754eea) #4 ScTable::CalculateInColumnInThread(ScInterpreterContext&, short, short, int, int, unsigned int, unsigned int) table1.cxx:? (libsclo.so+0x9e692b) #5 ScDocument::CalculateInColumnInThread(ScInterpreterContext&, ScRange const&, unsigned int, unsigned int) documen8.cxx:? (libsclo.so+0x83479f) #6 ScFormulaCell::InterpretFormulaGroupThreading(sc::FormulaLogger::GroupScope&, bool&, bool&, int, int)::Executor::doWork() formulacell.cxx:? (libsclo.so+0x96b5e1) #7 comphelper::ThreadPool::ThreadWorker::execute() threadpool.cxx:? (libcomphelper.so+0x1cb0a1) #8 non-virtual thunk to salhelper::Thread::run() ??:? (libuno_salhelpergcc3.so.3+0x67f7) #9 threadFunc thread.cxx:? (libuno_salhelpergcc3.so.3+0x6aae) #10 osl_thread_start_Impl(void*) thread.cxx:? (libuno_sal.so.3+0x86245)

Change-Id: I3e51db3a8a0a18fee1647657369ecebf5de108e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138137

0dffa005544c fix tsan data-race
sc/inc/formularesult.hxx | 14 --------------
sc/source/core/tool/formularesult.cxx | 9 +++------
2 files changed, 3 insertions(+), 20 deletions(-)

Upstream: cgit.freedesktop.org


  • Share