3 Replies Latest reply on Jul 11, 2014 8:06 AM by Gregor

    Suspected Memory Corruption in Processbook

    RolandRich

      I am creating a Processbook Display with custom VBA code that performs a wide range of actions (getting tag values, updating display elements, reading/writing MDB values etc)

       

       Environment Details:

      • Processbook 2012. Version 3.3.0.949
      • PISDK version: 1.4.0.416
      • OS: Windows Server 2003

      Issue:

       

      The Processbook display is experiencing a vast range of errors, which are often unrepeatable and irrational. If the exceptions are caught, the resulting exception descriptions include: 

      • “Invalid procedure call or argument”
      • “The requested server was not found in the known servers table. time “*”
      • “The requested server was not found in the known servers table. ,w) | id PIAdmins: A(r,w) | id ReadOnly: A(r) | idHVDCNodes: A(r,w) | id CtrlRoom: A(r,w) | idPITagAdmins: A(r,w)”
      • “The requested server was not found in the known servers table. equested server was not found in the known servers table. ,w) | id PIAdmins: A(r,w) | id ReadOnly: A(r) | idHVDCNodes: A(r,w) | id CtrlRoom: A(r,w) | idPITagAdmins: A(r,w)”
      • “The requested server was not found in the known servers table. equested server was not found in the known servers table. equested server was not found in the known servers table. ,w) | id PIAdmins: A(r,w) | id ReadOnly: A(r) | idHVDCNodes: A(r,w) | id CtrlRoom: A(r,w) | idPITagAdmins: A(r,w)”
      • “File not found: d”
      • “Error parsing performance equation” (Can’t remember the exact wording of this one)

       Note that this is only a small sample, there are many more than these, but all of them make little sense. For example, the error for failing to parse the performance equation was a result of a simple PIPoint.Data.GetRecordedValuesByCount() call, which contains no performance equations.

       

       Some of the errors will cause Processbook to crash out, regardless of whether the exception is caught and handled, or not.

       

       Observations:

       

      -          This is not repeatable across all client machines. This issue only seems to affect the machines running Windows Server 2003. Machines running Windows Server 2008 operate perfectly and the Processbook display has no issues. However, there may be other (more subtle) differences between the machines, but the OS is the most striking difference.

       

      -          The functions that generate the errors are very standard simple functions (e.g get a tag snapshot value) that have been used hundreds of times in other displays without issue. Tested independently, the functions work as expected with no errors.

       

      -          Antivirus software has been considered as the culprit. The affected machines are using Symantec Endpoint Protection. However, an exception to the AV rules has been added for Processbook, although this has had no effect.

       

      -          In my opinion, the error appears to be memory related. Several things hint towards this:

      • The previous exception description get partly appended to the next exception (see above for example).
      • Two separate functions work correctly when run independently.  But the second function will fail with a cryptic error when executed after the first one has been run.
      • Changing the order independent functions are executed in will change the resulting error message
      • Simply changing benign code in the VBA (e.g changing the contents of an unrelated string) can cause the errors to occur.
      • Likewise, making minor changes to the display (e.g. adding a new PI Value symbol) will cause previously broken code to suddenly work again.
      • Debugging through the code using the VBA debugger drastically affects what errors are produced, and what produces them.
      • The errors are very hard to reproduce consistently. Sometimes the error will occur, but on repeating those steps, it will not occur. Sometimes when restarting Processbook, a function that was consistently faulting will now work perfectly, only for another function to break with a different error message.

       Unfortunately it is very hard to provide more details. Then entire issue is very irrational, which makes it very hard to reproduce, categorise, debug or investigate the cause. My suspicion is that there some sort of memory corruption or memory leaking occurring. This would certainly explain the observed behaviour, however at this moment I am open to any and all suggestions as to the cause.

       

       Therefore, my question is are there any known issues that could be causing this behaviour? Has this behaviour been seen anywhere else? Are there any known workarounds? Is there any advice anyone can offer in this situation?