Bug 11315 - bitbake: ZeroDivisionError in bb.cache
Summary: bitbake: ZeroDivisionError in bb.cache
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 2.3
Hardware: x86 Multiple
: Undecided normal
Target Milestone: ---
Assignee: Markus Lehtonen
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-04-10 10:11 UTC by Markus Lehtonen
Modified: 2017-04-13 14:40 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
autobuilder log (5.46 KB, application/octet-stream)
2017-04-10 10:11 UTC, Markus Lehtonen
no flags Details
autobuilder log (5.46 KB, text/plain)
2017-04-10 10:17 UTC, Markus Lehtonen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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/