• Michael Stahl's avatar
    stoc: deadlock osl::Mutex::getGlobalMutex() vs getImplHelperInitMutex() · 7936368f
    Michael Stahl yazdı
    As found in a clang/ASAN build running UITest_writer_demo.
    
    cppu::getTypeEntries locks getImplHelperInitMutex().
    
    Let's try to replace the usage of getGlobalMutex() in proxyfac_create()
    with a new static Mutex that is only used in that function.
    
    {1: 7, 6: 1, 7: 1}
    Thread 1 is waiting for 7
    Thread 7 is waiting for 1
    
    Thread 7 (Thread 0x7f34a147a700 (LWP 2530)):
    2  osl_acquireMutex(oslMutexImpl*) (pMutex=0x7f34f620a3e0 <globalMutexImpl>) at sal/osl/unx/mutex.cxx:97
    3  osl::Mutex::acquire() (this=0x7f34f61f7da0 <osl_getGlobalMutex::globalMutex>) at include/osl/mutex.hxx:56
    4  osl::Guard<osl::Mutex>::Guard(osl::Mutex*) (this=0x7f349f6dc420, pT_=0x7f34f61f7da0 <osl_getGlobalMutex::globalMutex>) at include/osl/mutex.hxx:122
    5  com::sun::star::lang::cppu_detail_getUnoType(com::sun::star::lang::XSingleComponentFactory const*) () at workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/lang/XSingleComponentFactory.hpp:69
    6  cppu::UnoType<com::sun::star::lang::XSingleComponentFactory>::get() () at include/cppu/unotype.hxx:296
    7  com::sun::star::lang::XSingleComponentFactory::static_type(void*) () at workdir/UnoApiHeadersTarget/udkapi/normal/com/sun/star/lang/XSingleComponentFactory.hpp:146
    8  cppu::getTypeEntries(cppu::class_data*) (cd=0x7f34bddacb40 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::lang::XSingleComponentFactory, com::sun::star::lang::XServiceInfo>, com::sun::star::lang::XSingleComponentFactory, com::sun::star::lang::XServiceInfo>::operator()()::s_cd>) at cppuhelper/source/implbase_ex.cxx:96
    9  cppu::queryDeepNoXInterface(_typelib_TypeDescriptionReference const*, cppu::class_data*, void*) (pDemandedTDR=0x60f000042940, cd=0x7f34bddacb40 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::lang::XSingleComponentFactory, com::sun::star::lang::XServiceInfo>, com::sun::star::lang::XSingleComponentFactory, com::sun::star::lang::XServiceInfo>::operator()()::s_cd>, that=0x606000d3d3c0) at cppuhelper/source/implbase_ex.cxx:168
    10 cppu::WeakImplHelper_query(com::sun::star::uno::Type const&, cppu::class_data*, void*, cppu::OWeakObject*) (rType=invalid uno::Type, cd=0x7f34bddacb40 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::lang::XSingleComponentFactory, com::sun::star::lang::XServiceInfo>, com::sun::star::lang::XSingleComponentFactory, com::sun::star::lang::XServiceInfo>::operator()()::s_cd>, that=0x606000d3d3c0, pBase=0x606000d3d3c0) at cppuhelper/source/implbase_ex.cxx:296
    11 cppu::WeakImplHelper<com::sun::star::lang::XSingleComponentFactory, com::sun::star::lang::XServiceInfo>::queryInterface(com::sun::star::uno::Type const&) (this=0x606000d3d3c0, aType=invalid uno::Type) at include/cppuhelper/implbase.hxx:108
    12 non-virtual thunk to cppu::WeakImplHelper<com::sun::star::lang::XSingleComponentFactory, com::sun::star::lang::XServiceInfo>::queryInterface(com::sun::star::uno::Type const&) () at include/cppuhelper/implbase.hxx:107
    13 com::sun::star::uno::BaseReference::iquery(com::sun::star::uno::XInterface*, com::sun::star::uno::Type const&) (pInterface=0x606000d3d3e8, rType=invalid uno::Type) at include/com/sun/star/uno/Reference.hxx:55
    14 com::sun::star::uno::Reference<com::sun::star::lang::XSingleComponentFactory>::iquery(com::sun::star::uno::XInterface*) (pInterface=0x606000d3d3e8) at include/com/sun/star/uno/Reference.hxx:70
    15 com::sun::star::uno::Reference<com::sun::star::lang::XSingleComponentFactory>::set(com::sun::star::uno::BaseReference const&, com::sun::star::uno::UnoReference_Query) (this=0x7f349f92b7e0, rRef=...) at include/com/sun/star/uno/Reference.hxx:279
    16 cppuhelper::ServiceManager::loadImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, std::shared_ptr<cppuhelper::ServiceManager::Data::Implementation> const&) (this=0x61500000e900, context=uno::Reference to (cppu::ComponentContext *) 0x611000003b50, implementation=warning: RTTI symbol not found for class 'std::_Sp_counted_ptr<cppuhelper::ServiceManager::Data::Implementation*, (__gnu_cxx::_Lock_policy)2>'
    arnound for class 'std::_Sp_counted_ptr<cppuhelper::ServiceManager::Data::Implementation*, (__gnu_cxx::_Lock_policy)2>'
    td:weak 0) 0x60b000013ff0) at cppuhelper/source/servicemanager.cxx:823
    17 cppuhelper::ServiceManager::findServiceImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&) (this=0x61500000e900, context=uno::Reference to (cppu::ComponentContext *) 0x611000003b50, specifier="com.sun.star.configuration.ConfigurationProvider") at cppuhelper/source/servicemanager.cxx:1811
    18 cppuhelper::ServiceManager::createInstanceWithContext(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x61500000e900, aServiceSpecifier="com.sun.star.configuration.ConfigurationProvider", Context=uno::Reference to (cppu::ComponentContext *) 0x611000003b50) at cppuhelper/source/servicemanager.cxx:993
    19 cppuhelper::ServiceManager::createInstance(rtl::OUString const&) (this=0x61500000e900, aServiceSpecifier="com.sun.star.configuration.ConfigurationProvider") at cppuhelper/source/servicemanager.cxx:950
    
    Thread 1 (Thread 0x7f34f632b4c0 (LWP 2487)):
    2  osl_acquireMutex(oslMutexImpl*) (pMutex=0x604000098a90) at sal/osl/unx/mutex.cxx:97
    3  osl::Mutex::acquire() (this=0x7f34f12fa820 <rtl::Static<osl::Mutex, (anonymous namespace)::theImplHelperInitMutex>::get()::instance>) at include/osl/mutex.hxx:56
    4  osl::Guard<osl::Mutex>::Guard(osl::Mutex&) (this=0x7f34c6611420, t=...) at include/osl/mutex.hxx:129
    5  cppu::getTypeEntries(cppu::class_data*) (cd=0x7f3498adf290 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::reflection::XProxyFactory>, com::sun::star::lang::XServiceInfo, com::sun::star::reflection::XProxyFactory>::operator()()::s_cd>) at cppuhelper/source/implbase_ex.cxx:89
    6  cppu::queryDeepNoXInterface(_typelib_TypeDescriptionReference const*, cppu::class_data*, void*) (pDemandedTDR=0x60f00003c6d0, cd=0x7f3498adf290 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::reflection::XProxyFactory>, com::sun::star::lang::XServiceInfo, com::sun::star::reflection::XProxyFactory>::operator()()::s_cd>, that=0x6080005aa620) at cppuhelper/source/implbase_ex.cxx:168
    7  cppu::WeakImplHelper_query(com::sun::star::uno::Type const&, cppu::class_data*, void*, cppu::OWeakObject*) (rType=invalid uno::Type, cd=0x7f3498adf290 <cppu::detail::ImplClassData<cppu::WeakImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::reflection::XProxyFactory>, com::sun::star::lang::XServiceInfo, com::sun::star::reflection::XProxyFactory>::operator()()::s_cd>, that=0x6080005aa620, pBase=0x6080005aa620) at cppuhelper/source/implbase_ex.cxx:296
    8  cppu::WeakImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::reflection::XProxyFactory>::queryInterface(com::sun::star::uno::Type const&) (this=0x6080005aa620, aType=invalid uno::Type) at include/cppuhelper/implbase.hxx:108
    9  com::sun::star::uno::BaseReference::iquery(com::sun::star::uno::XInterface*, com::sun::star::uno::Type const&) (pInterface=0x6080005aa620, rType=invalid uno::Type) at include/com/sun/star/uno/Reference.hxx:55
    10 com::sun::star::uno::Reference<com::sun::star::uno::XWeak>::iquery(com::sun::star::uno::XInterface*) (pInterface=0x6080005aa620) at include/com/sun/star/uno/Reference.hxx:70
    11 com::sun::star::uno::Reference<com::sun::star::uno::XWeak>::query(com::sun::star::uno::BaseReference const&) (rRef=...) at include/com/sun/star/uno/Reference.hxx:371
    12 com::sun::star::uno::OWeakRefListener::OWeakRefListener(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) (this=0x603000e789b0, xInt=uno::Reference to ((anonymous namespace)::FactoryImpl *) 0x6080005aa620) at cppuhelper/source/weak.cxx:371
    13 com::sun::star::uno::WeakReferenceHelper::operator=(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) (this=0x7f3498ae06e0 <(anonymous namespace)::proxyfac_create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)::rwInstance>, xInt=uno::Reference to ((anonymous namespace)::FactoryImpl *) 0x6080005aa620) at cppuhelper/source/weak.cxx:500
    14 com::sun::star::uno::WeakReference<com::sun::star::uno::XInterface>::operator=(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) (this=0x7f3498ae06e0 <(anonymous namespace)::proxyfac_create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)::rwInstance>, xInt=uno::Reference to ((anonymous namespace)::FactoryImpl *) 0x6080005aa620) at include/cppuhelper/weakref.hxx:173
    15 (anonymous namespace)::proxyfac_create(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () at stoc/source/proxy_factory/proxyfac.cxx:443
    16 cppu::OSingleFactoryHelper::createInstanceEveryTime(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x61000031cfa8, xContext=uno::Reference to (cppu::ComponentContext *) 0x611000003b50) at cppuhelper/source/factory.cxx:140
    17 cppu::OSingleFactoryHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x61000031cfa8, xContext=uno::Reference to (cppu::ComponentContext *) 0x611000003b50) at cppuhelper/source/factory.cxx:175
    18 cppu::OFactoryComponentHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) (this=0x61000031cf40, xContext=uno::Reference to (cppu::ComponentContext *) 0x611000003b50) at cppuhelper/source/factory.cxx:378
    19 non-virtual thunk to cppu::OFactoryComponentHelper::createInstanceWithContext(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) () at cppuhelper/source/factory.cxx:364
    20 0x00007f34f0e6d166 in cppuhelper::ServiceManager::Data::Implementation::createInstance(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, bool) (this=0x60b000001850, context=uno::Reference to (cppu::ComponentContext *) 0x611000003b50, singletonRequest=false) at cppuhelper/source/servicemanager.cxx:668
    
    Change-Id: I8d10cca4965feb704c35c70cf99995be26e23a41
    7936368f
