dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
6.91k stars 1.15k forks source link

WPF desktop application for .NET Framework 4.5 causes Windows 10 to crash #9320

Open Bluetorch2016 opened 1 week ago

Bluetorch2016 commented 1 week ago

Description

Running desktop programs for a long time on a desktop computer may occasionally cause Windows to freeze and crash (not a blue screen crash), the mouse and keyboard may not respond, the hard disk indicator light may not light up, the fan may run normally, and the CPU temperature may be normal.

Reproduction Steps

  1. There are nearly 40 desktop computers participating in the test, with the same hardware configuration. Crashes are sporadic, sometimes lasting for about an hour before crashing, sometimes lasting for three weeks before crashing, and sometimes not even experiencing a crash.
  2. After upgrading the integrated graphics card driver version to version 27.20.100.8190 and conducting continuous testing for over a month, no crashes occurred.
  3. In C # code, RenderOptions ProcessRenderMode=RenderMode. SoftwareOnly has been continuously tested for over a month without any crashes.
  4. After turning off the DirectDraw acceleration of the integrated graphics card and conducting continuous testing with Direct3D acceleration for over a month, no crashes occurred.

Expected behavior

  1. I want to know the root cause of this crash
  2. How can I stably reproduce this issue to shorten testing and validation time
  3. I am unable to upgrade the hardware drivers or software environment of hundreds of desktop computers sent to the customer site, so I can only do so through version updates. Therefore, I need a solution for coding desktop applications

Actual behavior

null

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

Windows 10 LTSC 1809 (17763) .NET Framework 4.5 WPF App Intel(R) HD Graphics 530 (20.19.15.4463)

Other information

No response

Bluetorch2016 commented 1 week ago

Test description:

Running desktop programs for a long time on a desktop computer may occasionally cause Windows to freeze and crash (not a blue screen crash), the mouse and keyboard may not respond, the hard disk indicator light may not light up, the fan may run normally, and the CPU temperature may be normal.

  1. There are nearly 40 desktop computers participating in the test, with the same hardware configuration. Crashes are sporadic, sometimes lasting for about an hour before crashing, sometimes lasting for three weeks before crashing, and sometimes not even experiencing a crash.
  2. After upgrading the integrated graphics card driver version to version 27.20.100.8190 and conducting continuous testing for over a month, no crashes occurred.
  3. In C # code, RenderOptions ProcessRenderMode=RenderMode. SoftwareOnly has been continuously tested for over a month without any crashes.
  4. After turning off the DirectDraw acceleration of the integrated graphics card and conducting continuous testing with Direct3D acceleration for over a month, no crashes occurred.

My expectations:

  1. I want to know the root cause of this crash
  2. How can I stably reproduce this issue to shorten testing and validation time
  3. I am unable to upgrade the hardware drivers or software environment of hundreds of desktop computers sent to the customer site, so I can only do so through version updates. Therefore, I need a solution for coding desktop applications
himgoyalmicro commented 1 week ago

@Bluetorch2016 It will be difficult for us to provide the root cause of the crash based on the description provided. We will need a little more information (system logs, event viewer logs, crash dumps, etc) how WPF desktop application is causing the windows to crash.

Bluetorch2016 commented 1 week ago

This is a freeze and crash issue. After the Windows screen freezes, there is no response anymore and you can only restart it by pressing the power button. There is no available information in the Event Viewer (neither system events nor application events have any suspicious events around the time of the crash). And I haven't found any dump files under %SystemRoot%, and I haven't even searched for related dump files on the entire computer. As for the system logs you mentioned, I'm not sure what you mean.

I have made many assumptions and conducted debugging on this issue. Due to the sporadic nature of the problem, the time cost of reproducing the issue is very high. However, I am sure that this is a real problem, as it has caused nearly 20 crashes in my continuous testing over the past six months.

I have attached a copy of the system information scanned using Intel's official tool SSU. I am not sure if this will help with the issue.

Windows 10 LTSC 1809 (17763) + .NET Framework 4.5 + WPF +Intel(R) HD Graphics 530 (20.19.15.4463)

[Uploading SSU.txt…]()

miloush commented 1 week ago

From your description it sounds like the issue has been in the Intel driver and that it has been resolved by a newer driver version. The correct way to mitigate the issue then is to upgrade the driver. Intel would be at better position saying what they changed, however, your driver upgrade spans 7 major versions, which might make it difficult to pinpoint.

You have mentioned other ways to workaround the issue - SoftwareOnly rendering or disabling DirectDraw acceleration. Can you not do this from the application? Technically you could even upgrade the driver with your application too.

As for discovering this earlier, I don't know what the issue is, but try keeping an eye on Handles/User/GDI objects in the task manager. I think running out of handles/objects would be consistent with the behavior you are describing.

Bluetorch2016 commented 4 days ago

@miloush @himgoyalmicro Thank you for your response

  1. I have a photo of a non-blue screen of death here. The content of the photo is the usage of system resources monitored by the resource monitor. From the data, I believe this does not cause a problem
  2. If you set SoftwareOnly in the code, the displacement rotation animation of WPF will become stuttering and the interface will appear jagged. This is not a good solution
  3. I don't have the ability to go to hundreds of customer sites to upgrade their integrated graphics drivers. I can only fix them through software modifications
  4. I need to locate the actual cause of the problem, explain the problem to the customer and the leader, and because the problem is sporadic, I cannot guarantee that upgrading the driver or other modifications will completely fix the problem

For photos and Intel SSU logs when a non-blue screen of death occurs, please refer to https://github.com/Bluetorch2016/fix_bug_res/blob/main/Image_20240628161448.png https://github.com/Bluetorch2016/fix_bug_res/blob/main/SSU.txt