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

Tools/scripts/summarize_stats.py fails following #108754 #109136

Closed
mdboom opened this issue Sep 8, 2023 · 0 comments
Closed

Tools/scripts/summarize_stats.py fails following #108754 #109136

mdboom opened this issue Sep 8, 2023 · 0 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@mdboom
Copy link
Contributor

mdboom commented Sep 8, 2023

Bug report

Bug description:

After building with ./configure --enable-pystats and collecting some pystats with this script:

import sys

sys._stats_on()
for i in range(50):
    pass
sys._stats_off()

running the Tools/scripts/summarize_stats.py script fails with the following:

Traceback (most recent call last):
  File "/home/mdboom/Work/builds/cpython/Lib/pdb.py", line 2110, in main                                                pdb._run(target)
  File "/home/mdboom/Work/builds/cpython/Lib/pdb.py", line 1882, in _run                                                self.run(target.code)
  File "/home/mdboom/Work/builds/cpython/Lib/bdb.py", line 600, in run                                                  exec(cmd, globals, locals)
  File "<string>", line 1, in <module>
  File "/home/mdboom/Work/builds/cpython/Tools/scripts/summarize_stats.py", line 686, in <module>
    main()
  File "/home/mdboom/Work/builds/cpython/Tools/scripts/summarize_stats.py", line 683, in main                           output_stats(args.inputs, json_output=args.json_output)                                                           File "/home/mdboom/Work/builds/cpython/Tools/scripts/summarize_stats.py", line 639, in output_stats                   output_single_stats(stats)
  File "/home/mdboom/Work/builds/cpython/Tools/scripts/summarize_stats.py", line 607, in output_single_stats
    emit_call_stats(stats)
  File "/home/mdboom/Work/builds/cpython/Tools/scripts/summarize_stats.py", line 460, in emit_call_stats
    rows = calculate_call_stats(stats)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mdboom/Work/builds/cpython/Tools/scripts/summarize_stats.py", line 451, in calculate_call_stats           label = name + " (" + pretty(defines[index][0]) + ")"
                                 ~~~~~~~~~~~~~~^^^
IndexError: list index out of range

This was broken by #108754 since it moved the stats definitions from Include/pystats.h to Include/cpython/pystats.h, but the path wasn't updated in summarize_stats.py.

I will have a fix posted shortly.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

@mdboom mdboom added the type-bug An unexpected behavior, bug, or error label Sep 8, 2023
mdboom added a commit to mdboom/cpython that referenced this issue Sep 8, 2023
@vstinner vstinner closed this as completed Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants