-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Document hangdump known issues on macos #50346
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,3 +61,45 @@ To configure the hang dump file generation, use the following options: | |
| | `--hangdump-filename` | Specifies the file name of the dump. | | ||
| | `--hangdump-timeout` | Specifies the timeout after which the dump is generated. The timeout value is specified in one of the following formats:<br/>`1.5h`, `1.5hour`, `1.5hours`<br/>`90m`, `90min`, `90minute`, `90minutes`<br/>`5400s`, `5400sec`, `5400second`, `5400seconds`. Defaults to `30m` (30 minutes). | | ||
| | `--hangdump-type` | Specifies the type of the dump. Valid values are `Mini`, `Heap`, `Triage`, `Full`. Defaults as `Full`. For more information, see [Types of mini dumps](../diagnostics/collect-dumps-crash.md#types-of-mini-dumps). | | ||
|
|
||
| ### Considerations for macOS | ||
|
|
||
| Taking dumps when running on macOS can be problematic. If you found that a dump has started to be taken, but never finishes, in CI environments where you don't have direct access to the machine, this most likely means that macOS showed a popup asking for authentication and is waiting for you to type a password, which is not feasible to do in such environments. The issue might also manifest as an error similar to the following: | ||
|
|
||
| ```output | ||
| [createdump] This failure may be because createdump or the application is not properly signed and entitled. | ||
| ``` | ||
|
|
||
| To work around this, there are two options: | ||
|
|
||
| - Set `UseAppHost` MSBuild property to false, which will cause the managed assembly to run under `dotnet` instead of the apphost executable. However, this doesn't work for xunit.v3. See [xunit/xunit#3432 GitHub issue](https://github.com/xunit/xunit/issues/3432). | ||
| - Apply a workaround similar to the following: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be a simpler workaround to force
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. xunit.v3 blocks completely the ability to set UseAppHost to false.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you pass
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jkotas xunit doesn't set it to true, they produce an error when it's set to false. |
||
|
|
||
| ```xml | ||
| <Target Name="WorkaroundMacOSDumpIssue" AfterTargets="Build" Condition="$([MSBuild]::IsOSPlatform('OSX')) AND '$(UseAppHost)' != 'false' AND '$(OutputType)' == 'Exe' AND '$(TargetFramework)' != '' AND '$(RunCommand)' != '' AND '$(RunCommand)' != 'dotnet' AND '$(IsTestingPlatformApplication)'=='true'"> | ||
Youssef1313 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <Exec Command="codesign --sign - --force --entitlements '$(MSBuildThisFileDirectory)mtp-test-entitlements.plist' '$(RunCommand)'" /> | ||
| </Target> | ||
| ``` | ||
|
|
||
| and the contents of `mtp-test-entitlements.plist` should be: | ||
|
|
||
| ```xml | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
| <plist version="1.0"> | ||
| <dict> | ||
| <key>com.apple.security.cs.allow-jit</key> | ||
| <true/> | ||
| <key>com.apple.security.cs.allow-dyld-environment-variables</key> | ||
| <true/> | ||
| <key>com.apple.security.cs.disable-library-validation</key> | ||
| <true/> | ||
| <key>com.apple.security.cs.debugger</key> | ||
| <true/> | ||
| <key>com.apple.security.get-task-allow</key> | ||
| <true/> | ||
| </dict> | ||
|
Comment on lines
+91
to
+101
|
||
| </plist> | ||
| ``` | ||
|
|
||
| The MSBuild target above can be placed in Directory.Build.targets so that it applies to all projects. | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing Oxford comma in the list. Change "signed and entitled" to "signed, and entitled" according to the mandatory Oxford comma rule in the Markdown style guidelines.