Method lookup still finds a subroutine after Symbol::Util delete_sub
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
- 68/100
Hướng nghiên cứu
Start with the upstream t/50delete_sub.t test, especially test 23, and reproduce it under standard Perl to confirm the expected result. Trace the method lookup and symbol-table deletion paths, then add a project-owned regression covering delete_sub on both JVM and interpreter backends. Done means the focused regression and unchanged Symbol-Util 0.0203 test pass on both backends.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
After Symbol::Util::delete_sub removes a subroutine from the main package, PerlOnJava can still dispatch that subroutine as a class method. This breaks Perl's method lookup semantics: deleting main::FOO should make main->FOO unavailable, while unrelated calls through the remaining symbol table continue to work.
This is a pure-Perl compatibility failure, reproducible on both PerlOnJava execution backends. The unchanged upstream test passes under system Perl.
Reproduction
The failure is from Symbol-Util 0.0203, t/50delete_sub.t, test 23 (main->FOO is ok [2]). The relevant upstream sequence is:
use Symbol::Util 'delete_sub';
*FOO = sub { "code" };
# The method is initially available.
my $before = eval { main->FOO };
# Remove the CODE slot for main::FOO.
delete_sub("::FOO");
# Expected: method lookup fails, so the eval result is undefined.
my $after = eval { main->FOO };
Expected behavior under Perl: defined $after is false. On PerlOnJava, the upstream assertion ok(! defined eval { main->FOO }, 'main->FOO is ok [2]') fails, indicating that method dispatch still finds a defined result after deletion.
Evidence
- CPAN random tester run:
20261002-095841-54171 - Distribution:
Symbol-Util0.0203 (pure Perl) - Failing test:
t/50delete_sub.t, assertion 23 of 24 - Full PerlOnJava suite result: 306/307 assertions passed; 1/8 test programs failed
- System Perl: all 307 assertions across 8 test programs passed in the archived oracle run; the focused
t/50delete_sub.talso passes independently - PerlOnJava JVM backend: focused test fails at assertion 23
- PerlOnJava interpreter backend: same focused assertion fails
- Regression record: last known pass date 2026-09-12 at commit
141cdae65 - Reproduced in current checkout at commit
0d3f46e4524573d58dd4ae91565f6de2d8b79435 - Environment: macOS 26.6.2, Temurin OpenJDK 24.0.2, system Perl 5.42.2
The archived failing log also prints closedir() attempted on handle $GEN4 ... during CPAN configuration, but the target completed its tests and reported one ordinary assertion failure. The system-Perl oracle passed, and the focused failure reproduces directly on both backends, so that warning does not explain this result.
Expected behavior
Once delete_sub("::FOO") removes main::FOO's CODE slot, a subsequent main->FOO lookup must fail on both execution backends. The method lookup path must reflect the current package symbol table after this mutation.
Related issues
- #1119 covers earlier
Symbol::Utilpackage-stash and typeglob-slot failures. Its report says subroutine deletion passed; this CPAN run records a later regression in that behavior. - #1523 covers method loss after a package stash is copied back. It is related to method dispatch after symbol-table mutation, but this report concerns stale successful lookup after
delete_subremoves a method.
Suggested acceptance criteria
- Add a focused project-owned regression test for method lookup after
delete_subremoves a named CODE slot. - Validate the test with standard Perl before using it as a PerlOnJava regression test.
- Confirm the test passes on both JVM and interpreter backends.
- Confirm the unchanged
Symbol-Util0.0203t/50delete_sub.ttest passes.
- Ngôn ngữ chính
- Perl
- Star
- 64
- Fork
- 7
- Merge trung bình
- 5 giờ 13 phút
- Pull request đã merge (30 ngày)
- 181
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
-
area:cpan-port area:parser bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
fglock/PerlOnJava#1685 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port area:runtime bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
fglock/PerlOnJava#1684 ·
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ự
-
FOODTURE
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
openfoodfacts/openfoodfacts-server#14853 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Needs Triage
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 66/100
Perl/perl5#24913 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Perl/Fish oddness in new versionĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
gugod/App-perlbrew#879 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
RotherOSS/otobo#6205 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày