Bug 146852 - Opening Tools-Options slow because it checks GnuPG port at local computer
Summary: Opening Tools-Options slow because it checks GnuPG port at local computer
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisectRequest, regression
Depends on:
Blocks: Performance
  Show dependency treegraph
 
Reported: 2022-01-19 09:39 UTC by Timur
Modified: 2024-04-18 14:23 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 Timur 2022-01-19 09:39:44 UTC
Opening Tools-Options is slower because it checks GnuPG port 50xyz at local computer, and very slow if that's disabled in firewall.
Seems that it didn't happen in older LO up to 6.0 but started in 6.1 and is here in 7.4+. Test in Windows.
I don't know what it real does. Not related to Experimental features.
Comment 1 V Stuart Foote 2022-01-19 14:36:41 UTC
I've seen the slow opening of Tools -> Options for some time, but can't catch it when attached to WinDbg. What ever causes it is annoyingly transient...
Comment 2 V Stuart Foote 2022-01-23 14:40:34 UTC
on a hung Tools -> Options on a recent master, minimal symbols. Still looking to catch it on a release build.

With WinDbg note this module loaded:

ModLoad: 00007fff`b4600000 00007fff`b46e0000   C:\LODev740_x64_20220117_TB77\program\gpgmepp.dll

and this stack trace during the delay...

