• Mike Kaganski's avatar
    tdf#123502: Make sure to hold the mutex before releasing it · a10cfc48
    Mike Kaganski yazdı
    Fixes a regression after commit 5b2f1243
    
    The destruction of the dialog is initiated by a callback executed from
    VCLXButton::ProcessWindowEvent, which notifies listeners, using a call
    to VCLXWindow::ImplExecuteAsyncWithoutSolarLock. The stack looks like
    this:
    
    ucrtbased.dll!issue_debug_notification(const wchar_t * const message) Line 28
    	at minkernel\crts\ucrt\src\appcrt\internal\report_runtime_error.cpp(28)
    ucrtbased.dll!__acrt_report_runtime_error(const wchar_t * message) Line 154
    	at minkernel\crts\ucrt\src\appcrt\internal\report_runtime_error.cpp(154)
    ucrtbased.dll!abort() Line 51
    	at minkernel\crts\ucrt\src\appcrt\startup\abort.cpp(51)
    comphelper.dll!comphelper::SolarMutex::doRelease(bool bUnlockAll) Line 65
    	at c:\lo\src\core2\comphelper\source\misc\solarmutex.cxx(65)
    vclplug_winlo.dll!SalYieldMutex::doRelease(bool bUnlockAll) Line 169
    	at c:\lo\src\core2\vcl\win\app\salinst.cxx(169)
    comphelper.dll!comphelper::SolarMutex::release(bool bUnlockAll) Line 89
    	at c:\lo\src\core2\include\comphelper\solarmutex.hxx(89)
    vcllo.dll!SalInstance::ReleaseYieldMutexAll() Line 114
    	at c:\lo\src\core2\vcl\source\app\salvtables.cxx(114)
    vcllo.dll!Application::ReleaseSolarMutex() Line 548
    	at c:\lo\src\core2\vcl\source\app\svapp.cxx(548)
    fps.dll!SolarMutexReleaser::SolarMutexReleaser() Line 1479
    	at c:\lo\src\core2\include\vcl\svapp.hxx(1479)
    fps.dll!fpicker::win32::vista::AsyncRequests::~AsyncRequests() Line 84
    	at c:\lo\src\core2\fpicker\source\win32\asyncrequests.cxx(84)
    fps.dll!fpicker::win32::vista::VistaFilePicker::~VistaFilePicker() Line 72
    	at c:\lo\src\core2\fpicker\source\win32\vistafilepicker.cxx(72)
    fps.dll!fpicker::win32::vista::VistaFilePicker::`scalar deleting destructor'(unsigned int)
    cppuhelper3MSC.dll!cppu::OWeakObject::release() Line 233
    	at c:\lo\src\core2\cppuhelper\source\weak.cxx(233)
    cppuhelper3MSC.dll!cppu::WeakComponentImplHelperBase::release() Line 84
    	at c:\lo\src\core2\cppuhelper\source\implbase.cxx(84)
    fps.dll!cppu::PartialWeakComponentImplHelper<com::sun::star::ui::dialogs::XFilePicker3,com::sun::star::ui::dialogs::XFilePickerControlAccess,com::sun::star::ui::dialogs::XFilePreview,com::sun::star::ui::dialogs::XFolderPicker2,com::sun::star::lang::XInitialization,com::sun::star::lang::XServiceInfo>::release() Line 86
    	at c:\lo\src\core2\include\cppuhelper\compbase.hxx(86)
    invocationlo.dll!com::sun::star::uno::cpp_release(void * pCppI) Line 48
    	at c:\lo\src\core2\include\com\sun\star\uno\genfunc.hxx(48)
    cppu3.dll!cppu::_release(void * p, void(*)(void *) release) Line 86
    	at c:\lo\src\core2\cppu\source\uno\prim.hxx(86)
    cppu3.dll!cppu::_destructAny(_uno_Any * pAny, void(*)(void *) release) Line 130
    	at c:\lo\src\core2\cppu\source\uno\destr.hxx(130)
    cppu3.dll!uno_any_destruct(_uno_Any * pValue, void(*)(void *) release) Line 131
    	at c:\lo\src\core2\cppu\source\uno\any.cxx(131)
    invocationlo.dll!com::sun::star::uno::Any::~Any() Line 111
    	at c:\lo\src\core2\include\com\sun\star\uno\any.hxx(111)
    invocationlo.dll!stoc_inv::Invocation_Impl::~Invocation_Impl()
    invocationlo.dll!stoc_inv::Invocation_Impl::`scalar deleting destructor'(unsigned int)
    cppuhelper3MSC.dll!cppu::OWeakObject::release() Line 233
    	at c:\lo\src\core2\cppuhelper\source\weak.cxx(233)
    invocationlo.dll!stoc_inv::Invocation_Impl::release() Line 110
    	at c:\lo\src\core2\stoc\source\invocation\invocation.cxx(110)
    pyuno_d.pyd!com::sun::star::uno::Reference<com::sun::star::script::XInvocation2>::~Reference<com::sun::star::script::XInvocation2>() Line 110
    	at c:\lo\src\core2\include\com\sun\star\uno\reference.hxx(110)
    pyuno_d.pyd!pyuno::PyUNOInternals::~PyUNOInternals()
    pyuno_d.pyd!pyuno::PyUNOInternals::`scalar deleting destructor'(unsigned int)
    pyuno_d.pyd!pyuno::PyUNO_del(_object * self) Line 81
    	at c:\lo\src\core2\pyuno\source\module\pyuno.cxx(81)
    python35_d.dll!_Py_Dealloc(_object * op) Line 1795
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\object.c(1795)
    python35_d.dll!dict_dealloc(PyDictObject * mp) Line 1646
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\dictobject.c(1646)
    python35_d.dll!_Py_Dealloc(_object * op) Line 1795
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\object.c(1795)
    python35_d.dll!subtype_dealloc(_object * self) Line 1194
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\typeobject.c(1194)
    python35_d.dll!_Py_Dealloc(_object * op) Line 1795
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\object.c(1795)
    python35_d.dll!frame_dealloc(_frame * f) Line 431
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\frameobject.c(431)
    python35_d.dll!_Py_Dealloc(_object * op) Line 1795
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\object.c(1795)
    python35_d.dll!fast_function(_object * func, _object * * * pp_stack, int n, int na, int nk) Line 4858
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\python\ceval.c(4858)
    python35_d.dll!call_function(_object * * * pp_stack, int oparg) Line 4783
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\python\ceval.c(4783)
    python35_d.dll!PyEval_EvalFrameEx(_frame * f, int throwflag) Line 3291
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\python\ceval.c(3291)
    python35_d.dll!_PyEval_EvalCodeWithName(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure, _object * name, _object * qualname) Line 4080
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\python\ceval.c(4080)
    python35_d.dll!PyEval_EvalCodeEx(_object * _co, _object * globals, _object * locals, _object * * args, int argcount, _object * * kws, int kwcount, _object * * defs, int defcount, _object * kwdefs, _object * closure) Line 4092
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\python\ceval.c(4092)
    python35_d.dll!function_call(_object * func, _object * arg, _object * kw) Line 627
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\funcobject.c(627)
    python35_d.dll!PyObject_Call(_object * func, _object * arg, _object * kw) Line 2166
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\abstract.c(2166)
    python35_d.dll!method_call(_object * func, _object * arg, _object * kw) Line 330
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\classobject.c(330)
    python35_d.dll!PyObject_Call(_object * func, _object * arg, _object * kw) Line 2166
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\abstract.c(2166)
    python35_d.dll!PyEval_CallObjectWithKeywords(_object * func, _object * arg, _object * kw) Line 4634
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\python\ceval.c(4634)
    python35_d.dll!PyObject_CallObject(_object * o, _object * a) Line 2092
    	at c:\lo\src\core2\workdir\unpackedtarball\python3\objects\abstract.c(2092)
    pyuno_d.pyd!pyuno::Adapter::invoke(const rtl::OUString & aFunctionName, const com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aParams, com::sun::star::uno::Sequence<short> & aOutParamIndex, com::sun::star::uno::Sequence<com::sun::star::uno::Any> & aOutParam) Line 251
    	at c:\lo\src\core2\pyuno\source\module\pyuno_adapter.cxx(251)
    msci_uno.dll!`anonymous namespace'::callVirtualMethod(void * pAdjustedThisPtr, long nVtableIndex, void * pRegisterReturn, _typelib_TypeClass eReturnTypeClass, long * pStackLongs, long nStackLongs) Line 74
    	at c:\lo\src\core2\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx(74)
    msci_uno.dll!`anonymous namespace'::cpp_call(bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, _typelib_TypeDescriptionReference * pReturnTypeRef, long nParams, _typelib_MethodParameter * pParams, void * pUnoReturn, void * * pUnoArgs, _uno_Any * * ppUnoExc) Line 249
    	at c:\lo\src\core2\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx(249)
    msci_uno.dll!unoInterfaceProxyDispatch(_uno_Interface * pUnoI, const _typelib_TypeDescription * pMemberDescr, void * pReturn, void * * pArgs, _uno_Any * * ppException) Line 430
    	at c:\lo\src\core2\bridges\source\cpp_uno\msvc_win32_intel\uno2cpp.cxx(430)
    invocadaptlo.dll!stoc_invadp::AdapterImpl::invoke(const _typelib_TypeDescription * pMemberType, void * pReturn, void * * pArgs, _uno_Any * * ppException) Line 467
    	at c:\lo\src\core2\stoc\source\invocation_adapterfactory\iafactory.cxx(467)
    invocadaptlo.dll!adapter_dispatch(_uno_Interface * pUnoI, const _typelib_TypeDescription * pMemberType, void * pReturn, void * * pArgs, _uno_Any * * ppException) Line 617
    	at c:\lo\src\core2\stoc\source\invocation_adapterfactory\iafactory.cxx(617)
    msci_uno.dll!`anonymous namespace'::cpp2uno_call(bridges::cpp_uno::shared::CppInterfaceProxy * pThis, const _typelib_TypeDescription * pMemberTypeDescr, _typelib_TypeDescriptionReference * pReturnTypeRef, long nParams, _typelib_MethodParameter * pParams, void * * pCallStack, __int64 * pRegisterReturn) Line 155
    	at c:\lo\src\core2\bridges\source\cpp_uno\msvc_win32_intel\cpp2uno.cxx(155)
    msci_uno.dll!`anonymous namespace'::cpp_mediate(void * * pCallStack, long nFunctionIndex, long nVtableOffset, __int64 * pRegisterReturn) Line 345
    	at c:\lo\src\core2\bridges\source\cpp_uno\msvc_win32_intel\cpp2uno.cxx(345)
    msci_uno.dll!`anonymous namespace'::cpp_vtable_call() Line 380
    	at c:\lo\src\core2\bridges\source\cpp_uno\msvc_win32_intel\cpp2uno.cxx(380)
    tklo.dll!ActionListenerMultiplexer::actionPerformed(const com::sun::star::awt::ActionEvent & evt) Line 146
    	at c:\lo\src\core2\toolkit\source\helper\listenermultiplexer.cxx(146)
    tklo.dll!ActionListenerMultiplexer::actionPerformed(const com::sun::star::awt::ActionEvent & evt) Line 146
    	at c:\lo\src\core2\toolkit\source\helper\listenermultiplexer.cxx(146)
    tklo.dll!VCLXButton::ProcessWindowEvent::__l8::<lambda>() Line 593
    	at c:\lo\src\core2\toolkit\source\awt\vclxwindows.cxx(593)
    tklo.dll!std::_Invoker_functor::_Call<void <lambda>(void) &>(VCLXButton::ProcessWindowEvent::__l8::void <lambda>(void) & _Obj)
    tklo.dll!std::invoke<void <lambda>(void) &>(VCLXButton::ProcessWindowEvent::__l8::void <lambda>(void) & _Obj)
    tklo.dll!std::_Invoker_ret<void,1>::_Call<void <lambda>(void) &>(VCLXButton::ProcessWindowEvent::__l8::void <lambda>(void) & <_Vals_0>)
    tklo.dll!std::_Func_impl_no_alloc<void <lambda>(void),void>::_Do_call()
    tklo.dll!std::_Func_class<void>::operator()()
    tklo.dll!VCLXWindowImpl::OnProcessCallbacks(void * __formal) Line 300
    	at c:\lo\src\core2\toolkit\source\awt\vclxwindow.cxx(300)
    ...
    
    So it seems like the only place where we could guarantee the invariant
    to hold solar mutex for GUI protection before releasing it is right
    before the releaser itself.
    Co-authored-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
    
    Change-Id: Ie95bd3423a25f210f0bbb2a88288c7c60a528ea0
    Reviewed-on: https://gerrit.libreoffice.org/70301Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
    Tested-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
    a10cfc48
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 @ 10e0418a
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 @ 0e323bed
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...
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 @ 46a65ed7
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...
.clang-format 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 Loading commit data...
logerrit Loading commit data...
sanitize-ubsan-blacklist Loading commit data...
setup.cfg Loading commit data...