Closed Bug 867033 Opened 11 years ago Closed 11 years ago

ZeroDivisionError: float division by zero

Categories

(Firefox Build System :: General, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla23

People

(Reporter: ewong, Assigned: ewong)

References

Details

Attachments

(1 file, 1 obsolete file)

Our Linux32 builders are encountering this error:


checking for application to build... suite
checking if app-specific confvars.sh exists... e:/builds/slave/c-cen-t-w32/build/suite/confvars.sh
updating cache ./config.cache
creating ./config.status
*** Fix above errors and then restart with               "D:/mozilla-build/python27/python2.7.exe e:/builds/slave/c-cen-t-w32/build/mozilla/build/pymake/pymake/../make.py -f client.mk build"
e:\builds\slave\c-cen-t-w32\build\client.mk:305:0: command 'cd objdir &&  MAKE="D:/mozilla-build/python27/python2.7.exe e:/builds/slave/c-cen-t-w32/build/mozilla/build/pymake/pymake/../make.py"  e:/builds/slave/c-cen-t-w32/build/configure  \
  || ( echo "*** Fix above errors and then restart with\
               \"D:/mozilla-build/python27/python2.7.exe e:/builds/slave/c-cen-t-w32/build/mozilla/build/pymake/pymake/../make.py -f client.mk build\"" && exit 1 )' failed, return code 1
e:\builds\slave\c-cen-t-w32\build\client.mk:317:0: command 'D:/mozilla-build/python27/python2.7.exe e:/builds/slave/c-cen-t-w32/build/mozilla/build/pymake/pymake/../make.py -f e:/builds/slave/c-cen-t-w32/build/client.mk configure' failed, return code 2
Reticulating splines...
Finished reading 1 moz.build files into 2 descriptors in 0.00s
Backend executed in 0.00s
2 total backend files. 2 created; 0 updated; 0 unchanged
Traceback (most recent call last):
  File "./config.status", line 75, in <module>
    config_status(**args)
  File "e:\builds\slave\c-cen-t-w32\build\mozilla\build\ConfigStatus.py", line 124, in config_status
    for line in summary.summaries():
  File "e:\builds\slave\c-cen-t-w32\build\mozilla\python\mozbuild\mozbuild\backend\base.py", line 85, in summaries
    yield self.total_summary
  File "e:\builds\slave\c-cen-t-w32\build\mozilla\python\mozbuild\mozbuild\backend\base.py", line 75, in total_summary
    self.wall_time, self.cpu_time, self.cpu_time / self.wall_time)
ZeroDivisionError: float division by zero
Traceback (most recent call last):
  File "e:/builds/slave/c-cen-t-w32/build/build/pymake/make.py", line 35, in <module>
    main(sys.argv[1:])
  File "e:/builds/slave/c-cen-t-w32/build/build/pymake/make.py", line 32, in main
    subprocess.check_call([sys.executable, PYMAKE] + args)
  File "D:\mozilla-build\python27\lib\subprocess.py", line 511, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['D:\\mozilla-build\\python27\\python2.7.exe', 'e:\\builds\\slave\\c-cen-t-w32\\build\\mozilla\\build\\pymake\\make.py', '-f', 'client.mk', 'build', 'MOZ_BUILD_DATE=20130429144751']' returned non-zero exit status 2
program finished with exit code 1
elapsedTime=9.782000
========= Finished compile failed (results: 2, elapsed: 9 secs) (at 2013-04-29 16:49:54.887041) ==========

I'm guessing the wall_time == 0 (why? I don't know... Third base..)
http://hg.mozilla.org/mozilla-central/diff/cc1e0568c96a/python/mozbuild/mozbuild/backend/base.py#l1.74

Specifically:

 @property
 def total_summary(self):
     return 'Total wall time: {:.2f}s; CPU time: {:.2f}s; Efficiency: {:.0%}'.format(
           self.wall_time, self.cpu_time, self.cpu_time / self.wall_time)

I'm not familiar with the code, but there's no test for if self.wall_time == 0 (or close to being 0)... should efficiency be set to 100%?
(In reply to Edmund Wong (:ewong) from comment #0)
> Our Linux32 builders are encountering this error:

s/Linux32//
The build system is too fast!
(In reply to Edmund Wong (:ewong) from comment #2)
> (In reply to Edmund Wong (:ewong) from comment #0)
> > Our Linux32 builders are encountering this error:
> 
> s/Linux32//

s/Our/SeaMonkey/
Attached patch Check self.wall_time for 0 (obsolete) — Splinter Review
possible patch to avoid divide by zeros.
Attachment #743507 - Flags: review?(gps)
OS: Windows Vista → All
Comment on attachment 743507 [details] [diff] [review]
Check self.wall_time for 0

Review of attachment 743507 [details] [diff] [review]:
-----------------------------------------------------------------

::: python/mozbuild/mozbuild/backend/base.py
@@ +74,5 @@
> +        efficiencyValue = 0
> +        if self.wall_time == 0:
> +           efficiencyValue = 100
> +        else
> +           efficiencyValue = self.cpu_time / self.wall_time

Nit: _ not camelCase

You could also write this as:

efficiency_value = self.cpu_time / self.wall_time if self.wall_time else 100
Attachment #743507 - Flags: review?(gps) → review+
Assignee: nobody → ewong
Attachment #743507 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #744365 - Flags: review?(gps)
Attachment #744365 - Flags: review?(gps) → review+
Target Milestone: --- → mozilla25
Target Milestone: mozilla25 → mozilla23
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: