You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
replace desktop PublicNetworkListManager use with Windows.Networking.Connectivity, preserving metered-network cost updates without loading the leaking netprofm.dll
run Dr. Memory analysis on Windows and Linux after relevant changes reach main, with manual dispatch available on demand
analyze unit tests, functional tests, and SampleCppMini with pinned, SHA-256-verified tooling
publish leak counts to the job summary and retain raw reports for 90 days
keep the current leak baseline non-gating while failing explicitly on instrumentation/target errors
fail Windows leak analysis if netprofm.dll is loaded again
centralize pthread-safe mbedTLS configuration in the SDK-owned fetched curl path
document one dependency policy for Apple, Linux, Windows, and Android consumers
document host-owned SQLite lifecycle requirements when multiple embedded SDK copies share system SQLite
Validation
Visual Studio 2026 x64 Debug build of UnitTests and SampleCppMini
focused Windows network/configuration tests: 31 passed
GCC/WSL syntax check of SampleCppMini
actionlint 1.7.12 and PowerShell parser validation
hosted Dr. Memory runs on Windows and Linux, including the netprofm.dll regression gate
Known instrumentation exclusion
BasicFuncTests.killSwitchWorks remains covered by normal CI but is excluded under Dr. Memory because instrumentation changes its exact asynchronous drop count (400 observed versus 100 expected).
OfflineStorageTests_SQLite.StoreThousandEventsTakesLessThanASecond remains covered by normal CI but is excluded under Dr. Memory because instrumentation invalidates its one-second wall-clock performance threshold (1.384 seconds observed).
Track Windows and Linux leak counts without making the known baseline block unrelated changes. Pin and verify Dr. Memory, retain raw reports, and publish per-scenario summaries for unit tests, functional tests, and SampleCppMini.
Files changed:
- .github/workflows/memory-leak-analysis.yml
- .github/scripts/run-drmemory.ps1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
Run the expensive analysis only when its workflow or helper changes, so this PR and future maintenance updates exercise both hosted platforms before merge.
Files changed:
- .github/workflows/memory-leak-analysis.yml
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
Build Linux targets without entering the package deployment path, and ignore Dr. Memory's incomplete Windows bootstrap report while retaining it in the raw artifact.
Files changed:
- .github/scripts/run-drmemory.ps1
- .github/workflows/memory-leak-analysis.yml
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
Install the Linux curl development dependency, avoid the unrelated installed-package target regression when compiling the sample, and exclude the one functional assertion whose exact asynchronous drop count changes under instrumentation.
Files changed:
- .github/workflows/memory-leak-analysis.yml
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
Recognize Dr. Memory's clean-report marker and disambiguate SampleCppMini's signed 64-bit EventProperty construction so the same sample compiles under GCC and MSVC.
Files changed:
- .github/scripts/run-drmemory.ps1
- examples/cpp/SampleCppMini/main.cpp
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
Use Windows.Networking.Connectivity for both cost queries and change notifications so network detection preserves behavior without instantiating PublicNetworkListManager or loading netprofm.dll. Fail periodic leak analysis if netprofm returns.
Files changed:
- lib/pal/desktop/NetworkDetector.cpp
- lib/pal/desktop/NetworkDetector.hpp
- .github/workflows/memory-leak-analysis.yml
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
bmehta001
changed the title
Add periodic Windows and Linux memory leak reports
Fix Windows network detection leak and add periodic leak reports
Sep 18, 2026
Use scoped objects for temporary event and buffer allocations, and destroy the log-session provider during fixture teardown so leak reports represent SDK behavior rather than test fixture ownership.
Files changed:
tests/unittests/AnnexKTests.cpp
tests/unittests/LogSessionDataDBTests.cpp
tests/unittests/TransmissionPolicyManagerTests.cpp
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
Exercise the real Windows detector so CI proves that WinRT status registration starts, network cost remains valid, shutdown completes, and netprofm.dll is not loaded.
Files changed:
tests/unittests/NetworkDetectorTests.cpp
tests/unittests/CMakeLists.txt
tests/unittests/UnitTests.vcxproj
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
Delete the unused NLM interfaces, connection points, callbacks, maps, compatibility branch, and manual reference counting now that network detection is entirely WinRT-based. This reduces object and binary overhead while keeping ownership with unique_ptr.
Files changed:
docs/building-custom-SKU.md
lib/pal/desktop/NetworkDetector.cpp
lib/pal/desktop/NetworkDetector.hpp
lib/pal/desktop/WindowsDesktopNetworkInformationImpl.cpp
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
Avoid spending hosted runner time when main has not changed while preserving manual analysis on demand.
Files changed:
- .github/workflows/memory-leak-analysis.yml
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
Restore approaching-data-limit handling in the WinRT cost mapping, verified in lib/pal/desktop/NetworkDetector.cpp.
Check netprofm.dll while the detector is active, verified in tests/unittests/NetworkDetectorTests.cpp.
Include APITest.C_API_Test in Linux leak analysis after confirming the test passes on Linux, verified in .github/workflows/memory-leak-analysis.yml.
Files changed:
- .github/workflows/memory-leak-analysis.yml
- lib/pal/desktop/NetworkDetector.cpp
- tests/unittests/NetworkDetectorTests.cpp
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
Store network cost and running state atomically so WinRT callbacks cannot race caller reads. Return the cached cost by value instead of exposing a concurrently updated reference.
Verified at:
- lib/pal/desktop/NetworkDetector.cpp
- lib/pal/desktop/NetworkDetector.hpp
Files changed:
- lib/pal/desktop/NetworkDetector.cpp
- lib/pal/desktop/NetworkDetector.hpp
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The workflow contains an ignored build property, and the new network-cost test does not validate cost mapping or updates.
Review details
Suppressed comments (2)
Previously missed (2) — in code that hasn't changed since the last review.
.github/workflows/memory-leak-analysis.yml:67
MATSDK_USE_WININET is not consumed by any project, props, targets, or source in this repository, so this MSBuild property is silently ignored; the Win32 factory still selects WinInet (lib/http/HttpClientFactory.hpp:27-29). Remove the no-op argument, or wire the intended transport selection into the build before relying on it for this analysis. tests/unittests/NetworkDetectorTests.cpp:25
This assertion accepts every possible NetworkCost, so an implementation that always returns Unknown still passes and the test does not verify the stated preservation of metered-cost behavior. Add a mocked/injectable WinRT source (or extract the mapping helper) and assert unrestricted, fixed/variable, and roaming/limit mappings, including a status-change refresh.
Remove the ignored MATSDK_USE_WININET build property so leak analysis does not imply a transport selection it never made.
Extract and test WinRT cost mapping for unrestricted, metered, roaming, over-limit, and approaching-limit states, and verify synchronous refresh updates the cache.
Verified at:
- .github/workflows/memory-leak-analysis.yml
- lib/pal/desktop/NetworkDetector.cpp
- tests/unittests/NetworkDetectorTests.cpp
Files changed:
- .github/workflows/memory-leak-analysis.yml
- lib/pal/desktop/NetworkDetector.cpp
- lib/pal/desktop/NetworkDetector.hpp
- tests/unittests/NetworkDetectorTests.cpp
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Callback teardown has a potential use-after-free, and the DLL regression gate does not reliably detect module loading.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
.github/workflows/memory-leak-analysis.yml:115
This does not establish that netprofm.dll was never loaded. Dr. Memory's results.txt only mentions modules that appear in reported errors/stacks, while the module-loading diagnostics are written to global.<pid>.log (and require suitable verbosity); the *.txt filter excludes those logs. Thus a run that loads netprofm.dll without a report involving it passes this advertised regression gate. Enable module-load logging and inspect the global logs, or instrument each target to query its loaded modules directly.
Keep per-subscription callback state alive independently, reject callbacks after shutdown starts, and wait for active callbacks before releasing detector resources.
Inspect Dr. Memory global module logs for netprofm.dll and require logs for every Windows scenario so the regression gate cannot pass vacuously.
Verified at:
- lib/pal/desktop/NetworkDetector.cpp
- .github/workflows/memory-leak-analysis.yml
Files changed:
- .github/workflows/memory-leak-analysis.yml
- lib/pal/desktop/NetworkDetector.cpp
- lib/pal/desktop/NetworkDetector.hpp
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9f344e-e064-404e-ae6f-c0ef455d747c
The reason will be displayed to describe this comment to others. Learn more.
Copilot review overview
🔵 Needs a closer look
The Linux Dr. Memory run omits a required timing-test exclusion and may fail before producing its report.
Review effort: Balanced Findings: None
Previously missed (1)
In code that hasn't changed since last review
Exclude SQLite performance test from Linux Dr. Memory run
.github/workflows/memory-leak-analysis.yml:197
The Linux unit-test analysis still runs OfflineStorageTests_SQLite.StoreThousandEventsTakesLessThanASecond, even though the PR's known instrumentation exclusions say this test must remain excluded under Dr. Memory because instrumentation violates its one-second threshold. This can fail the Linux job before its leak report is published; pass the same filter used by the Windows invocation.
Copilot's final suppressed note about excluding OfflineStorageTests_SQLite.StoreThousandEventsTakesLessThanASecond on Linux is not actionable. The Windows exclusion was added after the instrumented Windows run took 1.384 seconds. The hosted Linux Dr. Memory job in run 35392664701 executed the unfiltered unit-test binary, completed successfully, and produced its leak report. Keeping the test on Linux preserves coverage; only the platform demonstrated to violate the timing threshold is excluded.
Bring in the latest modules submodule update without rewriting the reviewed PR history.
Files changed:
- lib/modules
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve the Windows workflow conflict while preserving CMake setup and the WinHTTP/WinInet matrix. Set the desktop API floor to Windows 8.1 and remove the pre-8.1 WinHTTP proxy fallback so CI enforces the supported contract.
Files changed: merged upstream main; .github/workflows/test-win-latest.yml; README.md; lib/CMakeLists.txt; lib/http/HttpClient_WinHttp.cpp; Solutions Windows project files; tests/headers/check_public_headers.cmd.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Version and validate the Android CMake/NDK marker so stale setup state cannot hide missing tools. Provision CMake for the Linux no-exceptions job that failed under the runner's 3.31 release.
Raise desktop builds and header gates to the Windows 10 API floor. Remove the Windows 7 runtime probe, hand-defined network-cost GUID, and obsolete warning suppressions in favor of the SDK IID.
Files changed: Android and Linux setup paths, Windows workflows/docs/project definitions, WinHTTP and network detection sources, and the public-header gate.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fa477318-3257-45cd-8711-d5214b5cb119
Expose the public mbedTLS threading macros to curl so both dependencies compile public context types with identical layouts and avoid an entropy-context overflow.
Files changed: cmake/MatsdkFetchCurl.cmake.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fa477318-3257-45cd-8711-d5214b5cb119
Added commands to install Android SDK platforms and sources.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Add uuid to the Windows target dependencies so SDK-declared COM GUID symbols resolve for CMake consumers instead of relying on toolchain defaults.
Files changed:
- lib/CMakeLists.txt: propagate the Windows UUID import library through mat.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c72c9f67-f709-4c28-a8fa-809e0aefc14d
Disable curl's build-host CA auto-detection and remove generated CA path macros so redistributable Linux binaries rely on the target host's runtime CA selection.
Files changed:
- cmake/MatsdkFetchCurl.cmake: sanitize fetched curl CA defaults and enforce that no build-time path remains.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c72c9f67-f709-4c28-a8fa-809e0aefc14d
Integrate PR microsoft#1537 into PR microsoft#1536 so the dependency and platform updates ship with the leak-analysis work. Resolve the network detector overlap in favor of the leak-safe WinRT lifecycle, narrow the SEH warning suppressions, and consistently enforce the Windows 10 API floor without legacy Windows fallbacks.
Files changed: Windows workflows/projects/docs, CMake dependency setup, Android build setup, WinHTTP transport, and WinRT network detection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d2b55402-0dec-4ad7-bf0f-d30d92c96171
A live upload to external collector endpoints can fail or stall on CI without indicating a certificate-policy regression. Verify that both Windows transports apply the log configuration directly; retain the separate cold-session HTTPS test for real certificate enforcement.
Files changed: tests/functests/APITest.cpp
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d2b55402-0dec-4ad7-bf0f-d30d92c96171
SurvivesManyRequests leaked all 100 SDK-created request objects, overflowing Dr. Memory's indirect-byte summary and failing Linux CI parsing. Keep the requests alive through their terminal callbacks and release them at test exit instead of relaxing the leak gate.
Files changed: tests/unittests/HttpClientTests.cpp
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d2b55402-0dec-4ad7-bf0f-d30d92c96171
The Windows 10 API-floor label renamed previously required Win32 and x64 Release checks, leaving their old contexts without runs even though the equivalent builds passed. Keep the Windows 10 build settings and restore stable CI job names so the two release checks run again.
Files changed: .github/workflows/test-win-latest.yml
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: d2b55402-0dec-4ad7-bf0f-d30d92c96171
bmehta001
changed the title
Fix Windows network detection leak and add periodic leak reports
Fix Windows network detection leak, add periodic leak reports, and standardize dependencies
Sep 24, 2026
build-android.cmd, tools/setup-buildtools-android.cmd: store normalized LF text in Git while preserving CRLF Windows checkouts.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: the latest successful run is already above this baseline for 8 Linux unit-test metrics and 4 Windows unit-test metrics. For example, possible-leak bytes increased from 3,452 to 208,600 on Linux and from 7,206 to 225,649 on Windows. Please check whether these increases are expected after the recent test and dependency changes. Then run the jobs again to confirm the numbers are stable and update this baseline with a short explanation if needed. This will keep future warnings useful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PublicNetworkListManageruse withWindows.Networking.Connectivity, preserving metered-network cost updates without loading the leakingnetprofm.dllmain, with manual dispatch available on demandnetprofm.dllis loaded againValidation
netprofm.dllregression gateKnown instrumentation exclusion
BasicFuncTests.killSwitchWorksremains covered by normal CI but is excluded under Dr. Memory because instrumentation changes its exact asynchronous drop count (400 observed versus 100 expected).OfflineStorageTests_SQLite.StoreThousandEventsTakesLessThanASecondremains covered by normal CI but is excluded under Dr. Memory because instrumentation invalidates its one-second wall-clock performance threshold (1.384 seconds observed).Closes #634
Related external evidence: microsoft/onnxruntime-genai#2590