Crash when returning a IntPtr when dynamically invoke .NET APIs
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Bắt đầu tại src/NodeApi/JSValue.cs:609 và tái hiện lỗi với NativeLibrary.GetMainProgramHandle() từ ví dụ Node.js REPL được cung cấp. So sánh stack trace với các API khác trả về IntPtr; hoàn tất khi các lệnh gọi động này không còn bị crash và trả về kết quả thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi!
When I try to invoke dynamically an API which returns an IntPtr (e.g. GetMainProgramHandle()) the process crashes:
C:\Users\xc3ll>node
Welcome to Node.js v16.15.1.
Type ".help" for more information.
> const test = require('node-api-dotnet');
> handle = test.System.Runtime.InteropServices.NativeLibrary.GetMainProgramHandle()
Microsoft.JavaScript.NodeApi.JSException: Invalid argument: Error in DefineProperties at D:\a\_work\1\s\src\NodeApi\JSValue.cs:609
at REPL72:1:60
at Script.runInThisContext (node:vm:129:12)
at REPLServer.defaultEval (node:repl:566:29)
at bound (node:domain:421:15)
at REPLServer.runBound [as eval] (node:domain:432:12)
at REPLServer.onLine (node:repl:893:10)
at REPLServer.emit (node:events:539:35)
at REPLServer.emit (node:domain:475:12)
at REPLServer.Interface._onLine (node:readline:487:10)
at REPLServer.Interface._line (node:readline:864:8)
at Microsoft.JavaScript.NodeApi.JSValue.<>c__DisplayClass114_0.<DefineProperties>b__0(String _, ReadOnlySpan`1 descriptorsPtr)
at Microsoft.JavaScript.NodeApi.JSValue.ToUnmanagedPropertyDescriptors(String name, IReadOnlyCollection`1 descriptors, UseUnmanagedDescriptors action)
at Microsoft.JavaScript.NodeApi.JSValue.DefineProperties(JSPropertyDescriptor[] descriptors)
at Microsoft.JavaScript.NodeApi.JSError.CreateErrorValueForException(Exception exception, String& message)
at Microsoft.JavaScript.NodeApi.JSError.ThrowError(Exception exception)
at Microsoft.JavaScript.NodeApi.JSValue.InvokeCallback[TDescriptor](napi_env env, napi_callback_info callbackInfo, JSValueScopeType scopeType, Func`2 getCallbackDescriptor)
at Microsoft.JavaScript.NodeApi.JSValue.InvokeJSMethod(napi_env env, napi_callback_info callbackInfo)
I tested it with other functions and the result is the same.
- Ngôn ngữ chính
- C#
- Star
- 783
- Fork
- 80
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
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.
Issue khác của microsoft/node-api-dotnet
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
microsoft/node-api-dotnet#484 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microsoft/node-api-dotnet#481 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoft/node-api-dotnet#486 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
microsoft/node-api-dotnet#483 · 1 bình luận · 1 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
microsoft/node-api-dotnet#479 ·
Tất cả issue của microsoft/node-api-dotnet
Issue tương tự
-
bug documentation frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
azurenoops/spin_agent#975 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SubtitleEdit/subtitleedit#15108 · 1 bình luận ·
-
area/docs-content Bug pulumi/docs
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 94/100