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

crash when parsing profile #91

Closed
ellperro opened this issue Dec 2, 2020 · 2 comments · Fixed by #94
Closed

crash when parsing profile #91

ellperro opened this issue Dec 2, 2020 · 2 comments · Fixed by #94

Comments

@ellperro
Copy link

ellperro commented Dec 2, 2020

code:
fatmodule.py:

import time
#mimics a module which takes a long time to import
time.sleep(1)

demo2.py:

import time

def b():
    import fatmodule
    time.sleep(.1)

b()
python3 -m cProfile -o prof2 ./demo2.py
tuna2 prof2
Traceback (most recent call last):
  File "/home/bart/.local/bin/tuna", line 8, in <module>
    sys.exit(main())
  File "/home/bart/.local/lib/python3.8/site-packages/tuna/cli.py", line 32, in main
    start_server(args.infile, args.browser, args.port)
  File "/home/bart/.local/lib/python3.8/site-packages/tuna/main.py", line 44, in start_server
    data = read(prof_filename)
  File "/home/bart/.local/lib/python3.8/site-packages/tuna/main.py", line 23, in read
    return read_runtime_profile(filename)
  File "/home/bart/.local/lib/python3.8/site-packages/tuna/_runtime_profile.py", line 88, in read_runtime_profile
    "children": [populate(root, None) for root in roots],
  File "/home/bart/.local/lib/python3.8/site-packages/tuna/_runtime_profile.py", line 88, in <listcomp>
    "children": [populate(root, None) for root in roots],
  File "/home/bart/.local/lib/python3.8/site-packages/tuna/_runtime_profile.py", line 47, in populate
    c = [populate(child, key) for child in children[key]]
  File "/home/bart/.local/lib/python3.8/site-packages/tuna/_runtime_profile.py", line 47, in <listcomp>
    c = [populate(child, key) for child in children[key]]
  File "/home/bart/.local/lib/python3.8/site-packages/tuna/_runtime_profile.py", line 47, in populate
    c = [populate(child, key) for child in children[key]]
...
RecursionError: maximum recursion depth exceeded in comparison

prof2.gz

@nschloe
Copy link
Owner

nschloe commented Dec 3, 2020

Thanks for the excellent reports! I won't have time to look into it immediately, but I'll get to it as soon as I can.

@nschloe nschloe mentioned this issue Dec 20, 2020
@nschloe
Copy link
Owner

nschloe commented Dec 20, 2020

Fixed now. Thanks again for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants