I'm developing a Calc Add-On (using C++ UNO-API), wich has multiple threads modifying several sheets of an open Calc document. So, to give a clean exit upon user's closing requests, a component is registered as XCloseListener of the document (the XCloseBroadcaster). The idea is to veto the close request while any of the Add-On running threads are "bussy" (i.e., producing changes in one or more sheet/s), otherwise, dead-lock conditions are reached (main thread of soffice.bin locks an internal mutex that blocks one or more threads of the Add-On). Digging, I've found that the XCloseBroadcaster queryes the close (i.e., it calls XCloseListener::queryClosing) AFTER it's closed, so any CloseVetoException thrown by the listener has no effect. Indeed, the component implementing the XCloseListener interface, also implements XDocumentEventListener interfece. XDocumentEventListener::XDocumentEventOccured implementation just prints out in console the event occured. As said before, XCloseListener::queryClosing throws CloseVetoException if at least one of Add-On's threads isn't "iddle". In that case, it also prints out a meesage warning that the close query is vetoed. Looking at the output, the proble is clear: [SheetUtilityImpl::documentEventOccured] OnPrepareViewClosing [SheetUtilityImpl::documentEventOccured] OnPrepareUnload [SheetUtilityImpl::documentEventOccured] OnModeChanged [SheetUtilityImpl::documentEventOccured] OnModeChanged [SheetUtilityImpl::documentEventOccured] OnViewClosed [SheetUtilityImpl::documentEventOccured] OnUnload [SheetUtilityImpl::documentEventOccured] OnUnfocus [SheetUtilityImpl::queryClosing] Vetoing closing (executor/s is/are still running...) As can be seen, SheetUtilityImpl::queryClosing is called AFTER the OnUnload event (i.e., after the document has been effectively closed). So, the veto thrown is ignored. I have tested it only on linux. Soon I'll test it on Windows. Is there a cahnce to fix it on next release 7.5.x?
Can you attach an example extension that shows this?
Created attachment 188253 [details] Sample add-on and testing app
(In reply to Cesar from comment #2) > Created attachment 188253 [details] > Sample add-on and testing app Thanks. I didn't know exactly what to do so I 1. Installed testCloseVeto/dist/testCloseVeto.oxt 2. Modified testCloseVetoLaunch/dist/runDefault.sh so OFFICE_HOME and PKG_INSTALL_DIR pointed to the correct places Running runDefault.sh caused a crash and in logdefault.txt I see warn:io.connector:71657:71657:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno12081109122261949318019018331151112221168215": 10 warn:io.connector:71657:71657:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno12081109122261949318019018331151112221168215": 10 warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:904: ignoring modify of unknown set member node ".uno:DeleteRows" in "file:///home/user/libreoffice/instdir/program/../share/registry/res/registry_qtz.xcd" warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:904: ignoring modify of unknown set member node ".uno:DeleteRows" in "file:///home/user/libreoffice/instdir/program/../share/registry/res/registry_ru.xcd" warn:io.connector:71657:71657:io/source/connector/connector.cxx:93: Connector : couldn't connect to pipe "uno12081109122261949318019018331151112221168215": 10 warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:904: ignoring modify of unknown set member node ".uno:DeleteRows" in "file:///home/user/libreoffice/instdir/program/../share/registry/res/registry_pl.xcd" warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:159: bad set node <prop> member in "file:///home/user/libreoffice/instdir/program/../program/../user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu1xnzi.tmp/Addons_AOO4.xcu" warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:904: ignoring modify of unknown set member node "ToolBarItems" in "file:///home/user/libreoffice/instdir/program/../program/../user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu1xnzi.tmp/Addons_AOO4.xcu" warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:159: bad set node <prop> member in "file:///home/user/libreoffice/instdir/program/../program/../user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu1xnzh.tmp/Addons.xcu" Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-11-openjdk/lib/libnio.so: /usr/lib/jvm/java-11-openjdk/lib/libnio.so: undefined symbol: reuseport_available at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) and then a huge Java trace. Any tips? Arch Linux 64-bit, X11 Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 445ab2355333ddb46081baffb8b0e3bb14fe00b3 CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb) Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: threaded Built on 7 July 2023
(In reply to Buovjaga from comment #3) > (In reply to Cesar from comment #2) > > Created attachment 188253 [details] > > Sample add-on and testing app > > Thanks. I didn't know exactly what to do so I > > 1. Installed testCloseVeto/dist/testCloseVeto.oxt > 2. Modified testCloseVetoLaunch/dist/runDefault.sh so OFFICE_HOME and > PKG_INSTALL_DIR pointed to the correct places > > Running runDefault.sh caused a crash and in logdefault.txt I see > > warn:io.connector:71657:71657:io/source/connector/connector.cxx:93: > Connector : couldn't connect to pipe > "uno12081109122261949318019018331151112221168215": 10 > warn:io.connector:71657:71657:io/source/connector/connector.cxx:93: > Connector : couldn't connect to pipe > "uno12081109122261949318019018331151112221168215": 10 > warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:904: ignoring > modify of unknown set member node ".uno:DeleteRows" in > "file:///home/user/libreoffice/instdir/program/../share/registry/res/ > registry_qtz.xcd" > warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:904: ignoring > modify of unknown set member node ".uno:DeleteRows" in > "file:///home/user/libreoffice/instdir/program/../share/registry/res/ > registry_ru.xcd" > warn:io.connector:71657:71657:io/source/connector/connector.cxx:93: > Connector : couldn't connect to pipe > "uno12081109122261949318019018331151112221168215": 10 > warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:904: ignoring > modify of unknown set member node ".uno:DeleteRows" in > "file:///home/user/libreoffice/instdir/program/../share/registry/res/ > registry_pl.xcd" > warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:159: bad set node > <prop> member in > "file:///home/user/libreoffice/instdir/program/../program/../user/ > uno_packages/cache/registry/com.sun.star.comp.deployment.configuration. > PackageRegistryBackend/lu1xnzi.tmp/Addons_AOO4.xcu" > warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:904: ignoring > modify of unknown set member node "ToolBarItems" in > "file:///home/user/libreoffice/instdir/program/../program/../user/ > uno_packages/cache/registry/com.sun.star.comp.deployment.configuration. > PackageRegistryBackend/lu1xnzi.tmp/Addons_AOO4.xcu" > warn:configmgr:71688:71688:configmgr/source/xcuparser.cxx:159: bad set node > <prop> member in > "file:///home/user/libreoffice/instdir/program/../program/../user/ > uno_packages/cache/registry/com.sun.star.comp.deployment.configuration. > PackageRegistryBackend/lu1xnzh.tmp/Addons.xcu" > Exception in thread "main" java.lang.UnsatisfiedLinkError: > /usr/lib/jvm/java-11-openjdk/lib/libnio.so: > /usr/lib/jvm/java-11-openjdk/lib/libnio.so: undefined symbol: > reuseport_available > at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method) > > and then a huge Java trace. > > Any tips? > > Arch Linux 64-bit, X11 > Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community > Build ID: 445ab2355333ddb46081baffb8b0e3bb14fe00b3 > CPU threads: 8; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb) > Locale: fi-FI (fi_FI.UTF-8); UI: en-US > Calc: threaded > Built on 7 July 2023 First, you did right using runDefault.sh (redirecting OFFICE_HOME and PKG_INSTALL_DIR). At least, that is what it was meant to be. I really don't know what is causing the crash. I can`t recognize any of the error/warning messages as part of the add-on. I would search lu1xnzh package at ~/.config/libreoffice/4/user/uno_packages/cache/uno_packages/ to see what extension is complaining. If you can, you might disable it while testing my app. Alternatively, if you have an application or Calc extension of your own, you might try to create an instance of com.example.TestCloseVeto (just like testCloseVetoLaunch does), and register it as XDocumenrEventListener and XCloseListener of the SpreadsheetDocument instance.
Dear Cesar, 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