Bug 120342 - Assertion "SolarMutex not owned!" fails when resizing image
Summary: Assertion "SolarMutex not owned!" fails when resizing image
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.2.0.0.alpha0+
Hardware: All macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0 target:6.2.0.1
Keywords:
: 120542 (view as bug list)
Depends on:
Blocks: Crash-Assert
  Show dependency treegraph
 
Reported: 2018-10-05 11:52 UTC by Stephan Bergmann
Modified: 2018-12-14 15:22 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Bergmann 2018-10-05 11:52:50 UTC
At least with a recent local master build (on macOS 10.14), inserted an image in Draw, then tried to resize it by dragging one of the handles on the image's edges with the mouse:

> Assertion failed: (ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && "SolarMutex not owned!"), function ImplDbgTestSolarMutex, file /Users/stephan/Software/lo2/core/vcl/source/app/dbggui.cxx, line 46.

and then soffice hangs at

> * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
>   * frame #0: 0x00007fff606bfc2a libsystem_kernel.dylib`mach_msg_trap + 10
>     frame #1: 0x00007fff606c0174 libsystem_kernel.dylib`mach_msg + 60
>     frame #2: 0x00007fff3345a17c CoreFoundation`__CFRunLoopServiceMachPort + 336
>     frame #3: 0x00007fff334596ca CoreFoundation`__CFRunLoopRun + 1661
>     frame #4: 0x00007fff33458dfa CoreFoundation`CFRunLoopRunSpecific + 467
>     frame #5: 0x00007fff326e4895 HIToolbox`RunCurrentEventLoopInMode + 293
>     frame #6: 0x00007fff326e45cb HIToolbox`ReceiveNextEventCommon + 618
>     frame #7: 0x00007fff326e4348 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64
>     frame #8: 0x00007fff309a195b AppKit`_DPSNextEvent + 997
>     frame #9: 0x00007fff309a06fa AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362
>     frame #10: 0x00000001166a5a5c libvclplug_osxlo.dylib`AquaSalInstance::DoYield(this=0x00007f96f4d18da0, bWait=true, bHandleAllCurrentEvents=false) + 812 at /Users/stephan/Software/lo2/core/vcl/osx/salinst.cxx:553
>     frame #11: 0x000000010f628ebe libvcllo.dylib`ImplYield(i_bWait=true, i_bAllEvents=false) + 430 at /Users/stephan/Software/lo2/core/vcl/source/app/svapp.cxx:469
>     frame #12: 0x000000010f308a32 libvcllo.dylib`Dialog::Execute(this=0x00007f96ff6680f0) + 114 at /Users/stephan/Software/lo2/core/vcl/source/window/dialog.cxx:1028
>     frame #13: 0x000000010c36ab04 libsvxlo.dylib`(anonymous namespace)::RecoveryUI::impl_doEmergencySave(this=<unavailable>) + 148 at /Users/stephan/Software/lo2/core/svx/source/unodraw/recoveryui.cxx:254
>     frame #14: 0x000000010c36a6b0 libsvxlo.dylib`(anonymous namespace)::RecoveryUI::dispatchWithReturnValue(this=0x00007f96fe9d2650, aURL=0x00007ffee604ad10, (null)=<unavailable>) + 112 at /Users/stephan/Software/lo2/core/svx/source/unodraw/recoveryui.cxx:147
>     frame #15: 0x000000010c36a7b2 libsvxlo.dylib`non-virtual thunk to (anonymous namespace)::RecoveryUI::dispatchWithReturnValue(this=<unavailable>, aURL=<unavailable>, lArguments=<unavailable>) + 18 at /Users/stephan/Software/lo2/core/svx/source/unodraw/recoveryui.cxx:0
>     frame #16: 0x0000000109c7aabf libsofficeapp.dylib`desktop::(anonymous namespace)::impl_callRecoveryUI(bEmergencySave=true, bExistsRecoveryData=<unavailable>) + 351 at /Users/stephan/Software/lo2/core/desktop/source/app/app.cxx:1021
>     frame #17: 0x0000000109c7a744 libsofficeapp.dylib`desktop::Desktop::Exception(this=0x00007ffee6050590, nCategory=System) + 228 at /Users/stephan/Software/lo2/core/desktop/source/app/app.cxx:1171
>     frame #18: 0x000000010f631614 libvcllo.dylib`VCLExceptionSignal_impl((null)=<unavailable>, pInfo=<unavailable>) + 244 at /Users/stephan/Software/lo2/core/vcl/source/app/svmain.cxx:173
>     frame #19: 0x0000000109bb8d09 libuno_sal.dylib.3`callSignalHandler(pInfo=0x00007ffee604ae80) + 41 at /Users/stephan/Software/lo2/core/sal/osl/all/signalshared.cxx:60
>     frame #20: 0x0000000109bf2921 libuno_sal.dylib.3`(anonymous namespace)::signalHandlerFunction(signal=6, info=0x00007ffee604b2e8, context=0x00007ffee604b350) + 81 at /Users/stephan/Software/lo2/core/sal/osl/unx/signal.cxx:487
>     frame #21: 0x00007fff60770b3d libsystem_platform.dylib`_sigtramp + 29
>     frame #22: 0x00007fff606c5b87 libsystem_kernel.dylib`__pthread_kill + 11
>     frame #23: 0x00007fff6077bc50 libsystem_pthread.dylib`pthread_kill + 285
>     frame #24: 0x00007fff6062f1c9 libsystem_c.dylib`abort + 127
>     frame #25: 0x00007fff605f7868 libsystem_c.dylib`__assert_rtn + 320
>     frame #26: 0x000000010f5f9000 libvcllo.dylib`ImplDbgTestSolarMutex() + 64 at /Users/stephan/Software/lo2/core/vcl/source/app/dbggui.cxx:46
>     frame #27: 0x000000010ecbd979 libtllo.dylib`DbgTestSolarMutex() + 137 at /Users/stephan/Software/lo2/core/tools/source/debug/debug.cxx:77
>     frame #28: 0x000000010f6166cf libvcllo.dylib`Scheduler::ProcessTaskScheduling() + 47 at /Users/stephan/Software/lo2/core/vcl/source/app/scheduler.cxx:357
>     frame #29: 0x00000001166f0f90 libvclplug_osxlo.dylib`::-[SalFrameView drawRect:](self=0x00007f96fd439d10, _cmd=<unavailable>, aRect=(origin = (x = 0, y = 0), size = (width = 1154, height = 683))) + 112 at /Users/stephan/Software/lo2/core/vcl/osx/salframeview.mm:527
>     frame #30: 0x00007fff30acd205 AppKit`_NSViewDrawRect + 66
>     frame #31: 0x00007fff30acbabd AppKit`-[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:shouldChangeFontReferenceColor:stopAtLayerBackedViews:] + 1545
>     frame #32: 0x00007fff30acb4a2 AppKit`__46-[NSView(NSLayerKitGlue) drawLayer:inContext:]_block_invoke + 192
>     frame #33: 0x00007fff30acb201 AppKit`-[NSView(NSLayerKitGlue) _drawViewBackingLayer:inContext:drawingHandler:] + 1769
>     frame #34: 0x00007fff3e40eaaf QuartzCore`CABackingStoreUpdate_ + 577
>     frame #35: 0x00007fff3e470325 QuartzCore`___ZN2CA5Layer8display_Ev_block_invoke + 53
>     frame #36: 0x00007fff3e40dc90 QuartzCore`-[CALayer _display] + 1839
>     frame #37: 0x00007fff30aca75a AppKit`_NSBackingLayerDisplay + 531
>     frame #38: 0x00007fff30aaecc9 AppKit`-[_NSViewBackingLayer display] + 811
>     frame #39: 0x00007fff3e40d1bc QuartzCore`CA::Layer::display_if_needed(CA::Transaction*) + 634
>     frame #40: 0x00007fff3e3fb447 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 319
>     frame #41: 0x00007fff3e3fad20 QuartzCore`CA::Transaction::commit() + 576
>     frame #42: 0x00007fff30d02927 AppKit`__28-[NSMoveHelper _doAnimation]_block_invoke + 1022
>     frame #43: 0x00007fff30ba4e1b AppKit`-[NSScreenDisplayLink _fire] + 298
>     frame #44: 0x00007fff33478c55 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
>     frame #45: 0x00007fff33478808 CoreFoundation`__CFRunLoopDoTimer + 871
>     frame #46: 0x00007fff3347833d CoreFoundation`__CFRunLoopDoTimers + 333
>     frame #47: 0x00007fff334598d8 CoreFoundation`__CFRunLoopRun + 2187
>     frame #48: 0x00007fff33458dfa CoreFoundation`CFRunLoopRunSpecific + 467
>     frame #49: 0x00007fff30d01c2a AppKit`-[NSMoveHelper _doAnimation] + 1650
>     frame #50: 0x00007fff30d0e1d6 AppKit`-[NSMoveHelper _resizeWindow:toFrame:display:] + 354
>     frame #51: 0x00007fff30a8c258 AppKit`-[NSWindow setFrame:display:animate:] + 1267
>     frame #52: 0x00007fff30d0d329 AppKit`-[NSWindow zoom:] + 768
>     frame #53: 0x00007fff30c9ad03 AppKit`-[NSApplication(NSResponder) sendAction:to:from:] + 312
>     frame #54: 0x00007fff30d05ef2 AppKit`-[NSControl sendAction:to:] + 86
>     frame #55: 0x00007fff30d05e24 AppKit`__26-[NSCell _sendActionFrom:]_block_invoke + 136
>     frame #56: 0x00007fff30d05d26 AppKit`-[NSCell _sendActionFrom:] + 178
>     frame #57: 0x00007fff30d32d8d AppKit`-[NSButtonCell _sendActionFrom:] + 97
>     frame #58: 0x00007fff3132fb14 AppKit`-[_NSThemeZoomWidgetCell _sendActionFrom:] + 71
>     frame #59: 0x00007fff30d47610 AppKit`-[NSButtonCell performClick:] + 680
>     frame #60: 0x00007fff3132f549 AppKit`-[_NSThemeZoomWidgetCell performClick:] + 52
>     frame #61: 0x00007fff30cfee83 AppKit`-[NSTitledFrame _handlePossibleDoubleClickForEvent:] + 234
>     frame #62: 0x00007fff30cfebf4 AppKit`-[NSTitledFrame mouseUp:] + 182
>     frame #63: 0x00007fff31259155 AppKit`-[NSThemeFrame mouseUp:] + 278
>     frame #64: 0x00007fff30bd7de4 AppKit`forwardMethod + 211
>     frame #65: 0x00007fff30bd7de4 AppKit`forwardMethod + 211
>     frame #66: 0x00007fff30b1063c AppKit`-[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 1916
>     frame #67: 0x00007fff30b0fc75 AppKit`-[NSWindow(NSEventRouting) sendEvent:] + 481
>     frame #68: 0x00007fff309acf4c AppKit`-[NSApplication(NSEvent) sendEvent:] + 336
>     frame #69: 0x00000001166f56c1 libvclplug_osxlo.dylib`::-[VCL_NSApplication sendEvent:](self=0x00007f96f4c9a930, _cmd=<unavailable>, pEvent=<unavailable>) + 1185 at /Users/stephan/Software/lo2/core/vcl/osx/vclnsapp.mm:196
>     frame #70: 0x00000001166a5966 libvclplug_osxlo.dylib`AquaSalInstance::DoYield(this=0x00007f96f4d18da0, bWait=true, bHandleAllCurrentEvents=false) + 566 at /Users/stephan/Software/lo2/core/vcl/osx/salinst.cxx:526
>     frame #71: 0x000000010f628ebe libvcllo.dylib`ImplYield(i_bWait=true, i_bAllEvents=false) + 430 at /Users/stephan/Software/lo2/core/vcl/source/app/svapp.cxx:469
>     frame #72: 0x000000010f628c60 libvcllo.dylib`Application::Execute() + 256 at /Users/stephan/Software/lo2/core/vcl/source/app/svapp.cxx:449
>     frame #73: 0x0000000109c7caff libsofficeapp.dylib`desktop::Desktop::Main(this=0x00007ffee6050590) + 4095 at /Users/stephan/Software/lo2/core/desktop/source/app/app.cxx:1635
>     frame #74: 0x000000010f6301d4 libvcllo.dylib`ImplSVMain() + 164 at /Users/stephan/Software/lo2/core/vcl/source/app/svmain.cxx:199
>     frame #75: 0x0000000109cb5386 libsofficeapp.dylib`::soffice_main() + 230 at /Users/stephan/Software/lo2/core/desktop/source/app/sofficemain.cxx:169
>     frame #76: 0x0000000109baff50 soffice`main(argc=<unavailable>, argv=<unavailable>) + 16 at /Users/stephan/Software/lo2/core/desktop/source/app/main.c:47
>     frame #77: 0x00007fff60587085 libdyld.dylib`start + 1
>     frame #78: 0x00007fff60587085 libdyld.dylib`start + 1
Comment 1 Alex Thurgood 2018-10-05 12:18:52 UTC
Hmm, no repro for me with my own master build from last night (04/10):