0:021> ~* kp

   0  Id: 25c0.21dc Suspend: 1 Teb: 000000a3`87de7000 Unfrozen
 # Child-SP          RetAddr               Call Site
00 000000a3`8878c8e8 00007fff`e264cb20     ntdll!NtWaitForMultipleObjects+0x14
01 000000a3`8878c8f0 00007fff`e264ca1e     KERNELBASE!WaitForMultipleObjectsEx+0xf0
02 000000a3`8878cbe0 00007fff`b46614d7     KERNELBASE!WaitForMultipleObjects+0xe
03 000000a3`8878cc20 00007fff`b4667841     gpgmepp!GpgME::operator<<+0x1adb7
04 000000a3`8878cfe0 00007fff`b464b4b0     gpgmepp!GpgME::operator<<+0x21121
05 000000a3`8878d040 00007fff`b460fad8     gpgmepp!GpgME::operator<<+0x4d90
06 000000a3`8878d0b0 00007fff`8da10964     gpgmepp!GpgME::Context::nextKey+0x58
07 000000a3`8878d140 00007fff`8da10dce     xsec_xmlsec!deInitXmlSec+0x3ba4
08 000000a3`8878d290 00007fff`6eed6e0a     xsec_xmlsec!deInitXmlSec+0x400e
09 000000a3`8878d2c0 00007fff`6eed6562     cuilo!GetSpecialCharsForEdit+0x56b1a
0a 000000a3`8878d360 00007fff`6eed727f     cuilo!GetSpecialCharsForEdit+0x56272
0b 000000a3`8878d3d0 00007fff`6ef1b2d8     cuilo!GetSpecialCharsForEdit+0x56f8f
0c 000000a3`8878d400 00007fff`6ef1e232     cuilo!GetSpecialCharsForEdit+0x9afe8
0d 000000a3`8878d440 00007fff`6ef1dc73     cuilo!GetSpecialCharsForEdit+0x9df42
0e 000000a3`8878d650 00007fff`6ef1be19     cuilo!GetSpecialCharsForEdit+0x9d983
0f 000000a3`8878d740 00007fff`6ee63452     cuilo!GetSpecialCharsForEdit+0x9bb29
10 000000a3`8878d790 00007fff`74204cf0     cuilo!SvxNumberingPreview::operator=+0x3522
11 000000a3`8878d810 00007fff`74289ff9     mergedlo!SfxApplication::OfaExec_Impl+0x13d0
12 000000a3`8878dba0 00007fff`7428c2cc     mergedlo!SfxDispatcher::Call_Impl+0x279
13 000000a3`8878dc60 00007fff`7428c724     mergedlo!SfxDispatcher::Execute_+0xec
14 000000a3`8878dcb0 00007fff`742daa2d     mergedlo!SfxDispatcher::Execute+0x224
15 000000a3`8878ddd0 00007fff`742d8217     mergedlo!SvxCharView::SetHasInsert+0x3a1d
16 000000a3`8878e060 00007fff`73dc15ee     mergedlo!SvxCharView::SetHasInsert+0x1207
17 000000a3`8878e110 00007fff`75514b7e     mergedlo!com_sun_star_comp_framework_LangSelectionStatusbarController_get_implementation+0x482e
18 000000a3`8878e270 00007fff`755aa6bc     mergedlo!Menu::Select+0x9e
19 000000a3`8878e2b0 00007fff`75bce5dc     mergedlo!vcl::Window::ImplAsyncFocusHdl+0x252c
1a 000000a3`8878e5d0 00007fff`9fa79e77     mergedlo!SalFrame::CallCallback+0x1c
1b 000000a3`8878e600 00007fff`9fa7a56d     vclplug_winlo!dtrans_CWinClipboard_get_implementation+0x47a17
1c 000000a3`8878e840 00007fff`e3f4e7e8     vclplug_winlo!dtrans_CWinClipboard_get_implementation+0x4810d
1d 000000a3`8878e8d0 00007fff`e3f4e229     USER32!UserCallWinProcCheckWow+0x2f8
1e 000000a3`8878ea60 00007fff`9fa02586     USER32!DispatchMessageWorker+0x249
1f 000000a3`8878eae0 00007fff`9fa027f7     vclplug_winlo!create_SalInstance+0x546
20 000000a3`8878eb30 00007fff`9fa02b91     vclplug_winlo!create_SalInstance+0x7b7
21 000000a3`8878ecb0 00007fff`759b151c     vclplug_winlo!create_SalInstance+0xb51
22 000000a3`8878ece0 00007fff`759b120c     mergedlo!Application::Execute+0x47c
23 000000a3`8878ee80 00007fff`745866f2     mergedlo!Application::Execute+0x16c
24 000000a3`8878eee0 00007fff`759c0f5d     mergedlo!cppu::WeakImplHelper<com::sun::star::container::XChild,com::sun::star::document::XDocumentPropertiesSupplier,com::sun::star::document::XCmisDocument,com::sun::star::rdf::XDocumentMetadataAccess,com::sun::star::document::XDocumentRecovery,com::sun::star::document::XUndoManagerSupplier,com::sun::star::document::XShapeEventBroadcaster,com::sun::star::document::XDocumentEventBroadcaster,com::sun::star::lang::XEventListener,com::sun::star::document::XEventsSupplier,com::sun::star::document::XEmbeddedScripts,com::sun::star::document::XScriptInvocationContext,com::sun::star::frame::XModel3,com::sun::star::util::XModifiable2,com::sun::star::view::XPrintable,com::sun::star::view::XPrintJobBroadcaster,com::sun::star::frame::XStorable2,com::sun::star::frame::XLoadable,com::sun::star::script::XStarBasicAccess,com::sun::star::document::XViewDataSupplier,com::sun::star::util::XCloseable,com::sun::star::datatransfer::XTransferable,com::sun::star::document::XDocumentSubStorageSupplier,com::sun::star::document::XStorageBasedDocument,com::sun::star::script::provider::XScriptProviderSupplier,com::sun::star::ui::XUIConfigurationManagerSupplier,com::sun::star::embed::XVisualObject,com::sun::star::lang::XUnoTunnel,com::sun::star::frame::XModule,com::sun::star::frame::XTitle,com::sun::star::frame::XTitleChangeBroadcaster,com::sun::star::frame::XUntitledNumbers>::acquire+0xab62
25 000000a3`8878f610 00007fff`745ab6f7     mergedlo!ImplSVMain+0xdd
26 000000a3`8878f660 00007ff6`10a7101b     mergedlo!soffice_main+0x407
27 000000a3`8878f770 00007ff6`10a712d8     soffice!main+0x1b
28 000000a3`8878f7a0 00007fff`e4527034     soffice!main+0x2d8
29 000000a3`8878f7e0 00007fff`e4ca2651     KERNEL32!BaseThreadInitThunk+0x14
2a 000000a3`8878f810 00000000`00000000     ntdll!RtlUserThreadStart+0x21
Comment 3 Thorsten Behrens (allotropia) 2022-01-23 15:48:48 UTC
Hmm, so 

 SvxGeneralTabPage::InitCryptography()

tries to figure out private keys from local gpg keystore, that looks like the root cause.

Bit hard to square that circle, if people want the convenience there. Bug is nominally gpgme being a tad clumsy in checking for the agent. We could move that into a separate config page that is less likely to be opened by default (perhaps into security); but then the feature is also less obvious to users.
Comment 4 Timur 2022-01-24 09:50:42 UTC
Users open Options for multiple reasons and fast opening is important.
IIUC, problem is that LO-User Data opens by default, and it has Cryptography, so checks for keys each time. 
Not sure if "Use Cryptography" checkbox is possible.
Comment 5 kolAflash 2024-04-18 14:23:36 UTC
Timur's idea of a "Use Cryptography" checkbox sounds interesting to me.

Or what about a "Load Keylist" button? So the OpenPGP "signing key" and "encryption key" dropdown lists would stay greyed out until that button has been pressed. (each time the Options window is being opened)

Or maybe (not sure if UI toolkits allow this) the keys could be loaded when the user opens one of the two dropdown lists.

Ideally there would also be a loading animation instead of a non responsive UI.


I observe the behavior also on Debian-12 Linux.
(Timur observed it on Windows)
Firewall: no nftables rules, empty iptables defaulting to ACCEPT
LibreOffice-5.3.7.2: Options open instantly
LibreOffice-5.4.7.2: doesn't start (libgcrypt.so.20: undefined symbol: gpgrt_b64dec_proc)
LibreOffice-6.0.7.3: Options need 2 seconds to open
LibreOffice-24.8.0.0.alpha0 (2024-04-18): Options need 2 seconds to open
https://downloadarchive.documentfoundation.org/libreoffice/old/5.3.7.2/
https://downloadarchive.documentfoundation.org/libreoffice/old/5.4.7.2/
https://downloadarchive.documentfoundation.org/libreoffice/old/6.0.7.3/