Bug 166219 - LibreOfficeKit crashes after exiting the application that uses it
Summary: LibreOfficeKit crashes after exiting the application that uses it
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Crash LibreOfficeKit
  Show dependency treegraph
 
Reported: 2025-04-17 08:43 UTC by Hossein
Modified: 2025-09-18 12:41 UTC (History)
2 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 2025-04-17 08:43:58 UTC
Description:
While testing gtktiledviewer, I faced the issue that in recent versions, LibreOfficeKit crashes after exiting the application that uses it.

Steps to Reproduce:
1. Build LO master from sources
2. Create a blank document, for example:
$ touch /tmp/test.odt

3. Open the test file with gtktiledveiwer:
$ bin/run gtktiledviewer --lo-path=$PWD/instdir/program /tmp/blank.odt

4. Close it immediately by clicking on x button

Actual Results:
LibreOfficeKit crashes. This is the stack trace (and warnings):

gtktiledviewer: ~/core/vcl/source/app/dbggui.cxx:36: void ImplDbgTestSolarMutex(bool): Assertion `ImplGetSVData()->mpDefInst->GetYieldMutex()->IsCurrentThread() && "SolarMutex not owned!"' failed.


Fatal exception: Signal 6
Stack:
#0 sal::backtrace_get(unsigned int) in ~/core/instdir/program/libuno_sal.so.3
#1 (anonymous namespace)::printStack(int) at signal.cxx:?
#2 (anonymous namespace)::callSystemHandler(int, siginfo_t*, void*) at signal.cxx:?
#3 (anonymous namespace)::signalHandlerFunction(int, siginfo_t*, void*) at signal.cxx:?
#4 __restore_rt at libc_sigaction.c:?
#5 __pthread_kill_implementation at ./nptl/pthread_kill.c:44
#6 __GI_raise at ./signal/../sysdeps/posix/raise.c:27
#7 __GI_abort at ./stdlib/abort.c:81 (discriminator 21)
#8 _nl_load_domain at ./intl/loadmsgcat.c:1177
#9 __GI___assert_fail at :?
#10 ImplDbgTestSolarMutex(bool) at dbggui.cxx:?
#11 DbgTestSolarMutex(bool) in ~/core/instdir/program/libtllo.so
#12 SwModify::~SwModify() in ~/core/instdir/program/../program/libswlo.so
#13 sw::BroadcastingModify::~BroadcastingModify() at crtstuff.c:?
#14 SwFormatField::~SwFormatField() in ~/core/instdir/program/../program/libswlo.so
#15 SwFormatField::~SwFormatField() in ~/core/instdir/program/../program/libswlo.so
#16 std::default_delete<SfxPoolItem const>::operator()(SfxPoolItem const*) const at crtstuff.c:?
#17 std::unique_ptr<SfxPoolItem const, std::default_delete<SfxPoolItem const> >::~unique_ptr() at crtstuff.c:?
#18 ItemInfoStatic::~ItemInfoStatic() at crtstuff.c:?
#19 std::array<ItemInfoStatic, 159ul>::~array() at crtstuff.c:?
#20 getItemInfoPackageSwAttributes()::ItemInfoPackageSwAttributes::~ItemInfoPackageSwAttributes() at init.cxx:?
#21 getItemInfoPackageSwAttributes()::ItemInfoPackageSwAttributes::~ItemInfoPackageSwAttributes() at init.cxx:?
#22 std::default_delete<getItemInfoPackageSwAttributes()::ItemInfoPackageSwAttributes>::operator()(getItemInfoPackageSwAttributes()::ItemInfoPackageSwAttributes*) const at init.cxx:?
#23 std::unique_ptr<getItemInfoPackageSwAttributes()::ItemInfoPackageSwAttributes, std::default_delete<getItemInfoPackageSwAttributes()::ItemInfoPackageSwAttributes> >::~unique_ptr() at init.cxx:?
#24 __run_exit_handlers at ./stdlib/exit.c:114
#25 __on_exit at ./stdlib/on_exit.c:26
#26 __libc_start_call_main at ./csu/../sysdeps/nptl/libc_start_call_main.h:63
#27 call_init at ./csu/../csu/libc-start.c:128
#28 _start in ~/core/workdir/LinkTarget/Executable/gtktiledviewer
Aborted (core dumped)


Expected Results:
LibreOfficeKit should not crash.


Reproducible: Always


User Profile Reset: No

Additional Info:
The problem happens in the latest master build:

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3c9fdd9aeb74d76ef7f1c0581582439c8a135532
CPU threads: 12; OS: Linux 6.2; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL threaded

But it was not like this before. It seems to be fine with the LO 25.2 stable.
Comment 1 Miklos Vajna 2025-04-17 11:04:34 UTC
I can reproduce this. It would be ideal to fix this, though this is not too relevant: the two main LOK clients are the Android viewer and COOL, and I think neither of them does an actual shutdown like this. Android just kills the app when it's garbage collected and COOL does an std::_Exit() anyway.