Adı
Son kayıt (commit)
Son güncelleme
.git-hooks Loading commit data...
UnoControls Loading commit data...
accessibility Loading commit data...
android Loading commit data...
animations Loading commit data...
apple_remote Loading commit data...
avmedia Loading commit data...
basctl Loading commit data...
basegfx Loading commit data...
basic Loading commit data...
bean Loading commit data...
bin Loading commit data...
binaryurp Loading commit data...
bridges Loading commit data...
canvas Loading commit data...
chart2 Loading commit data...
cli_ure Loading commit data...
codemaker Loading commit data...
comphelper Loading commit data...
compilerplugins Loading commit data...
config_host Loading commit data...
configmgr Loading commit data...
connectivity Loading commit data...
cppcanvas Loading commit data...
cppu Loading commit data...
cppuhelper Loading commit data...
cpputools Loading commit data...
cui Loading commit data...
dbaccess Loading commit data...
desktop Loading commit data...
dictionaries @ 93db4f58
distro-configs Loading commit data...
drawinglayer Loading commit data...
dtrans Loading commit data...
editeng Loading commit data...
embeddedobj Loading commit data...
embedserv Loading commit data...
emfio Loading commit data...
eventattacher Loading commit data...
extensions Loading commit data...
external Loading commit data...
extras Loading commit data...
filter Loading commit data...
forms Loading commit data...
formula Loading commit data...
fpicker Loading commit data...
framework Loading commit data...
helpcompiler Loading commit data...
helpcontent2 @ 8ecf172a
hwpfilter Loading commit data...
i18nlangtag Loading commit data...
i18npool Loading commit data...
i18nutil Loading commit data...
icon-themes Loading commit data...
idl Loading commit data...
idlc Loading commit data...
include Loading commit data...
instsetoo_native Loading commit data...
io Loading commit data...
ios Loading commit data...
javaunohelper Loading commit data...
jurt Loading commit data...
jvmaccess Loading commit data...
jvmfwk Loading commit data...
l10ntools Loading commit data...
librelogo Loading commit data...
libreofficekit Loading commit data...
lingucomponent Loading commit data...
linguistic Loading commit data...
lotuswordpro Loading commit data...
m4 Loading commit data...
mysqlc Loading commit data...
nlpsolver Loading commit data...
o3tl Loading commit data...
odk Loading commit data...
offapi Loading commit data...
officecfg Loading commit data...
onlineupdate Loading commit data...
oovbaapi Loading commit data...
oox Loading commit data...
opencl Loading commit data...
osx Loading commit data...
package Loading commit data...
postprocess Loading commit data...
pyuno Loading commit data...
qadevOOo Loading commit data...
readlicense_oo Loading commit data...
registry Loading commit data...
remotebridges Loading commit data...
reportbuilder Loading commit data...
reportdesign Loading commit data...
ridljar Loading commit data...
sal Loading commit data...
salhelper Loading commit data...
sax Loading commit data...
sc Loading commit data...
scaddins Loading commit data...
sccomp Loading commit data...
schema Loading commit data...
scp2 Loading commit data...
scripting Loading commit data...
sd Loading commit data...
sdext Loading commit data...
setup_native Loading commit data...
sfx2 Loading commit data...
shell Loading commit data...
slideshow Loading commit data...
smoketest Loading commit data...
solenv Loading commit data...
soltools Loading commit data...
sot Loading commit data...
starmath Loading commit data...
stoc Loading commit data...
store Loading commit data...
svgio Loading commit data...
svl Loading commit data...
svtools Loading commit data...
svx Loading commit data...
sw Loading commit data...
swext Loading commit data...
sysui Loading commit data...
test Loading commit data...
testtools Loading commit data...
toolkit Loading commit data...
tools Loading commit data...
translations @ d317414f
ucb Loading commit data...
ucbhelper Loading commit data...
udkapi Loading commit data...
uitest Loading commit data...
unodevtools Loading commit data...
unoidl Loading commit data...
unoil Loading commit data...
unotest Loading commit data...
unotools Loading commit data...
unoxml Loading commit data...
ure Loading commit data...
uui Loading commit data...
vbahelper Loading commit data...
vcl Loading commit data...
winaccessibility Loading commit data...
wizards Loading commit data...
writerfilter Loading commit data...
writerperfect Loading commit data...
xmerge Loading commit data...
xmlhelp Loading commit data...
xmloff Loading commit data...
xmlreader Loading commit data...
xmlscript Loading commit data...
xmlsecurity Loading commit data...
.buckconfig Loading commit data...
.buckversion Loading commit data...
.editorconfig Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.gitreview Loading commit data...
BUCK Loading commit data...
COPYING Loading commit data...
COPYING.LGPL Loading commit data...
COPYING.MPL Loading commit data...
Library_merged.mk Loading commit data...
Makefile.fetch Loading commit data...
Makefile.gbuild Loading commit data...
Makefile.in Loading commit data...
README.Solaris Loading commit data...
README.cross Loading commit data...
README.md Loading commit data...
Repository.mk Loading commit data...
RepositoryExternal.mk Loading commit data...
RepositoryFixes.mk Loading commit data...
RepositoryModule_build.mk Loading commit data...
RepositoryModule_host.mk Loading commit data...
TEMPLATE.SOURCECODE.HEADER Loading commit data...
autogen.sh Loading commit data...
config.guess Loading commit data...
config.sub Loading commit data...
config_host.mk.in Loading commit data...
config_host_lang.mk.in Loading commit data...
configure.ac Loading commit data...
download.lst Loading commit data...
g Loading commit data...
install-sh Loading commit data...
leak-suppress.txt Loading commit data...
lo.xcent.in Loading commit data...
logerrit Loading commit data...
sanitize-ubsan-blacklist Loading commit data...