AlexandrePTJ / kemai

Kimai desktop client
MIT License
92 stars 25 forks source link

ucrtbase.dll 0xc0000409 - won't launch on latest Win 11 #121

Closed ensemblebd closed 3 months ago

ensemblebd commented 4 months ago

Tried a couple of pc's, same result. Closes instantly when opening it.

Checking Event Viewer, found the error code 0xc0000409 on ucrtbase.dll. It's notable however, critical perhaps, that the path to dll shown Event Viewer appears to be System32's variant. NOT the one sitting in the root folder right next to Kemai.exe

Online seems to indicate windows changed something in a recent KB update, which affects programs referencing this library. And since it's in the GAC, the one provided in root folder is not used. Unfortunately the system uses it, so I can't replace it to test viability of theory. I could remove the GAC entry perhaps, but not sure how safe that would be for system stability.

Is there anything we can do to get around this issue? Wondering if perhaps statically linking this specific dll (and/or it's dependency chain) would solve.

AlexandrePTJ commented 4 months ago

I am trying another way for handling installer and deploy. Hope to fix this soon.

FloFloZone commented 3 months ago

Hey, @AlexandrePTJ did you have found a solution for W11 ?

AlexandrePTJ commented 3 months ago

Note yet sorry. However there is pre-release package for the UI refactoring I am working on. This does also include a new way to create packages and installer. Maybe you should test it and tell me it does fix the problem. In this case I will port back this evolution to current release. https://github.com/AlexandrePTJ/kemai/releases/tag/98-break-ui

ensemblebd commented 3 months ago

MSI package on the pre-release resulted in same error for me unfortunately.

Tried compiling from source, downloaded cmake 3.30.0-rc4 and Qt 6.7.2 CE for windows, and followed the readme to build (QT-> msvc2019_64). Got multiple errors stemming from WinDeployQt.cmake, and the ./build/Kemai file showing "Debug" despite the Build type set to Release. Fixed by using: -DCMAKE_CONFIGURATION_TYPES=Release in the cmake command right after -DCMAKE_BUILD_TYPE=Release

Output sample:

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The CXX compiler identification is MSVC 19.38.33134.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.38.33130/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Version: 10.2.1
-- Build type: Release
-- Build spdlog: 1.14.0
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Build type: Release
-- Using Qt 6.7.2
-- The C compiler identification is MSVC 19.38.33134.0

Followed by C:\Qt\Tools\QtDesignStudio\qt6_design_studio_reduced_version\bin\windeployqt6.exe ./build/src/Release

And getting same result. Using the .sln to debug, I get the following error: Unhandled exception at 0x00007FF8C8EFF39C in Kemai.exe: Microsoft C++ exception: spdlog::spdlog_ex at memory location 0x0000004AC895EEA0. But lacked PDB debug symbols. So reran above using Build_type of Debug.

Which then from .sln debug ssession breaked on line 63 of _deps/spdlog-src/include/spdlog/common-inl.h , with an inner error message of: Failed opening file C:/Users/THE_USER/AppData/Roaming/Kemai/Kemai/kemai.log for writing

I created this folder path manually, and it's working!!!! Closed down the debug stuff and custom build, and switched back to the MSI installed product. And it too is working perfectly.

So that's the cause! It seems it can't (or doesn't) pre-create the Roaming folder paths, and thus can't log to it's log file.

So for now, anyone experiencing this, just create two Kemai folders: C:\Users\YourUsername\AppData\Roaming\Kemai\Kemai\ and problem is solved

P.s. the new UI from break-ui looks fantastic. <3 Reminds me of Toggl, it's perfect, dark mode is much easier on the eyes.

AlexandrePTJ commented 3 months ago

Thanks you @ensemblebd for this great bug tracking !