vcl/source/helper/threadex.cxx |    1 +
 vcl/win/window/salframe.cxx    |   10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 19200199d6d65e06b4f540d861a01453b2381d44
Author:     Mike Kaganski <[email protected]>
AuthorDate: Thu Mar 14 23:03:55 2024 +0500
Commit:     Mike Kaganski <[email protected]>
CommitDate: Fri Mar 15 08:35:57 2024 +0500

    Make sure we hold the solar mutex before trying to release it
    
    Might be not guarded by the solar mutex (and need not to!) e.g. when
    an external script calls XDispatchHelper::executeDispatch, with stack
    like this:
    
      vcllo.dll!vcl::SolarThreadExecutor::execute() Line 55 C++
      
fwklo.dll!vcl::solarthread::detail::GenericSolarThreadExecutor<`framework::DispatchHelper::executeDispatch'::`8'::<lambda_1>,com::sun::star::uno::Any>::exec(const
 framework::DispatchHelper::executeDispatch::__l8::<lambda_1> & func) Line 63   
    C++
      
fwklo.dll!vcl::solarthread::syncExecute<`framework::DispatchHelper::executeDispatch'::`8'::<lambda_1>>(const
 framework::DispatchHelper::executeDispatch::__l8::<lambda_1> & func) Line 166  
  C++
      fwklo.dll!framework::DispatchHelper::executeDispatch(const 
com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> & 
xDispatchProvider, const rtl::OUString & sURL, const rtl::OUString & 
sTargetFrameName, long nSearchFlags, const 
com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> & 
lArguments) Line 116      C++
      mscx_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 214       C++
      mscx_uno.dll!unoInterfaceProxyDispatch(_uno_Interface * pUnoI, const 
_typelib_TypeDescription * pMemberTD, void * pReturn, void * * pArgs, _uno_Any 
* * ppException) Line 430 C++
      
binaryurplo.dll!binaryurp::IncomingRequest::execute_throw(binaryurp::BinaryAny 
* returnValue, 
std::vector<binaryurp::BinaryAny,std::allocator<binaryurp::BinaryAny>> * 
outArguments) Line 239 C++
      binaryurplo.dll!binaryurp::IncomingRequest::execute() Line 79 C++
      binaryurplo.dll!request(void * pThreadSpecificData) Line 84   C++
      cppu3.dll!cppu_threadpool::JobQueue::enter(const void * nDisposeId, bool 
bReturnWhenNoJob) Line 101   C++
      cppu3.dll!cppu_threadpool::ORequestThread::run() Line 169     C++
      cppu3.dll!threadFunc(void * param) Line 190   C++
      sal3.dll!oslWorkerWrapperFunction(void * pData) Line 69       C++
      ucrtbased.dll!thread_start<unsigned int (__cdecl*)(void *),1>(void * 
const parameter) Line 97 C++
      kernel32.dll!BaseThreadInitThunk()    Unknown
      ntdll.dll!RtlUserThreadStart()        Unknown
    
    Change-Id: Ic8ffa802f8d9f9165bf5274ddbc06fd70d3a5f5e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164843
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/vcl/source/helper/threadex.cxx b/vcl/source/helper/threadex.cxx
index cbd342bd28df..1590b91f1167 100644
--- a/vcl/source/helper/threadex.cxx
+++ b/vcl/source/helper/threadex.cxx
@@ -52,6 +52,7 @@ void SolarThreadExecutor::execute()
         m_aStart.reset();
         m_aFinish.reset();
         ImplSVEvent* nEvent = Application::PostUserEvent(LINK(this, 
SolarThreadExecutor, worker));
+        SolarMutexGuard aGuard;
         SolarMutexReleaser aReleaser;
         if (m_aStart.wait() == osl::Condition::result_timeout)
         {
commit afed9a55cb8f40b340e819e6f9dcb2ada4b1dba6
Author:     Mike Kaganski <[email protected]>
AuthorDate: Thu Mar 14 23:01:43 2024 +0500
Commit:     Mike Kaganski <[email protected]>
CommitDate: Fri Mar 15 08:35:49 2024 +0500

    Convert an assert into a warning
    
    Seen in an external script calling XSystemChildFactory::createSystemChild.
    
    Change-Id: Ib0fd8ef395700a22e96551ca39aa0ef6dfb21242
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164842
    Tested-by: Mike Kaganski <[email protected]>
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 6ab7bc61d673..91a4e6cc7e04 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -4106,8 +4106,14 @@ static void ImplHandleMoveMsg(HWND hWnd, LPARAM lParam)
 #ifdef NDEBUG
     (void) lParam;
 #endif
-    assert(IsIconic(hWnd) || (pFrame->maGeometry.x() == 
static_cast<sal_Int16>(LOWORD(lParam))));
-    assert(IsIconic(hWnd) || (pFrame->maGeometry.y() == 
static_cast<sal_Int16>(HIWORD(lParam))));
+    SAL_WARN_IF(!IsIconic(hWnd) && pFrame->maGeometry.x() != 
static_cast<sal_Int16>(LOWORD(lParam)),
+                "vcl",
+                "Unexpected X: " << pFrame->maGeometry.x() << " instead of "
+                                 << static_cast<sal_Int16>(LOWORD(lParam)));
+    SAL_WARN_IF(!IsIconic(hWnd) && pFrame->maGeometry.y() != 
static_cast<sal_Int16>(HIWORD(lParam)),
+                "vcl",
+                "Unexpected Y: " << pFrame->maGeometry.y() << " instead of "
+                                 << static_cast<sal_Int16>(HIWORD(lParam)));
 
     if (GetWindowStyle(hWnd) & WS_VISIBLE)
         pFrame->mbDefPos = false;

Reply via email to