WebKitGTK: six natives are declared to return `long`, but the WebKitGTK functions they call return `void`
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #3774 của @GreenFuze — đã merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
Hướng nghiên cứu
Đọc sáu khai báo trong WebKitGTK.java tại các dòng được liệt kê và so sánh chúng với các stub được tạo trong webkitgtk.c cùng các header WebKitGTK được nêu trong issue. Đổi các khai báo thành void và tạo lại các stub. Công việc hoàn tất khi cả sáu lệnh gọi được tạo khớp với kiểu trả về void của các hàm.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Six natives in WebKitGTK.java are declared to return long, but the WebKitGTK functions they call return void. The generated stubs call each one through a function pointer typed to return jlong, so the C compiler stays quiet.
// bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/org/eclipse/swt/internal/webkit/WebKitGTK.java:275, :381, :627, :653, :656, :659
public static final native long webkit_web_context_allow_tls_certificate_for_host(long webKitWebContext, long GTlsCertificate, byte[] constGCharHost);
public static final native long webkit_network_session_allow_tls_certificate_for_host(long session, long certificate, byte[] constGCharHost);
public static final native long webkit_user_content_manager_add_script(long manager, long script);
public static final native long webkit_find_controller_search_next(long findController);
public static final native long webkit_find_controller_search_previous(long findController);
public static final native long webkit_find_controller_search_finish(long findController);
// bundles/org.eclipse.swt/Eclipse SWT WebKit/gtk/library/webkitgtk.c:1266
rc = (jlong)((jlong (CALLING_CONVENTION*)(jlong))fp)(arg0);
// webkit/WebKitFindController.h:84-85 (WebKitGTK 4.1, 2.52.5); the other five are void as well in
// WebKitFindController.h, WebKitUserContentManager.h, WebKitWebContext.h and, in 6.0, WebKitNetworkSession.h
WEBKIT_API void
webkit_find_controller_search_finish (WebKitFindController *find_controller);
What it can cause
The value each native returns is whatever is left in the return register. Every caller in WebKit.java discards it (:307, :2600-2605, :2873, :2941, :2954; search_next and search_previous go through a Consumer<Long> at :2930-2931), so nothing goes wrong today. This is a mismatch in the declarations, not an observed failure. It is worth closing because a future caller would read a meaningless value as a result.
Fix
Declare the six as void in WebKitGTK.java and regenerate the stubs; the file already has many native void webkit_* declarations. I am happy to open the PR.
How this was found
By a research tool that compares each call a generated stub makes against the C declaration of the function it calls. Nothing was built or executed; every file quoted is in this repository at R4_40, and unchanged on master.
- Ngôn ngữ chính
- Java
- Star
- 202
- Fork
- 206
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 115
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc 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 eclipse-platform/eclipse.platform.swt
-
[Win32] Table tooltip indexes cell font with subitem -1Có thể đã có người làm @fdesbiens đã nhận 13 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
eclipse-platform/eclipse.platform.swt#3752 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
eclipse-platform/eclipse.platform.swt#3546 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
eclipse-platform/eclipse.platform.swt#3428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 75/100
eclipse-platform/eclipse.platform.swt#3336 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HiDPI Windows
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 54/100
eclipse-platform/eclipse.platform.swt#3777 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của eclipse-platform/eclipse.platform.swt
Issue tương tự
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Shweit/EtherealPortals#30 ·
-
Typo in jakartaee-bom 12.0.0-SNAPSHOT with cdiCó thể đã có người làm @ElectLive đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
jakartaee/jakartaee-api#205 · 1 bình luận ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
liberation-data/drivine4j#547 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
BindingServiceProperties.bindings regressed to a non-thread-safe TreeMap in GH-3158: concurrent first use of binding names corrupts itCó thể đã có người làm @AkashB23 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
spring-cloud/spring-cloud-stream#3321 ·
Maintainer thường phản hồi trong vòng 1 ngày