Netflix / flamescope

FlameScope is a visualization tool for exploring different time ranges as Flame Graphs.
Apache License 2.0
3k stars 168 forks source link

OverflowError: cannot convert float infinity to integer #9

Closed grooverdan closed 6 years ago

grooverdan commented 6 years ago

Ended up being caused by an empty file: -rw-rw-r-- 1 dan dan 0 Apr 4 20:30 stacks.mysql-64-oltp_read_only_1.2018-04-04 20:30:08-05:00

Traceback (most recent call last):
  File "/home/dan/pyenv/lib/python2.7/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/dan/pyenv/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/home/dan/pyenv/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/dan/pyenv/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/dan/pyenv/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/dan/pyenv/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/dan/pyenv/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/dan/pyenv/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/dan/flamescope/app/views/heatmap.py", line 34, in get_heatmap
    return jsonify(generate_heatmap(filename, rows))
  File "/home/dan/flamescope/app/util/heatmap.py", line 120, in generate_heatmap
    cols = int(ceil(end) - floor(start))
OverflowError: cannot convert float infinity to integer
            
grooverdan commented 6 years ago

Header only (perf script --debug-mode) files cause the same backtrace:

-rw-rw-r-- 1 dan  dan      1384 Apr  4 21:01 stacks.mysql-prep.2018-04-04 21:01:35-05:00
-rw-rw-r-- 1 dan  dan      1384 Apr  4 21:01 stacks.mysql-prep.2018-04-04 21:01:58-05:00
brendangregg commented 6 years ago

Yes, the UI should say "empty file" or something, instead of crashing. Needs to be fixed.

smarter commented 6 years ago

I've got the same issue on all perf files generated from jvm applications. Here's an example: perf-54606.data.gz

spiermar commented 6 years ago

@brendangregg can you check this example file? I'll also add a another issue to track general file error handling.

rogerwelin commented 6 years ago

Im getting the same error, perf file was generated using https://github.com/jvm-profiling-tools/async-profiler and the cmd I used was: ./profiler.sh -d 30 -o collapsed -f /tmp/traces.txt 30497

the file is not empty (~10mb)

ceeaspb commented 6 years ago

@rogerwelin async-profiler with -o collapsed aggregates all the samples into counts per stack trace. flamescope needs each individual sample with a timestamp so it can generate the heatmap over time and flamegraph for a certain time range. I have opened a new feature request in async-profiler for this.

ceeaspb commented 6 years ago

@smarter did you produce perf script output file from the raw perf.data file? If not you'll need to.

spiermar commented 6 years ago

@grooverdan File handling improvements will be tracked on https://github.com/Netflix/flamescope/issues/18

@rogerwelin @smarter these seem to be invalid files. Let me know if otherwise and I'll reopen the issue.

@ceeaspb Thanks for the help on this!

Liron24 commented 5 years ago

@ceeaspb can you please elaborate on :

@smarter did you produce perf script output file from the raw perf.data file? If not you'll need to.

I have the same issue.