Uncaught exception "invalid language tag" in MozDateTimeFormat constructor
Categories
(MailNews Core :: XUL Replacements, defect)
Tracking
(thunderbird_esr6065+ fixed, thunderbird66 fixed)
People
(Reporter: ardovm, Assigned: jorgk-bmo)
References
Details
Attachments
(3 files, 1 obsolete file)
1.46 KB,
patch
|
jorgk-bmo
:
review+
|
Details | Diff | Splinter Review |
1.88 KB,
patch
|
jorgk-bmo
:
approval-comm-esr60+
|
Details | Diff | Splinter Review |
2.59 KB,
patch
|
jorgk-bmo
:
review+
jorgk-bmo
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:64.0) Gecko/20100101 Firefox/64.0
Steps to reproduce:
Try to edit an address book entry
Actual results:
The debugger shows an uncaught exception in mozIntl.js:78
The constructor of MozDateTimeFormat calls getLocales(locales) and this raises a:
RangeError: invalid language tag: en-US-u-va-posix-u-ca-gregory-nu-latn
The exception is not caught, and therefore the initialization of the DatePicker is interrupted abruptly.
The effect is that, among others, the "yearField", "monthField" fields of the datePicker etc. are not created.
When trying to close the address book entry by clicking on "Ok", the window does not close, because it wants to access the aforementioned fields of the datePicker. An exception is raised and the window does not close.
Expected results:
IMHO exceptions should either be caught or either fail noisily.
Reporter | ||
Comment 1•5 years ago
|
||
Here is some debug information.
Application Basics
Name: Thunderbird
Version: 60.4.0
Build ID: 20190115112610
User Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.1.24) Gecko/20100805 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666
OS: FreeBSD 11.2-STABLE
[...]
Extensions
Name
Version
Enabled
ID
Lightning
6.2.4
true
{e2fda1a4-762b-4020-b5ad-a41df1933103}
Provider for Google Calendar
4.4.2
true
{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}
Remove Duplicate Messages (Alternate)
0.3.17b1
true
{a300a000-5e21-4ee0-a115-9ec8f4eaa92b}
[...]
Internationalization & Localization
Application Settings
Requested Locales: ["und","en-US"]
Available Locales: ["en-US"]
App Locales: ["en-US","und"]
Regional Preferences: ["en-US-u-va-posix"]
Default Locale: "und"
Operating System
System Locales: ["en-US-u-va-posix"]
Regional Preferences: ["en-US-u-va-posix"]
Output of the `locale' command:
$ locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
Please let me know if you need any more information.
Assignee | ||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
The code is here: https://searchfox.org/comm-central/source/common/bindings/datetimepicker.xml#493-494
It's a dirtyhack, and as such, it fails when poked long enough. :)
Since we're still waiting for bug 1433303, you can either set a dependency on it, or you'll need to write some simple parser/serializer for unicode extension keys to be able to extract them from locale, add yours, and rebuild the language tag with the new set.
The correct language tag should be en-US-u-va-posix-ca-gregory-nu-latn
A sliiightly safer dirty hack you could deploy is just test if -u-
is already there and then just concatenate the ca-gregory-nu-latn
instead.
Assignee | ||
Comment 3•5 years ago
|
||
Ouch, our code, sorry, thanks for the pointers. We love problems in forked code (not) :-(
Assignee | ||
Comment 4•5 years ago
|
||
Would you do me the honour :-)
Comment 5•5 years ago
|
||
Comment on attachment 9039207 [details] [diff] [review] 1521454-locale-hack.patch Review of attachment 9039207 [details] [diff] [review]: ----------------------------------------------------------------- Yea, I would add a comment stating that it awaits for Intl.Locale and that the current solution is hacky because a locale code may have other extension keys (for example "en-US-u-hc-h12-t-foo-x-bar") and then it'll fail :)
Assignee | ||
Comment 6•5 years ago
|
||
Thanks, Zibi, I'll add a comment in the landed version.
Assignee | ||
Comment 7•5 years ago
|
||
Oops, missing closing parenthesis. Added now and also the comment.
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/0396f1f1c7a7
Avoid exception due to bad locale code when appending [-u]-ca-gregory-nu-latn. r=zibi
Assignee | ||
Updated•5 years ago
|
Reporter | ||
Comment 9•5 years ago
|
||
First of all, thank you for taking care of this bug!
I was preparing a patch for my system, so I do not have to wait until version 66.
I found out that in the same file, the concatenation of "-u-something" is repeated in more than one place.
I am submitting a tentative patch that addresses them all, for your kind review. It should apply to 60.5.0
Reporter | ||
Comment 10•5 years ago
|
||
Address the same problem in other points of the same file.
This patch should apply to sources version 60.5.0
Assignee | ||
Comment 11•5 years ago
|
||
Comment on attachment 9041114 [details] [diff] [review] patch-bug1521454 Damn, we missed some? I'll get the other places fixed. I'll look at it later today.
Assignee | ||
Comment 12•5 years ago
|
||
Comment on attachment 9041114 [details] [diff] [review] patch-bug1521454 OK, this is the combined TB 60 ESR patch.
Assignee | ||
Comment 13•5 years ago
|
||
Comment 14•5 years ago
|
||
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/b3d0202faaa3 Follow-up: Avoid exception due to bad locale code when appending [-u]-ca-gregory-nu-latn (more call sites). r=jorgk
Assignee | ||
Comment 15•5 years ago
|
||
Comment on attachment 9041266 [details] [diff] [review] patch-bug1521454 - trunk patch, follow-up Second part needs uplift.
Assignee | ||
Comment 16•5 years ago
|
||
TB 66 beta:
https://hg.mozilla.org/releases/comm-beta/rev/175d46dcc1ce (second part)
Assignee | ||
Comment 17•5 years ago
|
||
Description
•