mstange / samply

Command-line sampling profiler for macOS and Linux
Apache License 2.0
1.98k stars 48 forks source link

Mac: RangeError: minimumFractionDigits value is out of range #188

Open hhwyt opened 2 months ago

hhwyt commented 2 months ago

Hello, everyone! I'm attempting to profile my program using samply record, but i've encountered an error stating, RangeError: minimumFractionDigits value is out of range. Does anyone know how to resolve this issue or suggest a possible workaround?

Error stack from chrome console:

react-dom.production.min.js:189 RangeError: minimumFractionDigits value is out of range.
    at new NumberFormat (<anonymous>)
    at format-numbers.js:30:10
    at index.js:29:25
    at Wt (format-numbers.js:80:24)
    at qt (format-numbers.js:218:10)
    at tn (format-numbers.js:402:10)
    at sn (committed-ranges.js:171:10)
    at HS.render (Selection.js:442:17)
    at Is (react-dom.production.min.js:204:189)
    at Bs (react-dom.production.min.js:203:149)
An unhandled error was thrown in a React component. RangeError: minimumFractionDigits value is out of range.
    at new NumberFormat (<anonymous>)
    at format-numbers.js:30:10
    at index.js:29:25
    at Wt (format-numbers.js:80:24)
    at qt (format-numbers.js:218:10)
    at tn (format-numbers.js:402:10)
    at sn (committed-ranges.js:171:10)
    at HS.render (Selection.js:442:17)
    at Is (react-dom.production.min.js:204:189)
    at Bs (react-dom.production.min.js:203:149) 
    at HS (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:137:83775)
    at c (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:23866)
    at aT (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:137:106796)
    at <anonymous> (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:117:15436)
    at c (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:23866)
    at wT (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:137:116294)
    at c (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:23866)
    at div
    at s (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:192:565429)
    at div
    at t (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:192:567076)
    at div
    at div
    at yk (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:133:27240)
    at MT (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:137:119676)
    at c (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:23866)
    at EB (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:137:150118)
    at c (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:23866)
    at mm (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:104:7034)
    at c (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:23866)
    at div
    at OT (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:137:121755)
    at c (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:23866)
    at Nf (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:111:15336)
    at Ff
    at de (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:16836)
    at ce (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:16794)
    at QB (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:137:169850)
    at c (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:23866)
    at at (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:2:22138)
    at Nf (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:111:15336)
    at Mf
    at rI (https://profiler.firefox.com/main.34c9f340aad26f45bf86.bundle.js:137:170942)

Machine: Mac, Apple Silicon, M3 Max OS: Sonoma 14.1 (23B2073) Chrome: Version 124.0.6367.119 (Official Build) (arm64)

Thanks for any help.

mstange commented 2 months ago

I have not seen this error before, but it probably indicates that the profile JSON contains some bad data. Can you reproduce this? Can you attach the corresponding profile.json file here?

hhwyt commented 2 months ago

Thanks for your response.

I encountered this error each time I run samply record. And this is my profile.json. profile.json.tar.gz

mstange commented 2 months ago

Is it an empty file? The tar.gz file shows me an error when I unpack it.

hhwyt commented 1 month ago

Sorry, my fault. Here is the correct version.

profile.json.tar.gz

mstange commented 1 month ago

Ah, yes, all the sample tables are empty. You can search for samples":{"length": in the JSON.

So for some reason samply wasn't able to capture any samples.

Is it possible that the app you're running is an x86_64 app that runs via Rosetta? samply cannot profile Intel binaries. I filed #201 about showing a useful error in that case.

tobyhede commented 1 month ago

I have the same issue attempting to profile a rust application on OSX. Samply runs with no error and opens the browser at localhost. The viewer then errors with RangeError: minimumFractionDigits value is out of range because no data was actually generated.

tobyhede commented 1 month ago

Confirmed in my case that it is a native apple silicon binary.

mstange commented 4 weeks ago

Interesting! How long does the profiled process run for? Maybe it shuts down before the first sample is gathered?

tobyhede commented 4 weeks ago

@mstange Ah ... that is an interesting point, will test.