Bug 153554 - Crash when closing LibreOffice opened via SDK (debug)
Summary: Crash when closing LibreOffice opened via SDK (debug)
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: haveBacktrace
Depends on:
Blocks: Crash-Assert Skia
  Show dependency treegraph
 
Reported: 2023-02-11 18:25 UTC by Hossein
Modified: 2023-05-02 19:38 UTC (History)
3 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 Hossein 2023-02-11 18:25:44 UTC
Description:
When opening a LibreOffice process via SDK bootstrapping, closing a window can lead to LibreOffice crash.

Steps to Reproduce:
1. Compile LibreOffice from sources.

2. Copy the HelloTextTableShape.py from here:
https://gerrit.libreoffice.org/c/core/+/146819/1/odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.py

3. Invoke 
$ instdir/program/python odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.py

4. After the 3 LibreOffice windows are opened, close one of them. It leads to crash.

Actual Results:
Crash. You can open LibreOffice again to see the crash recovery window:
$ instdir/program/soffice

Expected Results:
LibrOffice should not crash.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: a942e6e5ecfdd9ff83fc7febb8234c8f0e2813db
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fa-IR (fa_IR); UI: en-US
Calc: threaded
Comment 1 Julien Nabet 2023-02-12 08:33:08 UTC
Giving it a try, I got:
./instdir/program/python odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.py 
  File "odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.py", line 1
    <!DOCTYPE html>
    ^
