Page 1 of 1

Mailmerge crashes with Fatal exception occasionally

PostPosted: Wed Sep 27, 2017 3:13 pm
by librebuz
Occasionally when I create a Mailmerge via Macro Libreoffice crashes.

On a samba share I have for writer-forms that query an SQL-Database.
When only one user uses one form it usually works.
When two users access one form, creating Mailmerges occasionally crashes -- although the forms are always opened read-only.

This is my code
Code: Select all   Expand viewCollapse view
SUB SerienbriefDrucken(  pkVerteilerNr AS INTEGER, fGruppenverteiler AS BOOLEAN, fAuchLeuteMitMail AS BOOLEAN )
   i=msgbox( "Chose a template.",1,"Hinweis" )
   IF ( i=1 ) THEN            ' if "OK"
      MyDialog=createunoservice("com.sun.star.ui.dialogs.FilePicker")
      MyDialog.appendFilter("Textdokumente","*.ott;*.odt")
      MyDialog.SetCurrentFilter("Textdokumente")
      VORPATH=convertToURL( BUZURL & "vorlagen" )
      MyDialog.displaydirectory=VORPATH
      IF MyDialog.execute THEN
         FileName=MyDialog.Files(0)
         briefURL = ConvertToURL(FileName)
         Dim oMailMerge as Object
         oMailMerge = createunoservice("com.sun.star.text.MailMerge")
         oMailMerge.DataSourceName = DATASRC
         oMailMerge.DocumentURL = briefURL
          oMailMerge.CommandType = 1            
           oMailMerge.Command = "buz-Serienbrief-Steuerabfrage"     
            oMailMerge.OutputType = MeinOutputTyp
           oMailMerge.SinglePrintJobs = False
          Dim MyProps() as Object
              oMailMerge.SaveAsSingleFile = TRUE   
                     pfad=SEBRIPATH
                     counter=0
                      dname="Serienbrief_neu_" & Environ("USER") & counter
         dnamekomplett=pfad & dname & "0.odt"

         DO WHILE FileExists(dnamekomplett)
            counter=counter+1
                        dname="Serienbrief_neu_" & Environ("USER") & counter
            dnamekomplett=pfad & dname & "0.odt"
         LOOP

           oMailMerge.OutputUrl=ConvertToURL(pfad)
         oMailMerge.FileNamePrefix=dname


             SteuerAbfrageAusVerteilerErstellen( "buz-Serienbrief-Steuerabfrage", pkVerteilerNr,fGruppenverteiler, fAuchLeuteMitMail )  '
             
             
            oMailMerge.execute(MyProps())
         
            oDoc = ThisComponent
            oDocCtrl = oDoc.getCurrentController()
            oDocFrame = oDocCtrl.getFrame()
            oDocFrame.loadComponentFromURL( ConvertToURL(dnamekomplett) , "_blank", 0, MyProps() )    

         END IF
   END IF
   SerienbriefEnde:
END SUB


