FS#76773 - [chromium] fails to parse date strings, causes infinite loop

Attached to Project: Arch Linux
Opened by Leon Sorokin (leeoniya) - Wednesday, 07 December 2022, 23:05 GMT
Last edited by Evangelos Foutras (foutrelis) - Thursday, 08 December 2022, 01:24 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Felix Yan (felixonmars)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

Chromium fails to parse date strings produced by Date.toLocaleString()...but Chrome and Firefox work as expected.

This appears to be isolated to Arch/Chromium or EndeavourOS/Chromium. I've tested this on Chromium in Windows 10 as well as Chromium on PoP_OS (a Ubuntu derivative), and everything works consistently between Chromium and Chrome on those platforms.

Additional info:

OS: EndeavourOS (fully updated 2022-12-06)
DE: KDE/Plasma
Package: extra/chromium 108.0.5359.94-2

Steps to reproduce:

you can visit this URL in Chromium and watch the tab crash. opening the same link in Chrome or Firefox works as expected:

https://leeoniya.github.io/uPlot/demos/timezones-dst.html

Additional context: https://github.com/grafana/grafana/issues/58728#issuecomment-1333135075

the problem has been isolated to a difference in Date parsing behavior. paste the following into Chromium, Chrome, and Firefox DevTools console:

let date = new Date(1667594981087);
let date2 = new Date(date.toLocaleString('en-US', {timeZone: 'America/New_York'}));

console.log(date);
console.log(date2); // Invalid Date ??
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Thursday, 08 December 2022, 01:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  chromium 108.0.5359.98-2
Comment by Toolybird (Toolybird) - Thursday, 08 December 2022, 00:16 GMT
I wonder if  FS#76655  is related... Edit: yep, see below.
Comment by Leon Sorokin (leeoniya) - Thursday, 08 December 2022, 00:34 GMT
yes, it's the same bug. it goes into an infinite loop here:

for (var dt = new Date("3/01/" + yr + " 00:00:00"), found = 0; found < 2; )
Comment by Leon Sorokin (leeoniya) - Thursday, 08 December 2022, 00:57 GMT
it probably makes sense to remove " produced by Date.toLocaleString()" from the title, as the issue appears to be more general and higher severity, imo.
Comment by Evangelos Foutras (foutrelis) - Thursday, 08 December 2022, 01:23 GMT
Seems fixed with https://chromium-review.googlesource.com/c/v8/v8/+/4027341.

Thanks for the detailed report (and good catch Toolybird about  FS#76655 ).

Loading...