Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug assert in cairo-dwrite-font.cpp #1

Open
vasilich-tregub opened this issue Feb 14, 2023 · 0 comments
Open

debug assert in cairo-dwrite-font.cpp #1

vasilich-tregub opened this issue Feb 14, 2023 · 0 comments

Comments

@vasilich-tregub
Copy link

I have built a test program with harfbuzz and cairo in MSVC2022 (MSBuild project, language c++20) in debug configuration. The code has a line cairo_glyph_path(cr, cairoglyphs, glyph_count);. When running the program (F5, Start Debugging), I receive a debug assert in cairo-dwrite-font.cpp, line 739, function _controlfp_s(&control_word, _CW_DEFAULT, MCW_PC);
"Debug Assertion Failed! ... File: minkernel/crts/ucrt/appcrt/tran/amd64/ieee.c"
resulting from use of an unassigned variable unsigned int control_word;.
When the same program is built in MSVC CMake project (platform Local machine (Windows10), language C++20), it runs without these annoying debug assert message popups. The reason is obvious: the MSBuild project copies the file \vcpkg\installed\x64-windows\debug\bin\cairo-2.dll into the \x64\debug folder, while the CMake project does not copy dll files into the ...\out\build<projectName> folder but the project executable directly loads dll modules from the directories specifies with the PATH environment (like \vcpkg\installed\x64-windows\debug\bin, \vcpkg\installed\x64-windows\bin) and selects the cairo-2.dll linked in the release configuration.
To be able to debug my MSBuild-linked program, I have to specify what cairo-2.dll of the two MSVC should use, adding the Postbuild event copy /Y "C:\vcpkg\installed\x64-windows\bin\cairo-2.dll" $(TargetDir) for the debug configuration.

The cairo-dwrite-font.cpp code update initializing the control_word variable before its use would solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant