3 Replies Latest reply on Aug 8, 2011 6:58 PM by htbang

    Event monitoring cause segmentation fault

    jbaron

      Hi everyone,

       

      Im testing several thing with mgcscript under linux. Recently, I tried to monitor the "Quit" event on ExpeditionPCB application and it cause a segmentention fault:

       

      mgcscript: line 77: 27714 Segmentation fault      ${SDD_HOME}/${SDD_COMMON}/${SDD_PLATFORM}/_bin/${EXECUTABLE_NAME} "$@"

       

      I was wondering if someone already had this error of if someone can test it on its side so I know if its my configuration that is wrong.

       

      The code is pretty simple:

       

      Option Explicit

       

      Dim dontExitBool

      Dim pcbAppObj

       

      Set pcbAppObj = GetObject(,"MGCPCB.ExpeditionPCBApplication")

      Call Scripting.AttachEvents(pcbAppObj, "pcbAppObj")

      dontExitBool = True

      While dontExitBool

          Scripting.Sleep(300)

      Wend

       

      Function pcbAppObj_Quit()

          dontExitBool = False

      End Function

        • 1. Re: Event monitoring cause segmentation fault
          dirk_from_munich

          Try this one:

           

          Option Explicit

          Dim pcbAppObj


           

          Set pcbAppObj = GetObject(,"MGCPCB.ExpeditionPCBApplication")

          Call Scripting.AttachEvents(pcbAppObj, "pcbAppObj")


           

          Function pcbAppObj_Quit()

              MsgBox "Quitting the Application"

              ' Make sure all objects are released

              Set pcbAppObj = Nothing

          End Function


           

          Scripting.dontExit = True

           

          I removed the endless loop and used dontExit instead off.

          • 2. Re: Event monitoring cause segmentation fault
            jbaron

            Thanks for the answer, but I run my script with the mgcscript script engine. So, the DontExit property cannot work.

             

            I tried to add the line "Set pcbAppObj = Nothing", but it doesnt correct the problem.

             

            Anyone has tried this yet?

            • 3. Re: Event monitoring cause segmentation fault
              htbang

              Use of two filles

               

                 One.vbs:

                             Option Explicit

                             Dim pcbAppObj


                             Set pcbAppObj = GetObject(,"MGCPCB.ExpeditionPCBApplication")

                             pcbAppObj.Gui.ProcessKeyin("run c:/Two.vbs")            ' c:/Two.vbs :   VBS FileName

               

               

                 Two.vbs

                             Option Explicit

                             Dim pcbAppObj

               

               

                             Set pcbAppObj = GetObject(,"MGCPCB.ExpeditionPCBApplication")

                             Call Scripting.AttachEvents(pcbAppObj, "pcbAppObj")

               

                             Function pcbAppObj_Quit()

                                           MsgBox "Quitting the Application"

                                           ' Make sure all objects are released

                                           Set pcbAppObj = Nothing

                             End Function
                             Scripting.dontExit = True