Version: 6.2.0.0.alpha0+
Build ID: b24ab600b06c4aed43552544b4ef575649c93ee9
CPU threads: 4; OS: Mac OS X 10.13.6; UI render: default; VCL: osx; 
Locale: fr-FR (fr_FR.UTF-8); Calc: threaded

using an inserted TIFF image.

Haven't yet upgraded OS to 10.14
Comment 2 Stephan Bergmann 2018-10-05 12:50:42 UTC
(In reply to Alex Thurgood from comment #1)
> Hmm, no repro for me with my own master build from last night (04/10):

(Note, just in case: you need an --enable-assert-always-abort (i.e., --enable-debug or --enable-dbgutil) build for asserts to actually fire.)
Comment 3 Alex Thurgood 2018-10-05 13:04:28 UTC
(In reply to Stephan Bergmann from comment #2)


> (Note, just in case: you need an --enable-assert-always-abort (i.e.,
> --enable-debug or --enable-dbgutil) build for asserts to actually fire.)

Ah, OK, I only have a --enable-symbols build
Comment 4 Stephan Bergmann 2018-10-09 07:47:19 UTC
Effectively the same happens when you click the green title bar button of e.g. a Calc document window, to maximize that window: AquaSalInstance::DoYield calls [VCL_NSApplication sendEvent:] calls into OS code, gets out at [SalFrameView drawRect:], which calls Scheduler::ProcessTaskScheduling but with the SolarMutex not locked.
Comment 5 Alex Thurgood 2018-10-15 07:12:32 UTC
Confirmed per Tor's report in bug 120542
Comment 6 Alex Thurgood 2018-10-15 07:13:13 UTC
*** Bug 120542 has been marked as a duplicate of this bug. ***
Comment 7 Commit Notification 2018-12-13 17:34:01 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/d59e44bc18bea4bccfa87865200d889f65e10bf1%5E%21

tdf#120342 OSX always lock SolarMutex in drawRect

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Stephan Bergmann 2018-12-14 11:33:34 UTC
Cannot reproduce the asserts from comment 0 and comment 4 in a local (debug) build containing the commit from comment 7 on macOS 10.14.
Comment 9 Commit Notification 2018-12-14 15:22:41 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/7038756003818f9c98866fa30316950172281043%5E%21

tdf#120342 OSX always lock SolarMutex in drawRect

It will be available in 6.2.0.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.