Skip to content

Commit

Permalink
tsan:lock-order-inversion in AnimationNode
Browse files Browse the repository at this point in the history
make -j 24 -rs -f /home/noel/libo-tsan/Makefile.gbuild
CppunitTest_filter_svg
[build CUT] filter_svg
==================
WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
(pid=1138169)
Cycle in lock order graph: M0 (0x7b0c0043c8c0) => M1 (0x7b0c00459090)
=> M0

  Mutex M1 acquired here while holding mutex M0 in main thread:
/home/noel/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:4481
(cppunittester+0x9b4c2)
    #1 osl_acquireMutex ??:? (libuno_sal.so.3+0x783ca)
namespace)::AnimationNode::setParent(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
const&) animcore.cxx:? (libanimcorelo.so+0x1d34f)
        M1 try to lock
namespace)::AnimationNode::setParent(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
const&) animcore.cxx:? (libanimcorelo.so+0x33bf2)
namespace)::AnimationNode::appendChild(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&) animcore.cxx:? (libanimcorelo.so+0x27312)
        M0 locked
namespace)::AnimationNode::appendChild(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&) animcore.cxx:? (libanimcorelo.so+0x34d29)
xmloff::AnimationNodeContext::AnimationNodeContext(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&, SvXMLImport&, int,
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&, std::shared_ptr<xmloff::AnimationsImportHelperImpl> const&)
animationimport.cxx:? (libxolo.so+0x338060)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) animationimport.cxx:? (libxolo.so+0x33e010)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) ??:? (libxolo.so+0x2ca188)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) ??:? (libxolo.so+0x2cb106)
namespace)::Event const*) fastparser.cxx:? (libexpwraplo.so+0x4731a)
sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource
const&) fastparser.cxx:? (libexpwraplo.so+0x407fa)
sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource
const&) ??:? (libexpwraplo.so+0x48d08)
const&) ??:? (libxolo.so+0x2c7296)
SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&)
??:? (libxolo.so+0x2c74e2)
namespace)::ReadThroughComponent(com::sun::star::uno::Reference<com::sun::star::embed::XStorage>
const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent>
const&, char const*,
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
const&, char const*,
com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&,
rtl::OUString const&, bool) sdxmlwrp.cxx:? (libsdlo.so+0x4f2088)
(libsdlo.so+0x4ef8ed)
    #17 sd::DrawDocShell::Load(SfxMedium&) ??:? (libsdlo.so+0x5bdbeb)
(libsfxlo.so+0x596b65)
    #19 SfxObjectShell::DoLoad(SfxMedium*) ??:? (libsfxlo.so+0x598732)
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libsfxlo.so+0x5e5222)
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libsfxlo.so+0x5e6135)
namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame>
const&) frmload.cxx:? (libsfxlo.so+0x6ca8fb)
namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame>
const&) frmload.cxx:? (libsfxlo.so+0x6cd749)
(libfwklo.so+0x30000f)
    #25 framework::LoadEnv::start() loadenv.cxx:? (libfwklo.so+0x2fb828)
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame>
const&, rtl::OUString const&, int, LoadEnvFeatures) loadenv.cxx:?
(libfwklo.so+0x2f98d0)
framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader>
const&,
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
const&, rtl::OUString const&, rtl::OUString const&, int,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) loadenv.cxx:? (libfwklo.so+0x2f8905)
rtl::OUString const&, int,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libfwklo.so+0x322cbf)
framework::Desktop::loadComponentFromURL(rtl::OUString const&,
rtl::OUString const&, int,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libfwklo.so+0x322f11)
rtl::OUString const&,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libunotest.so+0x13f41)
(libsubsequenttest.so+0x5fc93)
std::char_traits<char16_t> >, char const*) ??:?
(libsubsequenttest.so+0x60570)
(libtest_filter_svg.so+0x161bd)

  Mutex M0 acquired here while holding mutex M1 in main thread:
/home/noel/llvm-project/compiler-rt/lib/tsan/rtl/../../sanitizer_common/sanitizer_common_interceptors.inc:4481
(cppunittester+0x9b4c2)
    #1 osl_acquireMutex ??:? (libuno_sal.so.3+0x783ca)
namespace)::AnimationNode::fireChangeListener() animcore.cxx:?
(libanimcorelo.so+0x3832f)
        M0 try to lock
namespace)::AnimationNode::fireChangeListener() animcore.cxx:?
(libanimcorelo.so+0x38814)
namespace)::AnimationNode::fireChangeListener() animcore.cxx:?
(libanimcorelo.so+0x38814)
namespace)::AnimationNode::setParent(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
const&) animcore.cxx:? (libanimcorelo.so+0x1d514)
namespace)::AnimationNode::setParent(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>
const&) animcore.cxx:? (libanimcorelo.so+0x33bf2)
namespace)::AnimationNode::appendChild(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&) animcore.cxx:? (libanimcorelo.so+0x27312)
        M1 locked