This is what Libreoffice says:
Code: Select all   Expand viewCollapse view
Fatal exception: Signal 11
Stack:
/usr/lib/libreoffice/program/libuno_sal.so.3(+0x39430)[0x7f084170c430]
/usr/lib/libreoffice/program/libuno_sal.so.3(+0x395a1)[0x7f084170c5a1]
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so(+0x8c15dd)[0x7f0802db45dd]
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so(JVM_handle_linux_signal+0x1b9)[0x7f0802db9279]
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so(+0x8b9fd8)[0x7f0802dacfd8]
/lib/x86_64-linux-gnu/libc.so.6(+0x33030)[0x7f0841366030]
/usr/lib/libreoffice/program/libmergedlo.so(_ZNK12OutputDevice13GetTextHeightEv+0x21)[0x7f08444696f1]
/usr/lib/libreoffice/program/libmergedlo.so(+0x2a45c98)[0x7f0844370c98]
/usr/lib/libreoffice/program/libmergedlo.so(+0x2a47d67)[0x7f0844372d67]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN12SystemWindow10SetMenuBarEP7MenuBar+0x124)[0x7f08443a4874]
/usr/lib/libreoffice/program/libmergedlo.so(+0x16ae35a)[0x7f0842fd935a]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1b0aded)[0x7f0843435ded]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1b0e12e)[0x7f084343912e]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1d48c2c)[0x7f0843673c2c]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN17SfxBaseController11attachFrameERKN3com3sun4star3uno9ReferenceINS2_5frame6XFrameEEE+0x1c8)[0x7f0843674718]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1d39803)[0x7f0843664803]
/usr/lib/libreoffice/program/libmergedlo.so(+0x16d3a2e)[0x7f0842ffea2e]
/usr/lib/libreoffice/program/libmergedlo.so(+0x16d4608)[0x7f0842fff608]
/usr/lib/libreoffice/program/libmergedlo.so(+0x16d48d6)[0x7f0842fff8d6]
/usr/lib/libreoffice/program/libmergedlo.so(+0x16fd22e)[0x7f084302822e]
/usr/lib/libreoffice/program/libgcc3_uno.so(+0x7783)[0x7f082b532783]
/usr/lib/libreoffice/program/libgcc3_uno.so(+0x6acd)[0x7f082b531acd]
/usr/lib/libreoffice/program/libgcc3_uno.so(+0x72da)[0x7f082b5322da]
/usr/lib/libreoffice/program/libreflectionlo.so(+0x1cdce)[0x7f08054d7dce]
/usr/lib/libreoffice/program/libmergedlo.so(+0x19ce7de)[0x7f08432f97de]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN14SfxBroadcaster9BroadcastERK7SfxHint+0x3d)[0x7f084377255d]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN11SbxVariable9BroadcastEj+0x1bf)[0x7f084339f17f]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN8SbxValueC2ERKS_+0xa7)[0x7f08433993a7]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN11SbxVariableC2ERKS_+0x23)[0x7f084339f833]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN9SbxMethodC1ERKS_+0x46)[0x7f0843392026]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1a322ed)[0x7f084335d2ed]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1a32dbe)[0x7f084335ddbe]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1a2974d)[0x7f084335474d]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN8SbModule3RunEP8SbMethod+0x120)[0x7f084330aaa0]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN8SbModule6NotifyER14SfxBroadcasterRK7SfxHint+0x50a)[0x7f084330b84a]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN14SfxBroadcaster9BroadcastERK7SfxHint+0x3d)[0x7f084377255d]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN8SbMethod9BroadcastEj+0x13d)[0x7f084330357d]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN8SbxValueC2ERKS_+0xa7)[0x7f08433993a7]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN11SbxVariableC2ERKS_+0x23)[0x7f084339f833]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN9SbxMethodC1ERKS_+0x46)[0x7f0843392026]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1a322ed)[0x7f084335d2ed]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1a329bd)[0x7f084335d9bd]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1a2974d)[0x7f084335474d]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN8SbModule3RunEP8SbMethod+0x120)[0x7f084330aaa0]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN8SbModule6NotifyER14SfxBroadcasterRK7SfxHint+0x50a)[0x7f084330b84a]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN14SfxBroadcaster9BroadcastERK7SfxHint+0x3d)[0x7f084377255d]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN8SbMethod9BroadcastEj+0x13d)[0x7f084330357d]
/usr/lib/libreoffice/program/libmergedlo.so(_ZNK8SbxValue3GetER9SbxValues+0xbe)[0x7f08433998de]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN8SbMethod4CallEP8SbxValueP11SbxVariable+0xc3)[0x7f0843308a73]
/usr/lib/libreoffice/program/../program/libbasprovlo.so(+0x189f2)[0x7f07abdf39f2]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN14SfxObjectShell11CallXScriptERKN3com3sun4star3uno9ReferenceINS3_10XInterfaceEEERKN3rtl8OUStringERKNS3_8SequenceINS3_3AnyEEERSE_RNSD_IsEERSF_bPKSE_+0x483)[0x7f084358cc33]
/usr/lib/libreoffice/program/libmergedlo.so(_ZN14SfxObjectShell11CallXScriptERKN3rtl8OUStringERKN3com3sun4star3uno8SequenceINS7_3AnyEEERS9_RNS8_IsEERSA_bPKS9_+0x68)[0x7f084358d658]
/usr/lib/libreoffice/program/libmergedlo.so(+0x25e3e64)[0x7f0843f0ee64]
/usr/lib/libreoffice/program/libmergedlo.so(+0x25e4d23)[0x7f0843f0fd23]
/usr/lib/libreoffice/program/libmergedlo.so(+0x25e538a)[0x7f0843f1038a]
/usr/lib/libreoffice/program/libmergedlo.so(+0x1125e54)[0x7f0842a50e54]
/usr/lib/libreoffice/program/../program/libevtattlo.so(+0x729a)[0x7f08052aa29a]
/usr/lib/libreoffice/program/../program/libevtattlo.so(+0x7b36)[0x7f08052aab36]
/usr/lib/libreoffice/program/libgcc3_uno.so(+0x7783)[0x7f082b532783]
/usr/lib/libreoffice/program/libgcc3_uno.so(+0x6acd)[0x7f082b531acd]
/usr/lib/libreoffice/program/libgcc3_uno.so(+0x72da)[0x7f082b5322da]
/usr/lib/libreoffice/program/libinvocadaptlo.so(+0x42aa)[0x7f0804c0f2aa]
/usr/lib/libreoffice/program/libinvocadaptlo.so(+0x5a62)[0x7f0804c10a62]
/usr/lib/libreoffice/program/libgcc3_uno.so(+0x3b85)[0x7f082b52eb85]
/usr/lib/libreoffice/program/libgcc3_uno.so(+0x40c8)[0x7f082b52f0c8]
/usr/lib/libreoffice/program/libgcc3_uno.so(privateSnippetExecutor+0x76)[0x7f082b535e98]
/usr/lib/libreoffice/program/../program/libfrmlo.so(+0xc24dc)[0x7f08059dd4dc]
/usr/lib/libreoffice/program/../program/libfrmlo.so(+0xc3894)[0x7f08059de894]
/usr/lib/libreoffice/program/../program/libfrmlo.so(+0xee6af)[0x7f0805a096af]
/usr/lib/libreoffice/program/../program/libfrmlo.so(+0xc857a)[0x7f08059e357a]
/usr/lib/libreoffice/program/libuno_sal.so.3(+0x3c207)[0x7f084170f207]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7494)[0x7f083ee2a494]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f084141baff]

