All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cache: Add better cache loading sanity checks
@ 2016-07-22 10:28 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2016-07-22 10:28 UTC (permalink / raw)
  To: bitbake-devel

We've seen cache corruption where the pairs come out in a different
order to the way we saved them for unknown reasons. Add better sanity
checking to give a more user friendly error rather than a crash/traceback.

Also allows the system to reparse and recover.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

diff --git a/bitbake/lib/bb/cache.py b/bitbake/lib/bb/cache.py
index cce12d1..439565f 100644
--- a/bitbake/lib/bb/cache.py
+++ b/bitbake/lib/bb/cache.py
@@ -328,6 +328,13 @@ class Cache(object):
                         value = pickled.load()
                     except Exception:
                         break
+                    if not isinstance(key, str):
+                        bb.warn("%s from extras cache is not a string?" % key)
+                        break
+                    if not isinstance(value, RecipeInfoCommon):
+                        bb.warn("%s from extras cache is not a RecipeInfoCommon class?" % value)
+                        break
+
                     if key in self.depends_cache:
                         self.depends_cache[key].append(value)
                     else:




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-22 10:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-22 10:28 [PATCH] cache: Add better cache loading sanity checks Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.