Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

DateTime::subtract fails when nanosecond result crosses midnight

Geschlossen
#1,720 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Ein zugehöriger Pull Request wurde bereits gemerged.

  • #1724 von @fglock — gemerged

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
java
Bereich
backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Perl
Sterne
64
Forks
8
Ø Merge
5 Std. 43 Min.
Gemergte PRs (30 T.)
204

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus fglock/PerlOnJava

Alle Issues in fglock/PerlOnJava

Ähnliche Issues

Weitere Issues zu Perl

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.