String eval does not inherit strict vars on either backend
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 EvalStringHandler.java around lines 317-322 and 500-510, then inspect RuntimeCode.evalStringWithInterpreter and the shared eval-context capture. Run the minimal strict-vars reproducer and the Exporter::Easy 0.18 suite on both backends. Done means strict vars is inherited, no strict vars still disables it, declared variables remain usable, and permanent regression coverage passes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
PerlOnJava does not inherit use strict's vars setting into string eval compilation. As a result, undeclared package variables inside an eval string execute successfully instead of producing Perl's compile-time strict-vars error.
This causes Exporter::Easy 0.18's negative tests to fail on both PerlOnJava backends.
CPAN failure
Archived CPAN run: 20260918-141920-96054
Distribution: Exporter-Easy-0.18
Target: Exporter::Easy
Results:
t/Easiest.t .. ok
t/Easy.t ..... 4 failed of 51
Files=2, Tests=72
The four failures are:
list vars can't use var @goodbye
list vars can't use var %goodbye
no vars can't use var @goodbye
no vars can't use var %goodbye
The test helper evaluates each expression with:
eval "package $pkg;$code"
Under system Perl, the undeclared @goodbye and %goodbye references correctly die under the surrounding use strict. Under PerlOnJava they execute successfully, so the negative assertions fail.
Minimal reproducer
use strict;
my $result = eval q{@goodbye};
die "strict vars was not enforced" unless $@;
Expected result: the eval fails with a diagnostic equivalent to:
Global symbol "@goodbye" requires explicit package name
Observed on both JVM and interpreter backends: the eval succeeds and returns an empty array value.
The CPAN test's package-qualified form also reproduces the issue:
use strict;
my $package = __PACKAGE__;
my $ok = eval "package $package;\\@goodbye";
Oracle comparison
The unchanged upstream suite passes completely under system Perl 5.42.2:
t/Easiest.t .. ok
t/Easy.t ..... ok
All tests successful.
Files=2, Tests=72
There are no XS/native components or external services involved.
Investigation and suspected ownership
The failure is in string-eval lexical-state propagation, not in Exporter::Easy's export logic.
The JVM eval path is implemented by EvalStringHandler. It creates a fresh ScopedSymbolTable and is intended to inherit strict options from the caller around EvalStringHandler.java lines 317-322 and 500-510. The eval parser then performs strict-vars validation against that new table.
The interpreter eval path is implemented by RuntimeCode.evalStringWithInterpreter; it obtains the saved eval context and parses the string separately. It exhibits the same missing strict-vars behavior, so the shared eval-context capture/propagation or eval compilation setup should be examined rather than only one backend's emitter.
The key semantic requirement is that eval STRING inherits the caller's lexical hints, including strict 'vars', while still allowing explicit no strict 'vars' to disable the check.
Related issue search
Issue #1302, “JVM backend rejects valid @$ glob dereference under strict vars,” is related to strict-vars handling but is not a duplicate. It covers a false positive for glob-dereference syntax; this issue covers missing strict-vars inheritance inside string eval and affects both backends.
Acceptance criteria
- The minimal reproducer fails inside
eval STRINGunderuse stricton both JVM and interpreter backends. no strict 'vars'continues to allow the same eval expression.- Lexically declared variables and explicitly declared package variables remain usable inside eval strings.
Exporter::Easy0.18's full 72-test suite passes on both backends.- Add permanent project-owned regression coverage for strict-vars inheritance in string eval.
- Ngôn ngữ chính
- Perl
- Star
- 64
- Fork
- 7
- Merge trung bình
- 5 giờ 25 phút
- Pull request đã merge (30 ngày)
- 178
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:runtime bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
fglock/PerlOnJava#1700 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
fglock/PerlOnJava#1696 ·
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ó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug help wanted
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 70/100
bioepic-data/bervo#145 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
inverse-inc/packetfence#9413 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Ubuntu .deb packages ship all files owned by uid/gid 1001 (CI user runner) instead of root:rootĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Help-Wanted Needs-Triage Package-Update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/winget-pkgs#448814 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày