vcl/inc/skia/zone.hxx |    7 ++++---
 vcl/skia/gdiimpl.cxx  |    3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 091d0e48b568a427238987146e8fa6b648266ce8
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Dec 31 22:39:14 2023 +0600
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Dec 31 22:51:54 2023 +0100

    Use DBG_TESTSOLARMUTEX instead of SolarMutex::IsCurrentThread in assertion
    
    It is consistent with all other places where this precondition is tested.
    
    Change-Id: I0f99447fea8bb0b5d869f2205a06f954b75b8e0a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161505
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index a09738af4864..e03fa32c3532 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -28,6 +28,7 @@
 #include <vcl/skia/SkiaHelper.hxx>
 #include <skia/utils.hxx>
 #include <skia/zone.hxx>
+#include <tools/debug.hxx>
 
 #include <SkBitmap.h>
 #include <SkCanvas.h>
@@ -446,7 +447,7 @@ void SkiaSalGraphicsImpl::DeInit() { destroySurface(); }
 
 void SkiaSalGraphicsImpl::preDraw()
 {
-    assert(comphelper::SolarMutex::get()->IsCurrentThread());
+    DBG_TESTSOLARMUTEX();
     SkiaZone::enter(); // matched in postDraw()
     checkSurface();
     checkPendingDrawing();
commit 75c89e5603b5fbe4fa2b307f565c071f3b36216b
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sun Dec 31 22:34:37 2023 +0600
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Dec 31 22:51:42 2023 +0100

    Acquire solar mutex in SkiaZone, instead of asserting
    
    The assertion is there since commit 7c1dc527837a65b77f7624e18a575271cb46afba
    (ensure SolarMutex is held for SkiaZone, 2020-09-29). For unclear reason,
    it now started to fail locally in JunitTest_toolkit_unoapi_3:
    
     vcllo.dll!SkiaZone::SkiaZone() Line 23 C++
     vcllo.dll!SkiaSalBitmap::ResetAllData() Line 1412      C++
     vcllo.dll!SkiaSalBitmap::Create(const Size & rSize, vcl::PixelFormat 
ePixelFormat, const BitmapPalette & rPal) Line 85 C++
     vcllo.dll!Bitmap::Bitmap(const Size & rSizePixel, vcl::PixelFormat 
ePixelFormat, const BitmapPalette * pPal) Line 132  C++
     vcllo.dll!`anonymous namespace'::GIFReader::CreateBitmaps(__int64 nWidth, 
__int64 nHeight, BitmapPalette * pPal, bool bWatchForBackgroundColor) Line 224  
     C++
     vcllo.dll!`anonymous namespace'::GIFReader::ReadLocalHeader() Line 513 C++
     vcllo.dll!`anonymous namespace'::GIFReader::ProcessGIF() Line 807      C++
     vcllo.dll!`anonymous namespace'::GIFReader::ReadGIF(Graphic & rGraphic) 
Line 946       C++
     vcllo.dll!ImportGIF(SvStream & rStm, Graphic & rGraphic) Line 1005     C++
     vcllo.dll!GraphicFilter::readGIF(SvStream & rStream, Graphic & rGraphic, 
GfxLinkType & rLinkType) Line 920     C++
     vcllo.dll!GraphicFilter::ImportGraphic(Graphic & rGraphic, 
std::basic_string_view<char16_t,std::char_traits<char16_t>> rPath, SvStream & 
rIStream, unsigned short nFormat, unsigned short * pDeterminedFormat, 
GraphicFilterImportFlags nImportFlags) Line 1328        C++
     vcllo.dll!GraphicFilter::FilterCallback(ConvertData & rData) Line 1861 C++
     vcllo.dll!GraphicFilter::LinkStubFilterCallback(void * instance, 
ConvertData & data) Line 1832 C++
     sofficeapp.dll!Link<ConvertData &,bool>::Call(ConvertData & data) Line 111 
    C++
     sofficeapp.dll!desktop::Desktop::ImplInitFilterHdl(desktop::Desktop * 
__formal, ConvertData & rData) Line 1722 C++
     sofficeapp.dll!desktop::Desktop::LinkStubImplInitFilterHdl(void * 
instance, ConvertData & data) Line 1719      C++
     vcllo.dll!Link<ConvertData &,bool>::Call(ConvertData & data) Line 111  C++
     vcllo.dll!GraphicConverter::Import(SvStream & rIStm, Graphic & rGraphic, 
ConvertDataFormat nFormat) Line 39    C++
     frmlo.dll!ImageProducer::ImplImportGraphic(Graphic & rGraphic) Line 187    
    C++
     frmlo.dll!ImageProducer::startProduction() Line 147    C++
     frmlo.dll!frm::OImageControlModel::doSetControlValue(const 
com::sun::star::uno::Any & _rValue) Line 610        C++
     frmlo.dll!frm::OBoundControlModel::setControlValue(const 
com::sun::star::uno::Any & _rValue, 
frm::OBoundControlModel::ValueChangeInstigator _eInstigator) Line 2127    C++
     frmlo.dll!frm::OImageControlModel::impl_updateStreamForURL_lck(const 
rtl::OUString & _rURL, frm::OBoundControlModel::ValueChangeInstigator 
_eInstigator) Line 423      C++
     
frmlo.dll!frm::OImageControlModel::impl_handleNewImageURL_lck(frm::OBoundControlModel::ValueChangeInstigator
 _eInstigator) Line 437    C++
     frmlo.dll!frm::OImageControlModel::setFastPropertyValue_NoBroadcast(long 
nHandle, const com::sun::star::uno::Any & rValue) Line 259    C++
     cppuhelper3MSC.dll!cppu::OPropertySetHelper::setFastPropertyValue(long 
nHandle, const com::sun::star::uno::Any & rValue) Line 523      C++
     
comphelper.dll!comphelper::OPropertySetAggregationHelper::setFastPropertyValue(long
 _nHandle, const com::sun::star::uno::Any & _rValue) Line 534       C++
     cppuhelper3MSC.dll!cppu::OPropertySetHelper::setPropertyValue(const 
rtl::OUString & rPropertyName, const com::sun::star::uno::Any & rValue) Line 
266   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!00007ff9dfee3010()       Unknown
     kernel32.dll!00007ffaab01257d()        Unknown
     ntdll.dll!00007ffaac28aa58()   Unknown
    
    No idea what caused the problem only now. But since solar mutex is
    expected to be hold here, let's just do it.
    
    Change-Id: Id848f5f43759ef37faa0d18ed3133a7292b3463f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161504
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/vcl/inc/skia/zone.hxx b/vcl/inc/skia/zone.hxx
index 6d503e7eb803..73fa477d5249 100644
--- a/vcl/inc/skia/zone.hxx
+++ b/vcl/inc/skia/zone.hxx
@@ -13,19 +13,20 @@
 #include <comphelper/crashzone.hxx>
 
 #include <vcl/dllapi.h>
-
-#include <comphelper/solarmutex.hxx>
+#include <vcl/svapp.hxx>
 
 // Used around calls to Skia code to detect crashes in drivers.
 class VCL_DLLPUBLIC SkiaZone : public CrashZone<SkiaZone>
 {
 public:
-    SkiaZone() { assert(comphelper::SolarMutex::get()->IsCurrentThread()); }
     static void hardDisable();
     static void relaxWatchdogTimings();
     static const CrashWatchdogTimingsValues& getCrashWatchdogTimingsValues();
     static void checkDebug(int nUnchanged, const CrashWatchdogTimingsValues& 
aTimingValues);
     static const char* name() { return "Skia"; }
+
+private:
+    SolarMutexGuard g;
 };
 
 #endif // INCLUDED_VCL_INC_SKIA_ZONE_H

Reply via email to