namespace)::AnimationNode::appendChild(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&) animcore.cxx:? (libanimcorelo.so+0x34d29)
xmloff::AnimationNodeContext::AnimationNodeContext(com::sun::star::uno::Reference<com::sun::star::animations::XAnimationNode>
const&, SvXMLImport&, int,
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&, std::shared_ptr<xmloff::AnimationsImportHelperImpl> const&)
animationimport.cxx:? (libxolo.so+0x338060)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) animationimport.cxx:? (libxolo.so+0x33e010)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) ??:? (libxolo.so+0x2ca188)
com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList>
const&) ??:? (libxolo.so+0x2cb106)
namespace)::Event const*) fastparser.cxx:? (libexpwraplo.so+0x4731a)
sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource
const&) fastparser.cxx:? (libexpwraplo.so+0x407fa)
sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource
const&) ??:? (libexpwraplo.so+0x48d08)
const&) ??:? (libxolo.so+0x2c7296)
SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&)
??:? (libxolo.so+0x2c74e2)
namespace)::ReadThroughComponent(com::sun::star::uno::Reference<com::sun::star::embed::XStorage>
const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent>
const&, char const*,
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
const&, char const*,
com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&,
rtl::OUString const&, bool) sdxmlwrp.cxx:? (libsdlo.so+0x4f2088)
(libsdlo.so+0x4ef8ed)
    #20 sd::DrawDocShell::Load(SfxMedium&) ??:? (libsdlo.so+0x5bdbeb)
(libsfxlo.so+0x596b65)
    #22 SfxObjectShell::DoLoad(SfxMedium*) ??:? (libsfxlo.so+0x598732)
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libsfxlo.so+0x5e5222)
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libsfxlo.so+0x5e6135)
namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame>
const&) frmload.cxx:? (libsfxlo.so+0x6ca8fb)
namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame>
const&) frmload.cxx:? (libsfxlo.so+0x6cd749)
(libfwklo.so+0x30000f)
    #28 framework::LoadEnv::start() loadenv.cxx:? (libfwklo.so+0x2fb828)
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame>
const&, rtl::OUString const&, int, LoadEnvFeatures) loadenv.cxx:?
(libfwklo.so+0x2f98d0)
framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader>
const&,
com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
const&, rtl::OUString const&, rtl::OUString const&, int,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) loadenv.cxx:? (libfwklo.so+0x2f8905)
rtl::OUString const&, int,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libfwklo.so+0x322cbf)
framework::Desktop::loadComponentFromURL(rtl::OUString const&,
rtl::OUString const&, int,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libfwklo.so+0x322f11)
rtl::OUString const&,
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>
const&) ??:? (libunotest.so+0x13f41)

Change-Id: Iecb3f5c1e553d8f4278c7caf7e81f6cb1f589e9a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145335
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
  • Loading branch information
Noel Grandin committed Jan 12, 2023
1 parent c68606c commit 91c954f
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions animations/source/animcore/animcore.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2010,22 +2010,23 @@ Reference< XAnimationNode > SAL_CALL AnimationNode::removeChild( const Reference
// XTimeContainer
Reference< XAnimationNode > SAL_CALL AnimationNode::appendChild( const Reference< XAnimationNode >& newChild )
{
Guard< Mutex > aGuard( m_aMutex );

if( !newChild.is() )
throw IllegalArgumentException("no child", static_cast<cppu::OWeakObject*>(this), 1);
Reference< XInterface > xThis( static_cast< OWeakObject * >(this) );
{
Guard< Mutex > aGuard( m_aMutex );

if( std::find(maChildren.begin(), maChildren.end(), newChild) != maChildren.end() )
throw ElementExistException();
if( !newChild.is() )
throw IllegalArgumentException("no child", static_cast<cppu::OWeakObject*>(this), 1);

Reference< XInterface > xThis( static_cast< OWeakObject * >(this) );
Reference< XInterface > xChild( newChild );
if( std::find(maChildren.begin(), maChildren.end(), newChild) != maChildren.end() )
throw ElementExistException();

if( xThis == xChild )
throw IllegalArgumentException("cannot append self", static_cast<cppu::OWeakObject*>(this), -1);
Reference< XInterface > xChild( newChild );

maChildren.push_back( newChild );
if( xThis == xChild )
throw IllegalArgumentException("cannot append self", static_cast<cppu::OWeakObject*>(this), -1);

maChildren.push_back( newChild );
}
newChild->setParent( xThis );

return newChild;
Expand Down

0 comments on commit 91c954f

Please sign in to comment.