Re: Mailmerge crashes with Fatal exception occasionally

PostPosted: Mon Oct 02, 2017 11:19 am
by Bidouille
Did you have same behavior if you use mailmerge without macro?

Re: Mailmerge crashes with Fatal exception occasionally

PostPosted: Mon Oct 02, 2017 1:28 pm
by librebuz
Bidouille wrote:Did you have same behavior if you use mailmerge without macro?

Yes. If I let the macros create the according query and link it to a document after, it also occasionally crashes.
Edit for clarification: The query is created successfully. Then I open a new document, put the fields where I want them, start the Mailmerge -- and //then// it occasionally crashes.

Re: Mailmerge crashes with Fatal exception occasionally

PostPosted: Tue Oct 03, 2017 11:58 am
by Villeroy
if it is a matter of concurrent read-write access, make the underlying queries read-only.
A query is read-only if it
a) includes more than one table
b) does not include the primary key
c) is executed in "direct SQL" mode

Re: Mailmerge crashes with Fatal exception occasionally

PostPosted: Wed Oct 11, 2017 4:02 pm
by librebuz
Villeroy wrote:if it is a matter of concurrent read-write access, make the underlying queries read-only.
A query is read-only if it
a) includes more than one table
b) does not include the primary key
c) is executed in "direct SQL" mode


Thanks for the suggestion. The query already was read-only.
At the moment I am trying to avoid race conditions by interrupting the execution of the macro with msgboxes.

Re: Mailmerge crashes with Fatal exception occasionally

PostPosted: Mon Oct 16, 2017 6:06 pm
by Bidouille
librebuz wrote:Yes. If I let the macros create the according query and link it to a document after, it also occasionally crashes.

So, you must solve this problem first.

5.2.7 is an old version. Try to update LibO!