Bug 146478 - vcldemo and other vcl examples exit with: "Aborted (core dumped)"
Summary: vcldemo and other vcl examples exit with: "Aborted (core dumped)"
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-29 19:46 UTC by Hossein
Modified: 2024-01-22 03:11 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 2021-12-29 19:46:16 UTC
Description:
When I start vcldemo from the LibreOffice source folder:

./bin/run vcldemo

and then close the application by clicking on the x button on the window, I get:

(/lo/core is the LO source folder)

vcldemo: /lo/core/framework/source/services/desktop.cxx:1045: virtual void framework::Desktop::disposing(): Assertion `m_bIsShutdown && "Desktop disposed before terminating it"' failed.
Aborted (core dumped)

This is the same for mtfdemo, and other vcl applications. This does not only happen in Linux, but also in Windows.

The same happen for the vcl example that I am writing, when disposing context:

125124: Minimal vcl application
https://gerrit.libreoffice.org/c/core/+/125124

    css::uno::Reference<css::lang::XComponent>(xContext, css::uno::UNO_QUERY_THROW)->dispose();
    comphelper::setProcessServiceFactory(nullptr);

Note: When I remove the dispose() invocation, the abort message goes away.

This is the stack trace for 'vcldemo' created with gdb:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff48d4859 in __GI_abort () at abort.c:79
#2  0x00007ffff48d4729 in __assert_fail_base (
    fmt=0x7ffff4a6a588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=0x7fffdbc7cb50 "m_bIsShutdown && \"Desktop disposed before terminating it\"", 
    file=0x7fffdbc7cb00 "/lo/core/framework/source/services/desktop.cxx", line=1045, function=<optimized out>)
    at assert.c:92
#3  0x00007ffff48e5f36 in __GI___assert_fail (
    assertion=0x7fffdbc7cb50 "m_bIsShutdown && \"Desktop disposed before terminating it\"", 
    file=0x7fffdbc7cb00 "/lo/core/framework/source/services/desktop.cxx", line=1045, 
    function=0x7fffdbc7cad0 "virtual void framework::Desktop::disposing()")
    at assert.c:101
#4  0x00007fffdb94b395 in framework::Desktop::disposing (
    this=0x555557205630)
    at /lo/core/framework/source/services/desktop.cxx:1045
#5  0x00007ffff73593e1 in cppu::WeakComponentImplHelperBase::dispose (this=0x555557205630) at /lo/core/cppuhelper/source/implbase.cxx:104
#6  0x00007fffdb957474 in cppu::PartialWeakComponentImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::frame::XDesktop2, com::sun::star::frame::XTasksSupplier, com::sun::star::frame::XDispatchResultListener, com::sun::star::task::XInteractionHandler, com::sun::star::frame::XUntitledNumbers>::dispose (this=0x555557205630) at /lo/core/include/cppuhelper/compbase.hxx:90
#7  0x00007ffff73b132e in cppuhelper::ServiceManager::disposing (this=0x55555560e590) at /lo/core/cppuhelper/source/servicemanager.cxx:920
#8  0x00007ffff73593e1 in cppu::WeakComponentImplHelperBase::dispose (this=0x55555560e590) at /lo/core/cppuhelper/source/implbase.cxx:104
#9  0x00007ffff7349a20 in cppu::PartialWeakComponentImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::lang::XMultiServiceFactory, com::sun::star::lang::XMultiComponentFactory, com::sun::star::container::XSet, com::sun::star::container::XContentEnumerationAccess, com::sun::star::beans::XPropertySet, com::sun::star::beans::XPropertySetInfo, com::sun::star::lang::XEventListener, com::sun::star::lang::XInitialization>::dispose (this=0x55555560e590) at /lo/core/include/cppuhelper/compbase.hxx:90
#10 0x00007ffff732a1c8 in cppu::try_dispose (xInstance=...) at /lo/core/cppuhelper/source/component_context.cxx:64
#11 0x00007ffff732c595 in cppu::(anonymous namespace)::ComponentContext::disposing (this=0x55555573cd60) at /lo/core/cppuhelper/source/component_context.cxx:430
#12 0x00007ffff73593e1 in cppu::WeakComponentImplHelperBase::dispose (this=0x55555573cd60) at /lo/core/cppuhelper/source/implbase.cxx:104
#13 0x00007ffff733ff32 in cppu::PartialWeakComponentImplHelper<com::sun::star::uno::XComponentContext, com::sun::star::container::XNameContainer>::dispose (this=0x55555573cd60) at /lo/core/include/cppuhelper/compbase.hxx:90
#14 0x0000555555578c9b in (anonymous namespace)::DemoApp::DeInit (this=0x5555555ba160 <vclmain::createApplication()::aApp>) at /lo/core/vcl/workben/vcldemo.cxx:2245
#15 0x00007ffff5c3fd51 in DeInitVCL () at /lo/core/vcl/source/app/svmain.cxx:525
#16 0x00007ffff5c3eb83 in ImplSVMain () at /lo/core/vcl/source/app/svmain.cxx:224
#17 0x00007ffff5c3ebd3 in SVMain () at /lo/core/vcl/source/app/svmain.cxx:231
#18 0x0000555555594361 in sal_main () at /lo/core/vcl/source/salmain/salmain.cxx:34
#19 0x0000555555594338 in main (argc=1, argv=0x7fffffffdb98) at /lo/core/vcl/source/salmain/salmain.cxx:29


Steps to Reproduce:
1. Compile LibreOffice from the sources
2. Start 'vcldemo' from the source folder using './bin/run vcldemo'
3. Close the application by clicking on the x button on the window

Actual Results:
'vcldemo' exits with: "Aborted (core dumped)"

Expected Results:
The 'vcldemo' should exit cleanly.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: aecd4a6f57301d088bf0fdd7cc40fbdea8eab649
CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 2a881af4e93f8744bc6bea43f3a06fa531626c22
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 1 Julien Nabet 2021-12-30 17:45:25 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

I noticed these logs:
warn:i18nlangtag:1855739:1855739:i18nlangtag/source/isolang/mslangid.cxx:105: MsLangId::getConfiguredSystemLanguage() - not configured yet
warn:vcl:1855739:1855739:vcl/source/image/ImplImageTree.cxx:603: ImplImageTree::parseLinkFile: icon links.txt parse error, incomplete link at line 2643
warn:i18nlangtag:1855739:1855739:i18nlangtag/source/isolang/mslangid.cxx:105: MsLangId::getConfiguredSystemLanguage() - not configured yet
DemoWin::Paint(0,0,1804,979)
DemoWin::Paint(0,0,1804,979)
DemoWin::Paint(0,0,1919,1010)
DemoWin::Paint(0,0,1919,1010)
DemoWin::Paint(0,0,1919,1010)
DemoWin::Paint(0,0,1919,1010)
DemoWin::Paint(0,0,1919,1010)
DemoWin::Paint(0,0,1919,1010)
vcldemo: /home/julien/lo/libreoffice/framework/source/services/desktop.cxx:1045: virtual void framework::Desktop::disposing(): Assertion `m_bIsShutdown && "Desktop disposed before terminating it"' failed.
Abandon
Comment 2 Julien Nabet 2021-12-30 17:57:22 UTC
Just for info, concerning warn:vcl:1855739:1855739:vcl/source/image/ImplImageTree.cxx:603: ImplImageTree::parseLinkFile: icon links.txt parse error, incomplete link at line 2643, I submitted this patch:
https://gerrit.libreoffice.org/c/core/+/127760
Comment 3 Chris Sherlock 2021-12-30 20:47:33 UTC
Happens on MacOS also.
Comment 4 Chris Sherlock 2021-12-30 20:51:32 UTC
The warning:

warn:i18nlangtag:1855739:1855739:i18nlangtag/source/isolang/mslangid.cxx:105: MsLangId::getConfiguredSystemLanguage() - not configured yet

Just needs to have the following added to vcldemo's init function:

LanguageTag::setConfiguredSystemLanguage(MsLangId::getSystemLanguage());
Comment 5 Chris Sherlock 2021-12-30 20:57:37 UTC
So this commit changed the SAL_WARN to an assert():

https://cgit.freedesktop.org/libreoffice/core/commit/framework/source/services/desktop.cxx?id=6e35794cad555485955c3b43593497dcdbf29840

author	Noel Grandin <noel.grandin@collabora.co.uk>	2020-07-27 11:06:41 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	2020-07-30 10:49:27 +0200
commit 6e35794cad555485955c3b43593497dcdbf29840 (patch)
tree 430c0299f21fb62faf6d0ba5e04410fafdda14d2 /framework/source/services/desktop.cxx
parent a6e02f6337f038a445b858bb91bf14d1a14768e4 (diff)
terminate XDesktop properly in unit tests
So that the UNO constructor work can continue - where we need the
desktop to be disposed properly so that all UNO constructors objects
have their dispose() called, and they can clean up their global state.

We detect this case by changing a SAL_WARN to an assert in
Desktop::disposing()

(*) in ~ScTabViewShell, don't call EnterHandler, because that tries to
create EditEngine's and other stuff, which crashes
(*) Need a fake singleton so that the servicemanager calls dispose()
 on the AnalysAddIn and we can clear the global variable there.

Change-Id: Id13b51e17afc16fcbbc65d64281cdf847e4a58cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99640
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Comment 6 Chris Sherlock 2021-12-30 21:00:17 UTC
Hi Noel, changing to an assert() seems to have caused problems for vcldemo amd mtfdemo (which we use for dumping metafiles to XML format).
Comment 7 Commit Notification 2022-01-21 11:44:22 UTC
Chris Sherlock committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/fced837029123f34a125f5a794e5681ed297fc2a

tdf#146478 vcl: vcldemo and other vcl examples segfault on close

It will be available in 7.4.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 QA Administrators 2024-01-22 03:11:58 UTC
Dear Hossein,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug