libgit2 / libgit2/libgit2sharp
System.AccessViolationException on CherryPick
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C#
- Star
- 3.5k
- Fork
- 925
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
You are opening a bug report against the LibGit2Sharp project: we
use GitHub Issues for tracking bug reports and feature requests. If
you have a question about an API or usage, please ask on StackOverflow:
http://stackoverflow.com/questions/tagged/libgit2sharp.
Otherwise, to report a bug, please fill out the reproduction steps
(below) and delete these introductory paragraphs. Thanks!
Reproduction steps
public static void Main(string[] args) {
Download();
}
public static Tag GetLatestVersion()
{
using Repository repo = new("./");
return repo.Tags
// Order by version: 2.0.0, 1.2.0, 1.0.0, etc
.OrderByDescending(tag => tag.FriendlyName)
// Gets latest tag
.First();
}
public static void Download()
{
using Repository repo = new("./");
Tag latestTag = GetLatestVersion();
CherryPickOptions cherryPickOptions = new();
cherryPickOptions.FailOnConflict = false;
cherryPickOptions.FileConflictStrategy = CheckoutFileConflictStrategy.Theirs;
cherryPickOptions.FindRenames = true;
cherryPickOptions.IgnoreWhitespaceChange = false;
repo.CherryPick((Commit)latestTag.Target, new Signature(Program.Config.Update.GitName, Program.Config.Update.GitEmail, DateTimeOffset.Now), cherryPickOptions);
}
Expected behavior
Specific commit from tag to be cherrypicked
Actual behavior
System.AccessViolationException exception thrown. Message:
An unhandled exception of type 'System.AccessViolationException' occurred in LibGit2Sharp.dll:
'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
<Cannot evaluate the exception stack trace>
Version of LibGit2Sharp (release number or SHA1)
0.26.2 (Nuget)
Operating system(s) tested; .NET runtime tested
Windows 10 64bit; Dotnet 5.0.202
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với bản tái hiện Download và GetLatestVersion bằng C# được cung cấp, đặc biệt là lệnh gọi repo.CherryPick, sử dụng LibGit2Sharp 0.26.2 trên Windows 10 x64 với .NET 5. Theo dõi quá trình thực thi CherryPick từ điểm vào này và xác minh rằng access violation không còn xảy ra nữa cũng như commit được gắn thẻ được cherrypick như mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp, git
- Lĩnh vực
- devtools
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100