Level 33 C++ sourcerer. https://about.me/marek.knapek

  • 0 Posts
  • 3 Comments
Joined 3 years ago
cake
Cake day: June 29th, 2023

help-circle


  • Win32 MFC desktop application, should be able to run continuously unsupervised for days or weeks. When I log in via RDP it crashed. Yes, just in that moment. In the end I figured it out.

    MFC supports multiple visual styles, such as classic Windows, few Office versions and few more. We used feature for loading (possibly translated) strings (resource) from various DLLs. First from a currently active plug-in DLL, if the string was not there, then from a sub-system DLL, if it was not there then from main EXE. Plus there was some logic about translation and fallback to English in case of missing or not up-to-date translation. The cause was in one of the MFC visual styles, it changed a global variable related to that string loading thing for a short duration of time, then changed it back. It was only in one of the styles and there was no need to change it, the code could just load the value and use it as a parameter to a function that needed it. Our code in a different thread failed to load a string and threw an exception. Cross a COM interface boundary. Every COM method is decorated by a bunch of macros our senior engineer didn’t understand and was not willing to learn. One of the macros was noexcept. Thus an exception being thrown cross an noexcept boundary crashed our app.