Bug 11315

Summary: bitbake: ZeroDivisionError in bb.cache
Product: [Build System, Metadata & Runtime] BitBake Reporter: Markus Lehtonen <markus.lehtonen>
Component: bitbakeAssignee: Markus Lehtonen <markus.lehtonen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided CC: markus.lehtonen, poky.bs.watcher, poky.watcher
Version: 2.3   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
autobuilder log
none
autobuilder log none

Description Markus Lehtonen 2017-04-10 10:11:29 UTC
Created attachment 3693 [details]
autobuilder log

There was a failure in oeqa.selftest.recipetool.RecipetoolTests.test_recipetool_appendfile_postinstall that was caused by a division-by-zero error in bb.cache:

File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/bitbake/lib/bb/cache.py", line 465, in Cache.load_cachefile():
                         current_progress = cachefile.tell() + previous_progress
    >                    current_percent = 100 * current_progress / cachesize
                         if current_percent > previous_percent:
ZeroDivisionError: division by zero



Relevant part of the autobuilder log is attached.
Comment 1 Markus Lehtonen 2017-04-10 10:17:19 UTC
Created attachment 3694 [details]
autobuilder log
Comment 2 Markus Lehtonen 2017-04-10 10:56:11 UTC
I was not able to reproduce the issue. But, I think it must be rare race in cache file access, experienced under heave io load: the cache file(s) is accessed asynchronously and another thread writes out the file just after we checked it size so we get size if zero but are still able to read data from it just a little bit later.

Patch sent for review:
https://patchwork.openembedded.org/patch/138986/