Created attachment 113731 [details] Dialog showing the error When executing a sub in a 3000 line password protected Basic library, that accesses a global variable, it get a runtime error. I cannot share the actual file, but I am trying to create a separate one that shows the issues. so far without luck. Note that the library must be password protected with OpenOffice, since LibreOffice still has the bug #87530. The stack trace looks like this: wow64win.dll+0x3acaa wow64win.dll+0x16434 wow64.dll!Wow64SystemServiceEx+0xd7 wow64cpu.dll!TurboDispatchJumpAddressEnd+0xb wow64.dll!Wow64SystemServiceEx+0x26a wow64.dll!Wow64LdrpInitialize+0x435 ntdll.dll!LdrGetKnownDllSectionHandle+0x1b5 ntdll.dll!WinSqmCheckEscalationSetDWORD+0x11739 ntdll.dll!LdrInitializeThunk+0xe USER32.dll!gapfnScSendMessage+0x305 vcllo.dll!?OpenTTFontBuffer@vcl@@YAHPBXKKPAPAU_TrueTypeFont@1@@Z+0x17206 vcllo.dll!?OpenTTFontBuffer@vcl@@YAHPBXKKPAPAU_TrueTypeFont@1@@Z+0x17a53 vcllo.dll!?ImplCallEventListeners@Application@@SAXPAVVclSimpleEvent@@@Z+0x152 vcllo.dll!?Yield@Application@@SAXXZ+0x9 svtlo.dll!?GetString@SfxErrorContext@@UAE_NKAAVOUString@rtl@@@Z+0x709 KERNELBASE.dll!GetProcAddressForCaller+0x58 sfxlo.dll!??_8SfxAbstractDialogFactory@@7B@+0x24 sfxlo.dll!?GlobalBasicErrorHdl_Impl@SfxApplication@@AAEJPAVStarBASIC@@@Z+0x66 sfxlo.dll!?LinkStubGlobalBasicErrorHdl_Impl@SfxApplication@@CAJPAX0@Z+0xe tllo.dll!?Call@Link@@QBEJPAX@Z+0x11 sblo.dll!?RTError@StarBASIC@@AAE_NKABVOUString@rtl@@JJJ@Z+0x203 sblo.dll!?Y@Point@@QAEAAJXZ+0xc87a sblo.dll!?SetVBAEnabled@StarBASIC@@QAEX_N@Z+0x90e sblo.dll!?RunInit@SbModule@@IAEXXZ+0xb8 sblo.dll!?InitAllModules@StarBASIC@@QAEXPAV1@@Z+0x20a sblo.dll!?GlobalRunInit@SbModule@@IAEX_N@Z+0x4f sblo.dll!?Run@SbModule@@IAEGPAVSbMethod@@@Z+0x310 sblo.dll!?Notify@SbModule@@MAEXAAVSfxBroadcaster@@ABVSfxHint@@@Z+0x455 sblo.dll!?Broadcast@SbMethod@@UAEXK@Z+0x148 sblo.dll!?Get@SbxValue@@UBE_NAAUSbxValues@@@Z+0x8e sblo.dll!?Call@SbMethod@@UAEKPAVSbxValue@@PAVSbxVariable@@@Z+0x86 sfxlo.dll!?getTypes@?$WeakImplHelper2@VXStatusListener@frame@star@sun@com@@VXComponent@lang@345@@cppu@@UAA?AV?$Sequence@VType@uno@star@sun@com@@@uno@star@sun@com@@XZ+0x1fc sfxlo.dll!?CallXScript@SfxObjectShell@@SAKABV?$Reference@VXInterface@uno@star@sun@com@@@uno@star@sun@com@@ABVOUString@rtl@@ABV?$Sequence@VAny@uno@star@sun@com@@@3456@AAVAny@3456@AAV?$Sequence@F@3456@AAV93456@_NPBVAny@3456@@Z+0x2f1 sfxlo.dll!?OfaExec_Impl@SfxApplication@@QAEXAAVSfxRequest@@@Z+0x90c sfxlo.dll!?Type@SfxApplication@@UBEP6APAXXZXZ+0x42e sfxlo.dll!?Call_Impl@SfxDispatcher@@AAEHAAVSfxShell@@ABVSfxSlot@@AAVSfxRequest@@_N@Z+0x24d sfxlo.dll!?_Execute@SfxDispatcher@@IAEXAAVSfxShell@@ABVSfxSlot@@AAVSfxRequest@@W4SfxCallMode@@@Z+0x6b sfxlo.dll!?Execute@SfxDispatcher@@QAEPBVSfxPoolItem@@GW4SfxCallMode@@PAVSfxItemSet@@1G@Z+0x1cb sfxlo.dll!?updateItems@ThumbnailView@@QAEXABV?$vector@PAVThumbnailViewItem@@V?$allocator@PAVThumbnailViewItem@@@std@@@std@@@Z+0x6f03 sfxlo.dll!?updateItems@ThumbnailView@@QAEXABV?$vector@PAVThumbnailViewItem@@V?$allocator@PAVThumbnailViewItem@@@std@@@std@@@Z+0x722d vcllo.dll!?ImplCallEventListeners@Menu@@IAEXKG@Z+0xbb tllo.dll!?Call@Link@@QBEJPAX@Z+0x11 vcllo.dll!?Select@Menu@@UAEXXZ+0x8b vcllo.dll!?LinkStubImplCallSelect@Menu@@KAJPAX0@Z+0x12 tllo.dll!?Call@Link@@QBEJPAX@Z+0x11 vcllo.dll!?ImplAsyncFocusHdl@Window@vcl@@QAEJPAX@Z+0x3452 vcllo.dll!?ImplAsyncFocusHdl@Window@vcl@@QAEJPAX@Z+0x3cc4 vcllo.dll!?OpenTTFontBuffer@vcl@@YAHPBXKKPAPAU_TrueTypeFont@1@@Z+0x47a69 vcllo.dll!?OpenTTFontBuffer@vcl@@YAHPBXKKPAPAU_TrueTypeFont@1@@Z+0x4a34b vcllo.dll!?OpenTTFontBuffer@vcl@@YAHPBXKKPAPAU_TrueTypeFont@1@@Z+0x4a940 USER32.dll!CallNextHookEx+0x1c5 USER32.dll!WaitMessage+0x11b USER32.dll!RegisterWindowMessageW+0xa6c USER32.dll!DispatchMessageW+0x10 vcllo.dll!?OpenTTFontBuffer@vcl@@YAHPBXKKPAPAU_TrueTypeFont@1@@Z+0x171c4 vcllo.dll!?OpenTTFontBuffer@vcl@@YAHPBXKKPAPAU_TrueTypeFont@1@@Z+0x17a53 vcllo.dll!?Execute@Application@@SAXXZ+0x69 vcllo.dll!?DeInitVCL@@YAXXZ+0x634 soffice.bin+0x101e soffice.bin!main+0x27f ntdll.dll!RtlInitializeExceptionChain+0x85 ntdll.dll!RtlInitializeExceptionChain+0x58
When I specify the password prior to the macro execution, there is no error.
The code is pretty simple. At the beginning of the macro library module, there is: Global datecheck As Integer And in some sub that I run, it says: sub foo() if (datecheck = 0) then datecheck = 1 endif end sub It somehow depends on the size of the module. Adding just long REM lines does not help to reproduce this, it must be real code. It is not relevant where the sub is in the module, only how large the whole module is.
OpenOffice has the same issue, by the way. The issue is at least 5 years old.
Created attachment 113744 [details] File to reproduce the issue
The password for the attached file is testtest32. Open the file and run macro foo2.
Hello, is it this bug? https://bz.apache.org/ooo/show_bug.cgi?id=26345
Hello, I do not think so. In my case, everything works nicely as long as I do not password protect the library. Actually, a long time ago I reported a problem to OpenOffice, where passwort protecting a large library would result in destruction of the library (one could not open the library at all afterwards). I will try to find the bug number for that. But the actual issue with global variables and the size limit of password protected macro libraries seems to be a different one, but I already saw it 5 years ago.
Those are related: https://bz.apache.org/ooo/show_bug.cgi?id=62476 https://bz.apache.org/ooo/show_bug.cgi?id=65372 https://bz.apache.org/ooo/show_bug.cgi?id=106303
This might be relevant as well: If I select the whole module and copy it to the clipboard, it gets truncated (in the clipbaord). This is no big deal, since one can export the module directly to a file, but maybe it is related to the reported issue.
I can confirm with Version: 4.5.0.0.alpha0+ Build ID: a2fa9e2468aa5c4fd4b610c5d0ebc8959e87a072 TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-02-23_02:34:05
Splitting the huge module into many smaller modules under 65k characters is a workaround.
It would be good to have at least a kind of indicator when you hit the 65k limit.
Please feel free to close this. #94617 seems to fix this, at least if you enter the password of the macro library in LO 5.0.3 or later and save the file. Although the fix introduces a regression #95959, it fixes the current issue. *** This bug has been marked as a duplicate of bug 94617 ***