pythonspeed / profila

A profiler for Numba
Apache License 2.0
68 stars 2 forks source link

Profila occasionally fails with message that is None #9

Open itamarst opened 5 months ago

itamarst commented 5 months ago
  File "/home/itamarst/devel/low-level-performance-book/venv/lib/python3.11/site-packages/profila/__main__.py", line 54, in get_stats
    async for sample in read_samples(process):
  File "/home/itamarst/devel/low-level-performance-book/venv/lib/python3.11/site-packages/profila/_gdb.py", line 100, in read_samples
    async for sample in _sample(process):
  File "/home/itamarst/devel/low-level-performance-book/venv/lib/python3.11/site-packages/profila/_gdb.py", line 53, in _sample
    if "stack" not in message["payload"]:  # type: ignore
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
Doggie52 commented 5 months ago

Failed like this for me as well:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/douglas/micromamba/envs/py311/lib/python3.11/site-packages/profila/__main__.py", line 126, in <module>
    main()
  File "/home/douglas/micromamba/envs/py311/lib/python3.11/site-packages/profila/__main__.py", line 118, in main
    annotate_command(args)
  File "/home/douglas/micromamba/envs/py311/lib/python3.11/site-packages/profila/__main__.py", line 79, in annotate_command
    stats = asyncio.run(main())
            ^^^^^^^^^^^^^^^^^^^
  File "/home/douglas/micromamba/envs/py311/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/home/douglas/micromamba/envs/py311/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/douglas/micromamba/envs/py311/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/douglas/micromamba/envs/py311/lib/python3.11/site-packages/profila/__main__.py", line 77, in main
    return await get_stats(process)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/douglas/micromamba/envs/py311/lib/python3.11/site-packages/profila/__main__.py", line 54, in get_stats
    async for sample in read_samples(process):
  File "/home/douglas/micromamba/envs/py311/lib/python3.11/site-packages/profila/_gdb.py", line 100, in read_samples
    async for sample in _sample(process):
  File "/home/douglas/micromamba/envs/py311/lib/python3.11/site-packages/profila/_gdb.py", line 53, in _sample
    if "stack" not in message["payload"]:  # type: ignore
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
itamarst commented 5 months ago

I will fix this, but as workaround I've found just rerunning usually seems to work, I haven't seen it happen consistently.