Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profila occasionally fails with message that is None #9

Closed
itamarst opened this issue May 24, 2024 · 4 comments · Fixed by #13
Closed

Profila occasionally fails with message that is None #9

itamarst opened this issue May 24, 2024 · 4 comments · Fixed by #13
Labels
bug Something isn't working

Comments

@itamarst
Copy link
Collaborator

  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
@itamarst itamarst added the bug Something isn't working label May 24, 2024
@Doggie52
Copy link

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
Copy link
Collaborator Author

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

@rwaples
Copy link

rwaples commented Nov 26, 2024

I'm having the same problem - it has occurred at least 3 times in a row for me, can't get it to complete. I assume that
massage["payload"] can be None, and if so it causes an error.

@itamarst
Copy link
Collaborator Author

Thanks for the reminder, will try to get to this soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants