Skip to content

ci: enable MSVC /RTCu runtime checks with dialog suppression#8

Open
ludomal wants to merge 9 commits into
STL2026_sv56_waviofrom
fix/windows-rtc-checks
Open

ci: enable MSVC /RTCu runtime checks with dialog suppression#8
ludomal wants to merge 9 commits into
STL2026_sv56_waviofrom
fix/windows-rtc-checks

Conversation

@ludomal

@ludomal ludomal commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Enable runtime detection of uninitialized variable use on Windows CI without popup dialogs.

Problem

MSVC Debug builds show modal popup dialogs when runtime checks (/RTCu) detect uninitialized variable use. These popups block CI and are not caught by /we4700 (compile-time only).

Solution

  • Add src/utl/msvc_rtc_handler.c: installs a custom _RTC_SetErrorFuncW handler that prints to stderr and exits instead of showing a popup. Also suppresses CRT debug dialogs and Windows Error Reporting.
  • CMakeLists.txt: enables /RTCu in Debug builds and links the handler into all targets.
  • CI: build and test Windows in Debug mode to activate runtime checks.

Expected outcome

Any tool with uninitialized variable use at runtime will fail ctest with a clear error message instead of hanging on a popup.

@ludomal ludomal force-pushed the fix/windows-rtc-checks branch 3 times, most recently from 64b5496 to e8a4906 Compare June 10, 2026 20:19
- Add separate 'MSVC static analysis' CI job using /analyze flag
  Fails if C6001 (uninitialized variable use) warnings are found
- Main Windows job builds in Debug mode with /RTCu runtime checks
- Add src/utl/msvc_rtc_handler.c: custom RTC handler that prints to
  stderr and exits instead of showing popup dialog
- Use STATIC library with /INCLUDE to force the handler into all
  executables

Two complementary approaches:
- /analyze catches issues at compile time regardless of test coverage
- /RTCu catches issues at runtime when test data exercises the path
@ludomal ludomal force-pushed the fix/windows-rtc-checks branch from e8a4906 to e3e505d Compare June 10, 2026 20:44
Ludovic Malfait added 5 commits June 10, 2026 22:01
# Conflicts:
#	.github/workflows/ci.yml
- g728fpdec.c: init d->ogaindb=0 in decoder state (was read before first write)
- is54/init.c: calloc for P array (malloc left it uninitialized, tainted Cl)
- is54/lag.c: revert E init (not the cause; P was the issue)
- wmc_tool/c_parser.cpp: memset Insert record before filling (String padding)
# Conflicts:
#	.github/workflows/ci.yml
@ludomal ludomal force-pushed the fix/windows-rtc-checks branch from 2d92c5e to 426a6da Compare June 10, 2026 21:22
Ludovic Malfait added 3 commits June 10, 2026 22:27
- is54/init.c: convert all malloc to calloc (zeroes all codec state
  arrays, preventing tainted data flowing into lag search)
- wmc_tool/c_parser.cpp: initialize OperInsTbl.Data = NULL
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.

1 participant