Skip to content

Fails with "IndexError: list index out of range" when running with -h (heatmap) #110

@ldorigo

Description

@ldorigo
Description

I'm not really sure where it's coming from, but I'm getting the following error when I run the profiler in heatmap mode (with the -h flag).

How to reproduce

Haven't been able to find out exactly what causes it yet. I just ran my script as vprof -c h "/path/to/script.py --some_param" < input_file.txt

Actual results

Fails with

Traceback (most recent call last):
  File "/home/ldorigo/.local/bin/vprof", line 8, in <module>
    sys.exit(main())
  File "/home/ldorigo/.local/lib/python3.9/site-packages/vprof/__main__.py", line 83, in main
    program_stats = runner.run_profilers(source, config, verbose=True)
  File "/home/ldorigo/.local/lib/python3.9/site-packages/vprof/runner.py", line 73, in run_profilers
    run_stats[option] = curr_profiler.run()
  File "/home/ldorigo/.local/lib/python3.9/site-packages/vprof/base_profiler.py", line 172, in run
    return self.profile()
  File "/home/ldorigo/.local/lib/python3.9/site-packages/vprof/code_heatmap.py", line 217, in profile_module
    return base_profiler.run_in_separate_process(self._profile_module)
  File "/home/ldorigo/.local/lib/python3.9/site-packages/vprof/base_profiler.py", line 79, in run_in_separate_process
    raise exc
IndexError: list index out of range   
Expected results

Makes a line heatmap :)

Version and platform

Python 3.9.1 on linux, vprof 0.38

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions