Title: AccessViolationException accessing Commit.Parents concurrently on Linux .NET 10 · Issue #2192 · libgit2/libgit2sharp · GitHub
Open Graph Title: AccessViolationException accessing Commit.Parents concurrently on Linux .NET 10 · Issue #2192 · libgit2/libgit2sharp
X Title: AccessViolationException accessing Commit.Parents concurrently on Linux .NET 10 · Issue #2192 · libgit2/libgit2sharp
Description: Environment LibGit2Sharp 0.32.0 LibGit2Sharp.NativeBinaries 2.0.324 (libgit2 1.8.6) .NET SDK/runtime 10.0.400 Linux x64, GitHub-hosted Ubuntu 24.04 runner Failure A test process intermittently terminates with System.AccessViolationExcept...
Open Graph Description: Environment LibGit2Sharp 0.32.0 LibGit2Sharp.NativeBinaries 2.0.324 (libgit2 1.8.6) .NET SDK/runtime 10.0.400 Linux x64, GitHub-hosted Ubuntu 24.04 runner Failure A test process intermittently term...
X Description: Environment LibGit2Sharp 0.32.0 LibGit2Sharp.NativeBinaries 2.0.324 (libgit2 1.8.6) .NET SDK/runtime 10.0.400 Linux x64, GitHub-hosted Ubuntu 24.04 runner Failure A test process intermittently term...
Opengraph URL: https://github.com/libgit2/libgit2sharp/issues/2192
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AccessViolationException accessing Commit.Parents concurrently on Linux .NET 10","articleBody":"## Environment\r\n\r\n- LibGit2Sharp 0.32.0\r\n- LibGit2Sharp.NativeBinaries 2.0.324 (libgit2 1.8.6)\r\n- .NET SDK/runtime 10.0.400\r\n- Linux x64, GitHub-hosted Ubuntu 24.04 runner\r\n\r\n## Failure\r\n\r\nA test process intermittently terminates with `System.AccessViolationException` while accessing `Commit.Parents` during a version-height calculation. The test uses distinct temporary repositories per test instance, and the `LibGit2Context` and its `Repository` are both live and strongly referenced throughout the failing call.\r\n\r\nThe latest occurrence is in this public GitHub Actions job:\r\nhttps://github.com/dotnet/Nerdbank.GitVersioning/actions/runs/33464845055/job/99722455984\r\n\r\nRelevant managed stack:\r\n\r\n```text\r\nSystem.AccessViolationException: Attempted to read or write protected memory.\r\n at Nerdbank.GitVersioning.LibGit2.LibGit2GitExtensions.\u003cGetCommitHeight>g__TryCalculateHeight|19_0(LibGit2Sharp.Commit, \u003c>c__DisplayClass19_0 ByRef)\r\n at Nerdbank.GitVersioning.LibGit2.LibGit2GitExtensions.GetCommitHeight(LibGit2Sharp.Commit, GitWalkTracker, Func\u003cCommit, Boolean>)\r\n at Nerdbank.GitVersioning.LibGit2.LibGit2GitExtensions.GetVersionHeight(LibGit2Context, Version)\r\n at Nerdbank.GitVersioning.LibGit2.LibGit2Context.CalculateVersionHeight(VersionOptions, VersionOptions)\r\n at Nerdbank.GitVersioning.VersionOracle..ctor(GitContext, ICloudBuild, Nullable\u003cInt32>)\r\n at VersionOracleTests.CloudBuildNumber_4thPosition(...)\r\n```\r\n\r\n`TryCalculateHeight` is walking `commit.Parents`; this theory does not configure path filters, so it does not call `Diff.Compare`.\r\n\r\n## Investigation\r\n\r\nWe found and fixed separate repository-local lifetime defects where a lazy commit query escaped its context and a `VersionOracle` retained a disposed context. This crash persists after those fixes, and the present stack has no escaped lazy sequence or disposed native owner.\r\n\r\nThe test assembly's normal xUnit test-collection parallelism is the remaining variable. We are temporarily serializing test collections to prevent the intermittent native process crash, but would prefer a LibGit2Sharp/libgit2 fix or guidance about concurrent independent repository operations on Linux/.NET 10.\r\n\r\nRelated historical reports include #988 and #1513, but this report targets the current package versions and live-context `Commit.Parents` failure.\r\n","author":{"url":"https://github.com/AArnott","@type":"Person","name":"AArnott"},"datePublished":"2026-09-01T03:19:53Z","url":"https://github.com/libgit2/libgit2sharp/issues/2192"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:570e06a7-b1c9-fd6f-c6d9-3af26b8a2e39 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D400:BAAC6:66756:8B670:6AFD5969 |
| html-safe-nonce | b18f61591caa0f431e9a19ecd7f824cd6e65deedc71e23072827d0f766377e33 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDAwOkJBQUM2OjY2NzU2OjhCNjcwOjZBRkQ1OTY5IiwidmlzaXRvcl9pZCI6IjQ4OTAwNjE2NDExNTgwNTYyOTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 32b91ec7a82bc71051dec0a89b583f1cb27ebc7aeca4a6052bb6a09a8af35427 |
| hovercard-subject-tag | issue:5307421812 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/libgit2/libgit2sharp/2192/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d52f97a5dee3eb610001b58ca3983c27e56e8d4caf32e8e6bf5eb2ac493d253f/libgit2/libgit2sharp/issues/2192 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d52f97a5dee3eb610001b58ca3983c27e56e8d4caf32e8e6bf5eb2ac493d253f/libgit2/libgit2sharp/issues/2192 |
| og:image:alt | Environment LibGit2Sharp 0.32.0 LibGit2Sharp.NativeBinaries 2.0.324 (libgit2 1.8.6) .NET SDK/runtime 10.0.400 Linux x64, GitHub-hosted Ubuntu 24.04 runner Failure A test process intermittently term... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | AArnott |
| hostname | github.com |
| expected-hostname | github.com |
| None | 66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e |
| turbo-cache-control | no-preview |
| go-import | github.com/libgit2/libgit2sharp git https://github.com/libgit2/libgit2sharp.git |
| octolytics-dimension-user_id | 394745 |
| octolytics-dimension-user_login | libgit2 |
| octolytics-dimension-repository_id | 1415168 |
| octolytics-dimension-repository_nwo | libgit2/libgit2sharp |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1415168 |
| octolytics-dimension-repository_network_root_nwo | libgit2/libgit2sharp |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b6f01f7cb9f35f8c09949773241a3d49dd04b340 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width