Unhandled exception: System.AccessViolationException: Attempted to read or write protected memory while running test lists

1 Answer 90 Views
TeamCity Test Execution
Gilberto
Top achievements
Rank 1
Iron
Gilberto asked on 08 Jul 2024, 02:57 PM
Hello!

While running Test lists (either through the application or using an agent from TeamCity), it would randomly stop, showing this in the logs from the agent:

"Unhandled exception: System.AccessViolationException: Attempted to read or write protected memory. Process exited with code -1073740771."

Also, the Windows Event Viewer shows the following entry:

Faulting application name: ArtOfTest.Runner.exe, version: 2023.3.1115.3, time stamp: 0x65546b19
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc000041d
Fault offset: 0x0139f189
Faulting process id: 0x8978
Faulting application start time: 0x1DACE12D5A2F70D
Faulting application path: C:\Users\{user}\Telerik\Bin\ArtOfTest.Runner.exe
Faulting module path: unknown
Report Id: 184dfe1c-35a2-46ca-990d-da43a5617fd3
Faulting package full name: 
Faulting package-relative application ID: 

Updating the application didn't help. Tested it on two different machines (both running Windows 11), and it happened on both. Any help is appreciated.

1 Answer, 1 is accepted

Sort by
0
Tsvetko
Telerik team
answered on 11 Jul 2024, 08:07 AM

Hi Gilberto,

I'm sorry to hear you are having issues running test lists.

The exception is very generic and in order to diagnose the problem I need additional information.

Would you provide the exception stack trace?

Regards,


Tsvetko
Progress Telerik

Virtual Classroom is the free self-paced technical training portal that gets you up to speed with Telerik and Kendo UI products including Telerik Test Studio! Check it out at https://learn.telerik.com/.
Gilberto
Top achievements
Rank 1
Iron
commented on 12 Jul 2024, 02:20 PM

Where would I find this information?
Elena
Telerik team
commented on 15 Jul 2024, 01:43 PM

Hi Gilberto, 

Please, take the time to gather the below listed details and share these along to help us analyze the case.

  1. The application log of Test Studio generated during a pipeline run when the error appeared. 
    The logging options can be accessed through the Test Studio Execution Client on the execution machine. Send the generated logs zipped. 
  2. The complete log from the pipeline when it stopped with this error.
  3. If applicable, the result file (and additional files if present) generated from this pipeline run. 
    Check if there is any results file generated and send it over zipped if so. 
  4. Check the Windows Event Viewer on the execution machine and what error events are logged at the time when the pipeline stopped. Export these events and share them as well. 
  5. Share some details for the machine in use - is it a physical machine, what user is logged for the pipeline run, do other users also log on the machine and how they use it, etc. 
  6. Try to drill down if there is anything common when the errors appears - another user session is initiated, or certain other process starts, etc. - anything specific that might be causing unexpected troubles. 

Thank you for your cooperation in advance.

Gilberto
Top achievements
Rank 1
Iron
commented on 19 Jul 2024, 12:39 PM

Thank you for your reply.

 

1. Added the Test Studio logs when error happened, 07/17 03:09:18

2. Added, it happened at 03:09:18 

3. It didnt generate any result file

4. Added event viewer log

5. Is a physical machine, the admin user is logged and the machine isnt used by any other users, it is only used to run tests.

6. It happens randomly, would pass weeks before happening or would happen daily.

Elena
Telerik team
commented on 23 Jul 2024, 01:14 PM

Hi Gilberto, 

Thansk for following up. I reviewed the provided logs and have the following comments:

  • The test lists in your project use the screen recording feature enabled - however, the video for none of the executions is being actually recorded. I guess that the used settings are not correct so that the video can be successfully generated and recorded. 
  • The error from the pipeline appears at the time when the Test Studio process tries to save that video which is at the end not successful. However, the process requests some memory from the system where to save the file. 
  • The complete error messages says "System.AccessViolationException: Attempt to read or write protected memory. This often indicates that other memory is corrupted." This makes me think that when this error appears there is no other memory available other than the protected one. So, when Test Studio tries to save that video, the process violates the system memory restrictions. 

Having these in mind I will suggest you to turn off recording videos for the test list runs. It is a feature meant to be used for debugging specific issues which happen only during test list execution. If there are no such troubles on your end, you can safely turn off the video recording for the test lists. I hope that this will remove the reason for this error to appear. 

Let me know in case of additional questions.

Best, 
Elena

Gilberto
Top achievements
Rank 1
Iron
commented on 23 Jul 2024, 04:34 PM

Thank for your reply Elena!

Sadly the screen recording are turned on to record only onFail (useful to quickly debug and see why a test fails) and is used daily, would be any other way to keep the recording OnFail and avoid the error? Perhaps changing the video codec?

 

Elena
Telerik team
commented on 26 Jul 2024, 11:54 AM

Hi Gilberto, 

To be honest I believe that the misbehavior is somewhat specific for the environment and although I'm not sure we will manage to drill down to its actual cause, there are few things to proceed with. As the issue doesn't seem to be related to the pipeline runs you can leave this aside for now and perform the below runs directly on the machine. 

  1. First thing will be to check the folder where the videos should be output. Are there video files there and can you open them as expected.
  2. Then prepare to generate the Test Studio application log for few test list runs described below.
  3. You can use the ArtOfTest.Runner.exe directly from command prompt. 
  4. Use a sample short test lists for the below runs - even two tests are sufficient for exploring the error. 
  5. Modify a test list to record video for all test runs. Execute the test list - check the folder with the videos and let me know if these are all recorded and if you can open the files correctly. Collect the generated application log and send it over zipped. 
  6. Modify a test list to record video on failure. Ensure there's a failing test in the list and execute it. Ccheck the folder with the videos and let me know if these are all recorded and if you can open the files correctly. Collect the generated application log and send it over zipped. 
  7. For both these runs check the Event Viewer and if the same error gets logged. Please, also chekc the events shortly before and after the error - you could share at least a screenshot of these so that I can see if there's anything we need to look into. 

Thank you for your cooperation in advance.

Regards,
Elena

Tags
TeamCity Test Execution
Asked by
Gilberto
Top achievements
Rank 1
Iron
Answers by
Tsvetko
Telerik team
Share this question
or