Reading a deleted namespace scalar recreates its stash entry

Đang mở
#1,980 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
57/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, perl
Lĩnh vực
backend

Hướng nghiên cứu

Start with RuntimeStash.deleteNamespace and the stash enumeration path in HashSpecialVariable, then inspect t/basic.t and the standalone reproduction described in the issue. Trace how a qualified undefined scalar is handled after its namespace is deleted. Done means the child namespace remains absent after the scalar read, matching Perl's behavior on both PerlOnJava backends.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:runtime bug

Summary

Deleting a package namespace from its parent stash does not keep that namespace deleted after a qualified scalar is read. This makes Text::Template 1.61's _scrubpkg cleanup assertion fail in t/basic.t on both PerlOnJava backends. System Perl passes the assertion, and the complete upstream suite passes there (22 files, 184 tests). The failure is included in archived CPAN run 20261104-151051-20617.

Root cause

RuntimeStash.deleteNamespace removes the namespace's current slots and marks the package freed. But stash enumeration in HashSpecialVariable reconstructs child-package entries from any qualified global slot it finds. A later read such as $Cleanup::GEN0::test creates an undefined scalar slot; enumeration then infers GEN0:: as a live child stash from that slot and exposes it again. The enumeration path does not honor the freed-stash marker, so this implicit scalar autovivification makes exists $Cleanup::{"GEN0::"} true again. The standalone script in the comment reproduces the behavior without a CPAN dependency.

Expected behavior

Reading an undefined scalar below a namespace deleted from its parent stash must not recreate that child namespace entry. Perl leaves the child absent in the same sequence.

Ngôn ngữ chính
Perl
Star
65
Fork
8
Merge trung bình
5 giờ 45 phút
Pull request đã merge (30 ngày)
184

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fglock/PerlOnJava

Tất cả issue của fglock/PerlOnJava

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.