New issue
Advanced search Search tips

Issue 720624 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: May 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Division by zero error when running diagnose_bloat.py

Project Member Reported by wnwen@chromium.org, May 10 2017

Issue description

Ran:
tools/binary_size/diagnose_bloat.py HEAD --silent

I     10 Checking source directory
I   1067 Found matching metadata for a587a0931dc5dcf00b26d7bb9d1bcb0fe12882c6, skipping build step.
I   1067 Found matching metadata for fd366473bd8088df5e533b5f550f076baf2fdd7e, skipping build step.
I   1067 Creating: Native Diff
E  33531 Failure: command failed: /Work/clankium/src/tmpwSOpN8/binary_size/supersize diff /Work/clankium/src/binary-size-bloat/a587a0931dc5dcf00b26d7bb9d1bcb0fe12882c6/libmonochrome.size /Work/clankium/src/binary-size-bloat/fd366473bd8088df5e533b5f550f076baf2fdd7e/libmonochrome.size
stderr:
W     44 This script runs more than 2x faster if you install pypy.
Traceback (most recent call last):
  File "/Work/clankium/src/tmpwSOpN8/binary_size/libsupersize/main.py", line 102, in <module>
    main()
  File "/Work/clankium/src/tmpwSOpN8/binary_size/libsupersize/main.py", line 98, in main
    args.func(args, parser)
  File "/Work/clankium/src/tmpwSOpN8/binary_size/libsupersize/main.py", line 52, in Run
    console.Run(args, parser)
  File "/Work/clankium/src/tmpwSOpN8/binary_size/libsupersize/console.py", line 283, in Run
    session.Eval(args.query)
  File "/Work/clankium/src/tmpwSOpN8/binary_size/libsupersize/console.py", line 246, in Eval
    exec query in self._variables
  File "<string>", line 1, in <module>
  File "/Work/clankium/src/tmpwSOpN8/binary_size/libsupersize/console.py", line 120, in _PrintFunc
    _WriteToStream(lines, use_pager=use_pager, to_file=to_file)
  File "/Work/clankium/src/tmpwSOpN8/binary_size/libsupersize/console.py", line 63, in _WriteToStream
    describe.WriteLines(lines, sys.stdout.write)
  File "/Work/clankium/src/tmpwSOpN8/binary_size/libsupersize/describe.py", line 335, in WriteLines
    for l in lines:
  File "/Work/clankium/src/tmpwSOpN8/binary_size/libsupersize/describe.py", line 129, in _DescribeSymbolGroupChildren
    running_percent = running_total / total
ZeroDivisionError: float division by zero
 
Status: Started (was: Assigned)
I noticed this as well, fix is here: https://codereview.chromium.org/2871143004/. Thanks for filing!
Project Member

Comment 2 by bugdroid1@chromium.org, May 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/18e1d8f1798041d5df7aaeaf50065fe93367ecc7

commit 18e1d8f1798041d5df7aaeaf50065fe93367ecc7
Author: estevenson <estevenson@chromium.org>
Date: Wed May 10 23:34:00 2017

diagnose_bloat.py: swap --silent with --verbose.

Suppress build output by default as it makes the output harder to
follow.

Other updates:
  * Remove old references to diagnose_apk_bloat.py
  * Update Linux --cloud error message
  * Fix divide-by-zero in libsupersize/describe.py

BUG=695182,  720624 

Review-Url: https://codereview.chromium.org/2871143004
Cr-Commit-Position: refs/heads/master@{#470747}

[modify] https://crrev.com/18e1d8f1798041d5df7aaeaf50065fe93367ecc7/tools/binary_size/README.md
[modify] https://crrev.com/18e1d8f1798041d5df7aaeaf50065fe93367ecc7/tools/binary_size/diagnose_bloat.py
[modify] https://crrev.com/18e1d8f1798041d5df7aaeaf50065fe93367ecc7/tools/binary_size/libsupersize/describe.py

Status: Fixed (was: Started)

Comment 4 by wnwen@chromium.org, May 11 2017

Status: Verified (was: Fixed)
Verified locally.

Comment 5 by wnwen@chromium.org, May 11 2017

Labels: Performance-Size

Sign in to add a comment