KEMBAR78
cmake/msvc: unify CRT model and add VTune-safe flags for RelWithDebInfo by leonardo-intel · Pull Request #349 · oneapi-src/level-zero · GitHub
Skip to content

Conversation

@leonardo-intel
Copy link
Contributor

RelWithDebInfo was built with /MD while Release used /MT, creating cross-heap mismatches that crashed in MSVCP140.dll when VTune injected its collector DLLs.

Changes

• All build types now use the same C++ runtime (either all static or
all dynamic, depending on the MSVC_BUILD_L0_DYNAMIC_VCRUNTIME flag).
This prevents the "two-different-heaps" problem that caused the
MSVCP140.dll crash when VTune was attached.

• For RelWithDebInfo we also turned off “incremental linking” and kept a
full PDB file. VTune can read these symbols and no longer trips over
the extra jump table that incremental builds add.

Bottom line: you can now profile the RelWithDebInfo build in VTune without any access-violation errors.

@leonardo-intel leonardo-intel force-pushed the EISW-169503 branch 2 times, most recently from ab4664d to 6ec1bda Compare June 17, 2025 21:46
RelWithDebInfo was built with /MD while Release used /MT, creating
cross-heap mismatches that crashed in MSVCP140.dll when VTune injected
its collector DLLs.

Changes
------------
• All build types now use the same C++ runtime (either all static or
  all dynamic, depending on the MSVC_BUILD_L0_DYNAMIC_VCRUNTIME flag).
  This prevents the "two-different-heaps" problem that caused the
  MSVCP140.dll crash when VTune was attached.

• For RelWithDebInfo we also turned off “incremental linking” and kept a
  full PDB file.  VTune can read these symbols and no longer trips over
  the extra jump table that incremental builds add.

Bottom line: you can now profile the RelWithDebInfo build in VTune
without any access-violation errors.
@nrspruit nrspruit merged commit c34654e into oneapi-src:master Jun 17, 2025
50 checks passed
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

Successfully merging this pull request may close these issues.

2 participants