Closed Bug 1364442 Opened 3 years ago Closed 3 years ago
Profiler JSON is broken depending on the OS locale because float values (used for minor GC timing) can use the wrong decimal separator
Excerpt of broken JSON: > "Total":2058,353000, > "CancelIonCompilations":0,000000, > "TraceValues":0,000000,
My OS is french (my Firefox isn't though :) ). In french we use commas as decimal separators, so could this be a locale problem ?
Launching Firefox with LC_ALL=C makes it work.
Ditto bug 1364347 - LC_ALL=C fixes the problem there.
I think this is a regression from the patch "Record minor GC timings in profiles" from bug 1322560. This code uses the float overload of JSONPrinter::property instead of the TimeDuration one: http://searchfox.org/mozilla-central/rev/cd8c561106d804e26bc09389f18f361846d005eb/js/src/gc/Nursery.cpp#511-512 http://searchfox.org/mozilla-central/rev/cd8c561106d804e26bc09389f18f361846d005eb/js/src/vm/JSONPrinter.cpp#175 And the float printer uses vnsprintf with %f to convert floats to strings: http://searchfox.org/mozilla-central/rev/cd8c561106d804e26bc09389f18f361846d005eb/js/src/vm/Printer.cpp#84 http://searchfox.org/mozilla-central/rev/cd8c561106d804e26bc09389f18f361846d005eb/mozglue/misc/Printf.cpp#280 In comparison, JSONWriter uses double_conversion::DoubleToStringConverter::EcmaScriptConverter(): http://searchfox.org/mozilla-central/rev/cd8c561106d804e26bc09389f18f361846d005eb/mfbt/JSONWriter.h#399-409
Summary: Profiler JSON is broken depending on the OS locale because TimeDuration values can use the wrong decimal separator → Profiler JSON is broken depending on the OS locale because float values (used for minor GC timing) can use the wrong decimal separator
Argh, sorry. The stuff I use for the major GCs handles this explicitly already, and I should have known better when I saw the %f. I will fix.
Attachment #8867262 - Flags: review?(jcoppeard)
Assignee: nobody → sphink
Status: NEW → ASSIGNED
Attachment #8867262 - Flags: review?(jcoppeard) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/mozilla-inbound/rev/ef32458f11b8 Remove more locale-sensitive JSON output paths, r=jonco
You need to log in before you can comment on or make changes to this bug.