classification
Title: pybench prep_times calculation error
Type: crash Stage: resolved
Components: Demos and Tools, Installation Versions: Python 3.2
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: jcea, lemburg, python-dev, sandro.tosi, termim
Priority: normal Keywords: patch

Created on 2011-04-21 03:20 by termim, last changed 2011-06-26 13:30 by sandro.tosi. This issue is now closed.

Files
File name Uploaded Description Edit
pybench.patch termim, 2011-04-21 03:20 divide prep_times by CALIBRATION_LOOPS review
Messages (3)
msg134192 - (view) Author: Mikhail Terekhov (termim) * Date: 2011-04-21 03:20
For some time now my builds of python 3.2 on x86_64 platform in SuSE OBS are failing depending on the phase of the moon. The spec file for the python3-base package uses 'make profile-opt' command to build and Makefile.pre.in uses pybench.py for profile guided optimization. The pybench.py fails sometimes with the '* Internal Error (use --debug to display the traceback)' error. Adding --debug gives 'calibration setup did not work' i.e. some of the self.overhead_times values in the Test.calibrate_test method became negative. It happens for the  NestedForLoops test. The source inspection shows that most probably it was forgotten to divide by CALIBRATION_LOOPS when calculating prep_times. The patch against current head is attached, it solves the problem.
msg134204 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2011-04-21 09:30
Mikhail Terekhov wrote:
> 
> New submission from Mikhail Terekhov <termim@gmail.com>:
> 
> For some time now my builds of python 3.2 on x86_64 platform in SuSE OBS are failing depending on the phase of the moon. The spec file for the python3-base package uses 'make profile-opt' command to build and Makefile.pre.in uses pybench.py for profile guided optimization. The pybench.py fails sometimes with the '* Internal Error (use --debug to display the traceback)' error. Adding --debug gives 'calibration setup did not work' i.e. some of the self.overhead_times values in the Test.calibrate_test method became negative. It happens for the  NestedForLoops test. The source inspection shows that most probably it was forgotten to divide by CALIBRATION_LOOPS when calculating prep_times. The patch against current head is attached, it solves the problem.

Good catch. Your analysis is correct.

Interesting that it took more than
6 years to discover this bug... looks like CPUs got more than
20 times faster since back then.
msg134366 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-04-25 01:47
New changeset e4fcfb8066ff by Jesus Cea in branch '2.7':
pybench prep_times calculation error (closes #11895)
http://hg.python.org/cpython/rev/e4fcfb8066ff

New changeset 7569870a8236 by Jesus Cea in branch '3.1':
pybench prep_times calculation error (closes #11895)
http://hg.python.org/cpython/rev/7569870a8236

New changeset 66ef5e844e6c by Jesus Cea in branch '3.2':
pybench prep_times calculation error (closes #11895)
http://hg.python.org/cpython/rev/66ef5e844e6c

New changeset 8a277949d904 by Jesus Cea in branch 'default':
pybench prep_times calculation error (closes #11895)
http://hg.python.org/cpython/rev/8a277949d904
History
Date User Action Args
2011-06-26 13:30:27sandro.tosisetstatus: open -> closed
nosy: + sandro.tosi

resolution: accepted
stage: resolved
2011-04-25 01:51:17jceasetstatus: closed -> open
nosy: + jcea

resolution: fixed -> (no value)
stage: resolved -> (no value)
2011-04-25 01:47:49python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg134366

resolution: fixed
stage: resolved
2011-04-21 09:30:22lemburgsetnosy: + lemburg
messages: + msg134204
2011-04-21 03:20:12termimcreate