PriviledgedInstruction Exception

2022-02-09
2022-02-10
  • mike-at-gms

    mike-at-gms - 2022-02-09

    I have project in 3.5 SP15 64bit that has been working fine for months. Today, I made a seemingly innocent change and suddenly I am getting the following exception:

    SOURCEPOSITION App=[Application] area=3, offset=1422839
    EXCEPTION [<excpt>PriviledgedInstruction</excpt>] occurred: App=[<app>Application</app>], Task=[<task>CommunicationTask</task>]

    The exception occurs on the same line of code (which has not changed for weeks) no matter what I do. Undoing the last change does not fix the problem.

    I restored an older version of the project and slowly copied the my recent changes and checked the results. I was able to get most of the changes copied before another simple change cause the exception.

    I cannot find any information about this exception.

    **What causes this exception and how do I undo a change that introduces it since it does not appear to be an actual error in my code?

    Thank you.

     
  • hermsen

    hermsen - 2022-02-09

    If you post your project then maybe we can check your steps and reproduce the error.

     
  • mike-at-gms

    mike-at-gms - 2022-02-09

    The project is large and proprietary. The steps involved to trigger the exception also require a TCP client that is specific to this application.

    The general steps are: PLC starts, initialization complete, TCP Listener initialized, client begins TCP communication. During handshaking, an acknowledgement of the connection is retuned. While adding the ACK to a queue the exception is thrown. The TCP communications code has not changed for months. I can connect and communicate every time until the 'magic' change (not related to communications at all) causes this to stop working. And from that point on, nothing I do will allow it to work.

    I am not looking for a solution to my 'code error', I am looking for general information about the exception so I can narrow down the part of my project that has 'changed'. If I know more about the source of the error, maybe I could build a test project.

    What system generates this exception; Windows or the CodeSys runtime (I am using Control RTE V3 v. 3.5.15.0)? Why does a seemingly simple code change provoke the exception but reverting that change does not stop the exception?

    I am going to start again with my working backup and try to isolate a broken version. I will then try to compare any files I can find (like the .bootinfo files).

    Thank you.

     
  • mike-at-gms

    mike-at-gms - 2022-02-09

    Update:
    I took a working project and migrated changes in small parts. I tested each change and then copied the working project to a different folder. At some point, the project started throwing the exception. I tried to compare files but the .bootinfo was not helpful.
    HOWEVER, I then copied the 'working' project back to the original folder. The exception remains. I have verified that the two .project files are exactly the same. If I open the 'working' project in the sub folder, it works. Same .project file in two locations, one works the other does not.
    On the project that does not work, I have performed a 'Clean' and rebuild and I have deleted all other files in the folder to force a rebuild. The 'broken' file is still broken even though it is the same .project file.

    What could be going on?

     
  • mike-at-gms

    mike-at-gms - 2022-02-10

    Thank you, the checkbounds function identified an array problem.

    I still do not understand the exception (or why it was not thrown when the array was created) other than my code would 'sometimes' try to access restricted memory.

    The exception has not returned yet to verify all this, but I have a tool to find problems if it comes back.

     

Log in to post a comment.