Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

DateTime::subtract fails when nanosecond result crosses midnight

Đang mở
#1,720 0 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

@fglock đang làm issue này rồi.

Từ ngày 9/10/2026.

  • #1724 của @fglock — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java
Lĩnh vực
backend

Hướng nghiên cứu

The failure is in DateTime 1.67's t/10subtract.t at line 156, where subtracting one nanosecond from midnight passes nanosecond => -1 into DateTime validation. Start by running that focused test on the PerlOnJava JVM and interpreter backends and compare with system Perl. Done means the test passes on both backends. Linked PR #1724 is already open against this issue, so check it before starting.

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

Mô tả

area:runtime bug high-impact

Summary

DateTime::subtract fails when a subtraction crosses midnight by one nanosecond. It passes nanosecond => -1 into DateTime's validation instead of normalizing the result to the previous second/day.

Reproduction

DateTime 1.67's t/10subtract.t reaches the failing case at line 156, subtracting one nanosecond from midnight. PerlOnJava aborts after the preceding 37 assertions with an invalid nanosecond error.

The focused test passes with system Perl 5.45.4 (perl5/perl) and DateTime's full 1.67 suite passes on that oracle. The focused test fails on both PerlOnJava execution backends: JVM and interpreter.

This was observed during CPAN release acceptance run 20261009-194921-60036.

Impact

The failure is in DateTime's pure-Perl subtraction path. DateTime currently has about 950 unique runtime reverse dependants (558 with recent CPAN releases), including Monitoring-Sneck, Travel-Status-MOTIS, BarefootJS, App-ElasticSearch-Utilities, Test2-Harness-UI, and Dist-Zilla.

Other DateTime failures in this acceptance run involve goto from a sort comparator and are tracked separately in #1634; this issue is only for nanosecond normalization.

Ngôn ngữ chính
Perl
Star
64
Fork
7
Merge trung bình
5 giờ 11 phút
Pull request đã merge (30 ngày)
186

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.