MFC application can freeze for several minutes while Windows is doing OS updates (by msiexec.exe and wmiprvse.exe) RRS feed

  • Question

  • I don't know if this is the right forum for this post, but I don't know which one is, so bear with me, please.
    Sorry for long and complex explanation about the problem, but I want to be thorough of all the aspects.

    Has anyone heard about possibility that a MFC application can totally freeze when Windows operating system is updating the OS.
    By freezing I mean the application is totally unusable for maybe several minutes (or even hours). If you click program once it's colors go grayed and title bar says "not responding". If you continue clicking application then mouse cursor and keyboard stop working for a minute or longer. When mouse cursor starts working again you can use other programs (web browser, File explorer, Task Manager, etc.) just fine.

    At least two OS processes have been seen to relate to the freezes: msiexec.exe and wmiprvse.exe

    Case that happened to me once:
    1. I was testing my application when it suddenly froze and mouse and keyboard also stopped functioning
    2. Waited until mouse cursor started to work again
    3. Opened Task manager to see if there were any other processes working
    4. Pressed "Show processes from all users" button
    5. Found out that one msiexec.exe SYSTEM process (total of 3-4 of them were present at the time) was working (it's CPU usage was 13 %, one core's capacity)
    6. Some minutes later I saw that msiexec.exe has stopped working (it's CPU usage was 0 %)
    7. Tried my application and it was working perfectly without restarting
    8. Some time later I saw that msiexec.exe was back doing some work (CPU 13 %)
    9. I tried to use my application but it was frozen again
    10. Some minutes later msiexec.exe has stopped working (CPU 0 %)
    11. Tried my application and it was working perfectly without restarting
    12. Then some time later msiexec.exe was back again doing some more work (CPU 13 %)
    13. Again I tried to use my application but it was frozen

    At this point the pattern was pretty clear. I had two similar cases with the wmiprvse.exe running in the background and doing some work also.

    I have google'd about these processes and they are used for Windows updates and they can't be killed or stopped.

    Not all the OS updates causes freezes, because I have tried them manually and only once I have been able to produce application freeze that way.

    There has been one report when Adobe Acrobat update caused the freeze on client's PC. I have tried many different 3rd party application updates (including the mentioned Acrobat) but was unable to cause any freezes.

    I have tried to google about all this but haven't found anything useful yet.

    These freezes started to appear about inside the last 12 month. I don't know if we have made something in the program development. I disabled few features that were using a new technology (namely the C++ Rest SDK) added to the application about 1 year back, but no help there.

    This has happened also in at least one of our client site, so this is not probably some virus detection, firewall issue or any other system incorporated in our company.

    We have tried disabling all the virus scanners to test and no help there.

    Now we have disabled all the automatic Windows updates and this has reduced amount of freezes a lot but not completely. All updates are now run manually, but this is hardly a good permanent solution.

    I have tried to run application with AppVerifier program, but have found only some minor errors with it so far.

    This problem is very severe to our company and I have no clue what to do next. Can someone help me in the right direction here. To some forum or person that might have knowledge about this kind of behavior.

    Basically application works reasonably well 99 % of time, but then some of the OS updates ruin the day.

    Some background information about the application:

    It is a meteorological workstation used by forecasters in weather services.
    It's 24/7 type program basically running day and night because weather services also run 24/7.
    We started to develop it about 20 years ago.
    It's made with MFC framework (SDI type).
    We now only support 64-bit platform because it uses huge amounts of data.
    Currently we develop it with Visual C++ 2015.
    We support Windows 7, 8 and 10. Freezes have happened on win 7 and 10 (Win 8 is not used by our company).
    We use Dell's hardware for our workstations.
      - Dell tower PC's for weather service (heavy users), don't recall the package name.
      - Dell Precision laptops (e.g. M4800) for individual users.
    Most freezes reported have happened at night time like between 1 to 5 am (like automatic updates tend to do if possible).
    Worst case reported was when a workstation was unusable for several hours at one night.
    One suspected reason for freezes have been that the application uses heavily almost all the resources from PC:
      - Current basic version uses about 90 GB data in memory.
        - Data is memory mapped so it's like on-demand loaded only when some parts of data is actually used.
        - Our current PC's have 64 GB ram (planning to test 128 or 256 GB).
      - It uses a lot of network:
        - Data is retrieved from different sources with different technologies.
        - Around 300 GB data is loaded from servers to local cache files daily.
      - CPU is heavily used.
        - It uses all the available CPU cores in the PC with it's many tools and calculations.
      - Local permanent storage usage is heavy.
        - Those 300 GB are stored to local storages daily.
        - Only SSD technology is feasible to use here.
        - Old hard-drive technology with rotating physical disks are way too slow.
      - On the other hand there has been reports about freezes even when application have been configured to use much less data.
        - On one client site that had freeze problems has 128 GB ram on their PC's but they have only about 30 GB data in the system at one time.
        - So this is not a too-little-memory issue.
    Project uses MFC, C/C++ (unmanaged).
      - With many 3rd party libraries (like boost, AVS ToolMaster for visualization, etc.)
      - A lot of in-house c++ libraries that use other 3rd party libraries.
    Application is very complex:
      - It has MainFrame and about 15 modeless type view/dialog that can be used side by side.
      - Different views show different data with different visualizations.
      - Views send update request messages between them, if something is done in one place that requires updates in other views.
      - It has about 10 worker threads in the background doing different kinds of data retrieve/calculation related work.
      - For data visualization it uses GDI, GDI+, AVS ToolMaster, in-house visualization packages, images from WMS servers, etc.
        - Different graphic systems are from different time periods over the past 20 years.
    • Moved by Baron Bi Wednesday, June 6, 2018 8:28 AM Non about development
    Wednesday, May 23, 2018 6:09 AM

All replies

  • Hi,

    thanks for posting here.

    >>MFC application can freeze for several minutes while Windows is doing OS updates (by msiexec.exe and wmiprvse.exe)

    In my opinion, it's because the Windows update is updating some SDK libraries which you're using. You couldn't access these files while updating.

    For this case, I suggest you post on this forum below.


    Your understanding and cooperation will be grateful.

    Best Regards,

    Baron Bi

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 24, 2018 7:47 AM