Sub::Quote deferred subs lose identity across threads
Maintainer thường phản hồi trong vòng 1 ngày
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
- 52/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- perl
- Lĩnh vực
- backend, testing-qa
Hướng nghiên cứu
Bắt đầu với t/sub-quote-threads.t và tái hiện nó bằng cả hai lệnh được hiển thị cho các backend JVM và trình thông dịch. Đọc Sub/Defer.pm quanh dòng 75 và phần triển khai CLONE của nó, sau đó theo dõi các tham chiếu deferred-sub và %DEFERRED trong suốt quá trình tạo thread. Hoàn thành khi các sub quoted và deferred giữ nguyên danh tính của chúng và bài kiểm thử hồi quy tập trung chạy đạt trên cả hai backend.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Sub::Quote 2.006009 fails when quoted/deferred subs are retrieved or invoked from PerlOnJava threads. The failure reproduces on both the JVM and interpreter backends.
Reproduction
The CPAN random tester record is:
2026-09-18 07:06:07 FAIL Sub::Quote Sub::Defer ... 5430 5435 5/5435 subtests failed; 1/15 test programs failed
The failing test is:
t/sub-quote-threads.t
Using the built distribution with its library and test-library paths:
timeout 120 ./jperl -I<build>/blib/lib -I<build>/t/lib <build>/t/sub-quote-threads.t
timeout 120 ./jperl --interpreter -I<build>/blib/lib -I<build>/t/lib <build>/t/sub-quote-threads.t
Both backends fail identically: 5 of 6 assertions fail. The only passing assertion is the unquoted One case. Quoted/deferred sub retrieval and execution return undef, including the two-thread cases.
The complete CPAN run has 14 of 15 test programs passing; only t/sub-quote-threads.t fails. PerlOnJava also emits:
Use of uninitialized value in hash element at .../Sub/Defer.pm line 75
Expected behavior
System Perl passes the complete oracle run: 7036/7036 tests, including t/sub-quote-threads.t.
Technical analysis
Sub::Defer::undefer_sub looks up deferred-sub metadata in %DEFERRED using the deferred sub reference. Sub::Defer provides a CLONE implementation specifically to repair stringified subreference keys after threading.
On PerlOnJava, the lookup at Sub/Defer.pm line 75 receives an undefined or otherwise non-matching key after the thread boundary. This indicates that thread cloning is not preserving or remapping the identity/metadata of deferred quoted subs as required by Sub::Defer::CLONE.
The issue is present in both execution backends, so it appears to be shared runtime/thread-cloning behavior rather than a JVM-backend-only problem or a module-specific compilation issue.
Impact
Non-threaded Sub::Quote functionality passes, but applications using quoted/deferred subs from Perl threads can silently receive undef or fail to invoke the intended subroutine. This is a compatibility bug affecting modules that use Sub::Quote together with threads.
Suggested investigation
- Trace cloning of the deferred sub reference and the
%DEFERREDmetadata across thread creation. - Compare PerlOnJava's handling of
CLONEand stringified subreference keys with system Perl. - Add a focused project-owned regression test covering
quote_sub,quoted_from_sub,unquote_sub, and deferred-sub invocation from a child thread on both backends.
- Ngôn ngữ chính
- Perl
- Star
- 64
- Fork
- 7
- Merge trung bình
- 5 giờ 8 phút
- Pull request đã merge (30 ngày)
- 193
Chuẩn bị môi trường
- Có Dockerfile hoặc 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 fglock/PerlOnJava
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
fglock/PerlOnJava#1651 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#1579 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port area:unicode bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
fglock/PerlOnJava#1341 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Interpreter fails Type::Library extends during BEGINCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea:runtime bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
fglock/PerlOnJava#1744 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
HTTP::Cookies extraction drops Expires and SameSite attributesCó thể đã có người làm @fglock đã nhận hôm nay. Đang mởarea:cpan-port bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
fglock/PerlOnJava#1743 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fglock/PerlOnJava
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Perl/perl5#24942 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
PDLPorters/pdl#561 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
objectionary/eolang.sty#197 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
chore: remove unused .gemini configuration directoryCó thể đã có người làm @JayadityaGit đã nhận 1 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
openfoodfacts/openfoodfacts-server#14878 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
radiator-software/p5-net-ssleay#577 ·
Maintainer thường phản hồi trong vòng 1 ngày