SyntaxError: invalid syntax
Comment 3 Julien Nabet 2023-02-12 09:48:23 UTC
(In reply to Werner Tietz from comment #2)
> @Julien Nabet:
> https://gerrit.libreoffice.org/changes/core~146819/revisions/1/files/
> odk%2Fexamples%2FDevelopersGuide%2FFirstSteps%2FHelloTextTableShape.py/
> download

I got:
julien@debianamd:~/lo/libreoffice$ ./instdir/program/python odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.py 
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
warn:io.connector:43027:43027:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno030749368190779003": 10
Traceback (most recent call last):
  File "/home/julien/lo/libreoffice/instdir/program/officehelper.py", line 72, in bootstrap
    xContext = resolver.resolve(sConnect)
uno.com.sun.star.connection.NoConnectException: Connector : couldn't connect to pipe "uno030749368190779003": 10 at /home/julien/lo/libreoffice/io/source/connector/connector.cxx:94

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "odk/examples/DevelopersGuide/FirstSteps/HelloTextTableShape.py", line 38, in get_remote_service_manager
    self.remote_context = officehelper.bootstrap()
  File "/home/julien/lo/libreoffice/instdir/program/officehelper.py", line 77, in bootstrap
    raise BootstrapException("Cannot connect to soffice server.", None)
officehelper.BootstrapException: Cannot connect to soffice server.
Comment 4 Hossein 2023-02-12 11:35:17 UTC
@Julien:
Could you actually see the LibreOffice windows opened? And, do you have LibreOffice compiled and available? You should be able to run LibreOffice 7.6 dev with:

$ instdir/program/soffice
Comment 5 Julien Nabet 2023-02-12 11:43:36 UTC
(In reply to Hossein from comment #4)
> @Julien:
> Could you actually see the LibreOffice windows opened? And, do you have
> LibreOffice compiled and available? You should be able to run LibreOffice
> 7.6 dev with:
> 
> $ instdir/program/soffice

I see no window.
Here's my autogen.input:
CC=clang
CXX=clang++
--enable-ld=lld
#--with-webdav=curl
--enable-online-update
--with-privacy-policy-url=https://yourdomain/privacy-policy
--enable-compiler-plugins
--enable-dbgutil
--enable-evolution2
#--enable-gtk4
--enable-qt5
--enable-kf5
--enable-gtk3-kde5
# pour tester build rpm format
--enable-skia=debug
--enable-ext-nlpsolver
--enable-ext-numbertext
--enable-ext-wiki-publisher
--enable-dbus
--enable-werror
--enable-dependency-tracking
--enable-python=fully-internal
--without-system-mariadb
--enable-bundle-mariadb
--enable-symbols
--enable-avahi
--enable-eot
--enable-odk
--with-lang=en-US de es fr hu it ja nl pt pt-BR ru
#--with-lang=ALL
--with-myspell-dicts
#--with-help
and build is ok, I can start any LO module.
Perhaps it's just due to the fact I don't know anything about SDK.
Comment 6 Stéphane Guillou (stragu) 2023-02-13 15:28:48 UTC
I could not reproduce the crash using the latest build from the linux-64-7.5 bibisect repo:

Version: 7.5.0.1.0+ (X86_64) / LibreOffice Community
Build ID: bf6072fd1866bfccee6147bbb776ffcc466c308d
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Couldn't either with a master build from a few days ago, installed from our dailies:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4a0d671706306661c4a5072ce4769dc47bc65f71
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

While running, I got a few warnings (some of them already commonly seen as console noise):

warn:io.connector:314384:314384:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno6529023545289012": 10
[...]
warn:sal.osl:314417:314430:sal/osl/unx/module.cxx:103: dlopen(/opt/libreofficedev7.6/program/libjava_gcc3.so, 257): /opt/libreofficedev7.6/program/libjava_gcc3.so: cannot open shared object file: No such file or directory
[...]
warn:sfx.control:314417:314430:sfx2/source/control/dispatch.cxx:1206: Childwindow slot missing: 25917
[...]
warn:legacy.tools:314417:314456:sfx2/source/control/bindings.cxx:1770: No cache for OfficeDispatch!
[...]
warn:sd:314417:314417:sd/source/ui/unoidl/DrawController.cxx:784: Calling disposed DrawController object. Throwing exception:
[...]
warn:legacy.osl:314417:314417:sc/source/ui/view/tabvwshh.cxx:232: no accessibility broadcaster?
[...]
warn:unotools.config:314417:314417:unotools/source/config/configmgr.cxx:147: ConfigManager not empty
Comment 7 Hossein 2023-02-18 12:43:46 UTC
This does not happen in Linux, so it seems to be a Windows-only problem.

Not reproducible on Linux:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5b9855acc7fa6d1e4a5f53ff0bc47e1dd4729827
CPU threads: 8; OS: Linux 5.19; UI render: default; VCL: x11
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

But the problem is still reproducible on Windows:
Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5b9855acc7fa6d1e4a5f53ff0bc47e1dd4729827
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fa-IR (fa_IR); UI: en-US
Calc: threaded
Comment 8 Stéphane Guillou (stragu) 2023-03-02 08:39:53 UTC
Could not reproduce on Windows 10 either:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5a235634ca5761aa4b330ebf7e3a2083b7db1606
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-GB
Calc: threaded

No crash after closing one of the three windows and saying "No" to saving the file. I only got a UI refresh issue which requires hovering over buttons or resizing the window to make parts of the UI appear.

I see the same "warn:io.connector" warnings as Julien.
Comment 9 Hossein 2023-03-02 22:26:17 UTC
Tested with another Windows 10 instance, and the same problem was there. Here is the console output:

$ instdir/program/python HelloTextTableShape.py
warn:io.connector:5396:9860:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno2882509348717913": 1
warn:io.connector:5396:9860:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno2882509348717913": 1
warn:io.connector:5396:9860:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno2882509348717913": 1
warn:io.connector:5396:9860:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno2882509348717913": 1
warn:io.connector:5396:9860:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno2882509348717913": 1
warn:io.connector:5396:9860:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno2882509348717913": 1
Connected to a running office ...
153
warn:io.connector:5396:9860:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno5734024485250353": 1
warn:io.connector:5396:9860:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno5734024485250353": 1
warn:binaryurp:5396:9860:binaryurp/source/bridge.cxx:845: undisposed bridge "" in state 2, potential deadlock ahead
Connected to a running office ...
153
warn:io.connector:5396:9860:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno06361373529997805": 1
warn:io.connector:5396:9860:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno06361373529997805": 1
warn:binaryurp:5396:9860:binaryurp/source/bridge.cxx:845: undisposed bridge "" in state 2, potential deadlock ahead
Connected to a running office ...


Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e34074feeb1b918ab9f26a18c5fdb0b1f2e35f94
CPU threads: 32; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: threaded
Comment 10 Hossein 2023-04-08 15:30:50 UTC
I still get this warning:

warn:binaryurp:85662:85688:binaryurp/source/bridge.cxx:842: undisposed bridge "" in state 2, potential deadlock ahead

But not a crash with LO 7.5 and 7.6 dev master (Wayland):

Version: 7.5.1.2 (X86_64) / LibreOffice Community
Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129
CPU threads: 12; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL threaded

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 76a413aaf978cfa2b672299ea030ca96088ca786
CPU threads: 12; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL threaded
Comment 11 Hossein 2023-04-09 04:00:25 UTC
The problem still happens in the latest LO 7.6 dev on Windows:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 912336f3c85d9a631fa0ac0f270bab04b204f619
CPU threads: 32; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: threaded
Comment 12 Hossein 2023-04-11 10:30:26 UTC
It seems that this is a debug only problem, because it works fine with the release binaries of 7.5:

    c:\Progra~1\LibreOffice\program\python.exe HelloTextTableShape.py

Version: 7.5.1.2 (X86_64) / LibreOffice Community
Build ID: fcbaee479e84c6cd81291587d2ee68cba099e129
CPU threads: 32; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: threaded
Comment 13 Hossein 2023-05-02 09:27:40 UTC
The problem seems to be from LibreOffice Skia code. This is the backtrace I have created by attaching the VS debugger to the soffice.bin process:

vcl/skia/gdiimpl.cxx:290
---------------
SkiaSalGraphicsImpl::~SkiaSalGraphicsImpl()
{
    assert(!mSurface); <- Exception thrown from here
    assert(!mWindowContext);
}

---------------
 	ucrtbased.dll!00007ffa7f037475()	Unknown
 	ucrtbased.dll!00007ffa7f037613()	Unknown
 	ucrtbased.dll!00007ffa7f04d86d()	Unknown
 	ucrtbased.dll!00007ffa7f0530bf()	Unknown
 	ucrtbased.dll!00007ffa7f0510b8()	Unknown
 	ucrtbased.dll!00007ffa7f053a1f()	Unknown
>	vcllo.dll!SkiaSalGraphicsImpl::~SkiaSalGraphicsImpl() Line 290	C++
 	[External Code]	
 	vclplug_winlo.dll!WinSalGraphics::~WinSalGraphics() Line 668	C++
 	[External Code]	
 	vclplug_winlo.dll!WinSalFrame::~WinSalFrame() Line 969	C++
 	[External Code]	
 	vclplug_winlo.dll!SalComWndProc(HWND__ * __formal, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 666	C++
 	vclplug_winlo.dll!SalComWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 723	C++
 	[External Code]	
 	vclplug_winlo.dll!WinSalInstance::DestroyFrame(SalFrame * pFrame) Line 805	C++
 	vcllo.dll!vcl::Window::dispose() Line 537	C++
 	vcllo.dll!ImplBorderWindow::dispose() Line 1607	C++
 	vcllo.dll!VclReferenceBase::disposeOnce() Line 39	C++
 	vcllo.dll!VclPtr<vcl::Window>::disposeAndClear() Line 207	C++
 	vcllo.dll!vcl::Window::dispose() Line 509	C++
 	vcllo.dll!SystemWindow::dispose() Line 115	C++
 	vcllo.dll!WorkWindow::dispose() Line 128	C++
 	vcllo.dll!VclReferenceBase::disposeOnce() Line 39	C++
 	tklo.dll!VclPtr<vcl::Window>::disposeAndClear() Line 207	C++
 	tklo.dll!VCLXWindow::dispose() Line 927	C++
 	fwklo.dll!`anonymous namespace'::XFrameImpl::disposing() Line 2199	C++
 	cppuhelper3MSC.dll!cppu::WeakComponentImplHelperBase::dispose() Line 104	C++
 	fwklo.dll!cppu::PartialWeakComponentImplHelper<com::sun::star::lang::XServiceInfo,com::sun::star::frame::XFrame2,com::sun::star::awt::XWindowListener,com::sun::star::awt::XTopWindowListener,com::sun::star::awt::XFocusListener,com::sun::star::document::XActionLockable,com::sun::star::util::XCloseable,com::sun::star::frame::XComponentLoader,com::sun::star::frame::XTitle,com::sun::star::frame::XTitleChangeBroadcaster,com::sun::star::beans::XPropertySet,com::sun::star::beans::XPropertySetInfo>::dispose() Line 90	C++
 	fwklo.dll!`anonymous namespace'::XFrameImpl::close(unsigned char bDeliverOwnership) Line 1733	C++
 	fwklo.dll!framework::pattern::frame::closeIt(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface> & xResource) Line 57	C++
 	fwklo.dll!framework::CloseDispatcher::implts_closeFrame() Line 500	C++
 	fwklo.dll!framework::CloseDispatcher::impl_asyncCallback(LinkParamNone * __formal) Line 379	C++
 	fwklo.dll!framework::CloseDispatcher::LinkStubimpl_asyncCallback(void * instance, LinkParamNone * data) Line 246	C++
 	vcllo.dll!Link<LinkParamNone *,void>::Call(LinkParamNone * data) Line 111	C++
 	vcllo.dll!vcl::EventPoster::DoEvent_Impl(void * __formal) Line 53	C++
 	vcllo.dll!vcl::EventPoster::LinkStubDoEvent_Impl(void * instance, void * data) Line 48	C++
 	vcllo.dll!Link<void *,void>::Call(void * data) Line 111	C++
 	vcllo.dll!ImplHandleUserEvent(ImplSVEvent * pSVEvent) Line 2290	C++
 	vcllo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent, const void * pEvent) Line 2858	C++
 	vcllo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent) Line 309	C++
 	vclplug_winlo.dll!ImplHandleUserEvent(HWND__ * hWnd, __int64 lParam) Line 4252	C++
 	vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 5903	C++
 	vclplug_winlo.dll!SalFrameWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 6010	C++
 	[External Code]	
 	vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg) Line 474	C++
 	vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 505	C++
 	vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 580	C++
 	vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 385	C++
 	vcllo.dll!Application::Yield() Line 470	C++
 	vcllo.dll!Application::Execute() Line 363	C++
 	sofficeapp.dll!desktop::Desktop::Main() Line 1593	C++
 	vcllo.dll!ImplSVMain() Line 203	C++
 	vcllo.dll!SVMain() Line 236	C++
 	sofficeapp.dll!soffice_main() Line 94	C++
 	soffice.bin!sal_main() Line 51	C
 	soffice.bin!main(int argc, char * * argv) Line 49	C
 	[External Code]
Comment 14 Hossein 2023-05-02 09:34:03 UTC
The problem is from Skia, as the surface is not disposed in SkiaSalGraphicsImpl::~SkiaSalGraphicsImpl() for some reason. By disabling Skia, the problem is no longer there.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bcd233e45f1d793555e29522d1c30b67c574b628
CPU threads: 32; OS: Windows 10.0 Build 19044; UI render: default; VCL: win
Locale: en-US (en_DE); UI: en-US
Calc: threaded