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

Force callstacks to only run on untainted threads #7914

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

wiktork
Copy link
Member

@wiktork wiktork commented Feb 3, 2025

Summary

Use another thread to process non-managed commands in the profiler. This fixes an issue where /parameters (which causes a managed callback in the inproc code) breaks /stacks (which requires a thread that has never ran managed code).

Release Notes Entry

Fix an issue where /stacks route can fail to collect call stacks after /parameters route is used

@wiktork wiktork force-pushed the dev/wiktork/fixTaintedThread branch from 14f2917 to d5fd831 Compare February 3, 2025 21:59
jander-msft
jander-msft previously approved these changes Feb 4, 2025
@jander-msft
Copy link
Member

Let's add release notes for this change and backport to all in-support versions.

@wiktork wiktork force-pushed the dev/wiktork/fixTaintedThread branch from 2c74d89 to effc599 Compare February 4, 2025 02:27
@wiktork wiktork marked this pull request as ready for review February 4, 2025 02:28
@wiktork wiktork requested a review from a team as a code owner February 4, 2025 02:28
@wiktork wiktork merged commit 403f362 into dotnet:main Feb 4, 2025
21 checks passed
@wiktork
Copy link
Member Author

wiktork commented Feb 4, 2025

/backport to release/8.0

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Started backporting to release/8.0: https://github.com/dotnet/dotnet-monitor/actions/runs/13128542067

@wiktork
Copy link
Member Author

wiktork commented Feb 4, 2025

/backport to release/8.x

Copy link
Contributor

github-actions bot commented Feb 4, 2025

@wiktork backporting to release/8.0 failed, the patch most likely resulted in conflicts.

Please backport manually using one of the below commands, followed by git am --continue once the merge conflict has been resolved.

PowerShell

(Invoke-WebRequest "https://github.com/dotnet/dotnet-monitor/commit/403f3620bae3e10f2423578625eb097ce75622d5.patch").Content | git am --3way --ignore-whitespace --exclude="documentation/**.md" --keep-non-patch

Bash

curl -sSL "https://github.com/dotnet/dotnet-monitor/commit/403f3620bae3e10f2423578625eb097ce75622d5.patch" | git am --3way --ignore-whitespace --exclude="documentation/**.md" --keep-non-patch

git am error output:

$ git am --3way --ignore-whitespace --exclude="documentation/**.md" --keep-non-patch changes.patch

Applying: Force callstacks to only run on untainted threads (#7914)
.git/rebase-apply/patch:205: trailing whitespace.
    CallbackInfo(bool unmanagedOnly, std::function<HRESULT (const IpcMessage& message)> callback) 
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	src/Profilers/MonitorProfiler/Communication/CommandServer.cpp
M	src/Profilers/MonitorProfiler/Communication/CommandServer.h
A	src/Profilers/MonitorProfiler/Communication/MessageCallbackManager.cpp
A	src/Profilers/MonitorProfiler/Communication/MessageCallbackManager.h
M	src/Profilers/MonitorProfiler/MainProfiler/MainProfiler.cpp
M	src/Profilers/MutatingMonitorProfiler/ProbeInstrumentation/ProbeInstrumentation.cpp
Falling back to patching base and 3-way merge...
Auto-merging src/Profilers/MutatingMonitorProfiler/ProbeInstrumentation/ProbeInstrumentation.cpp
Auto-merging src/Profilers/MonitorProfiler/MainProfiler/MainProfiler.cpp
CONFLICT (content): Merge conflict in src/Profilers/MonitorProfiler/MainProfiler/MainProfiler.cpp
CONFLICT (modify/delete): src/Profilers/MonitorProfiler/Communication/MessageCallbackManager.h deleted in HEAD and modified in Force callstacks to only run on untainted threads (#7914). Version Force callstacks to only run on untainted threads (#7914) of src/Profilers/MonitorProfiler/Communication/MessageCallbackManager.h left in tree.
CONFLICT (modify/delete): src/Profilers/MonitorProfiler/Communication/MessageCallbackManager.cpp deleted in HEAD and modified in Force callstacks to only run on untainted threads (#7914). Version Force callstacks to only run on untainted threads (#7914) of src/Profilers/MonitorProfiler/Communication/MessageCallbackManager.cpp left in tree.
Auto-merging src/Profilers/MonitorProfiler/Communication/CommandServer.h
CONFLICT (content): Merge conflict in src/Profilers/MonitorProfiler/Communication/CommandServer.h
Auto-merging src/Profilers/MonitorProfiler/Communication/CommandServer.cpp
CONFLICT (content): Merge conflict in src/Profilers/MonitorProfiler/Communication/CommandServer.cpp
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Force callstacks to only run on untainted threads (#7914)
Error: The process '/usr/bin/git' failed with exit code 128

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Started backporting to release/8.x: https://github.com/dotnet/dotnet-monitor/actions/runs/13128544775

github-actions bot pushed a commit that referenced this pull request Feb 4, 2025
* Force callstacks to only run on untainted threads

* Fix build warning

* Fix ctor

* Change name

* Fix key check
@wiktork
Copy link
Member Author

wiktork commented Feb 4, 2025

/backport to release/8.x

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Started backporting to release/8.x: https://github.com/dotnet/dotnet-monitor/actions/runs/13128548453

github-actions bot pushed a commit that referenced this pull request Feb 4, 2025
* Force callstacks to only run on untainted threads

* Fix build warning

* Fix ctor

* Change name

* Fix key check
@wiktork
Copy link
Member Author

wiktork commented Feb 4, 2025

/backport to release/9.x

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Started backporting to release/9.x: https://github.com/dotnet/dotnet-monitor/actions/runs/13128554407

github-actions bot pushed a commit that referenced this pull request Feb 4, 2025
* Force callstacks to only run on untainted threads

* Fix build warning

* Fix ctor

* Change name

* Fix key check
@schmittjoseph schmittjoseph added the update-release-notes Pull requests that should be mentioned in the release notes label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
update-release-notes Pull requests that should be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants