]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: runqueue: Catch ValueError from pickle.loads
authorMartin Jansa <martin.jansa@gmail.com>
Sun, 23 Feb 2014 10:02:18 +0000 (11:02 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 24 Feb 2014 12:42:40 +0000 (12:42 +0000)
* exception like this keeps spinning quite quickly generating GBs of logs
  better to kill it asap and show invalid pickle

(Bitbake rev: a69eb4c12c71bba9d742c4e5578f25c388d9f825)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/runqueue.py

index 413d59f8f4f4ffcb1b9b642f01df130fe006f56a..bc48684d78d77ed7224e8160ee0a581e8235cd1f 100644 (file)
@@ -2092,14 +2092,20 @@ class runQueuePipe():
             found = False
             index = self.queue.find("</event>")
             while index != -1 and self.queue.startswith("<event>"):
-                event = pickle.loads(self.queue[7:index])
+                try:
+                    event = pickle.loads(self.queue[7:index])
+                except ValueError as e:
+                    bb.msg.fatal("RunQueue", "failed load pickle '%s': '%s'" % (e, self.queue[7:index]))
                 bb.event.fire_from_worker(event, self.d)
                 found = True
                 self.queue = self.queue[index+8:]
                 index = self.queue.find("</event>")
             index = self.queue.find("</exitcode>")
             while index != -1 and self.queue.startswith("<exitcode>"):
-                task, status = pickle.loads(self.queue[10:index])
+                try:
+                    task, status = pickle.loads(self.queue[10:index])
+                except ValueError as e:
+                    bb.msg.fatal("RunQueue", "failed load pickle '%s': '%s'" % (e, self.queue[10:index]))
                 self.rq.runqueue_process_waitpid(task, status)
                 found = True
                 self.queue = self.queue[index+11:]