diff options
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 16f076f3b1..30cab5379e 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -2958,7 +2958,12 @@ class runQueuePipe(): | |||
2958 | while index != -1 and self.queue.startswith(b"<event>"): | 2958 | while index != -1 and self.queue.startswith(b"<event>"): |
2959 | try: | 2959 | try: |
2960 | event = pickle.loads(self.queue[7:index]) | 2960 | event = pickle.loads(self.queue[7:index]) |
2961 | except ValueError as e: | 2961 | except (ValueError, pickle.UnpicklingError, AttributeError, IndexError) as e: |
2962 | if isinstance(e, pickle.UnpicklingError) and "truncated" in str(e): | ||
2963 | # The pickled data could contain "</event>" so search for the next occurance | ||
2964 | # unpickling again, this should be the only way an unpickle error could occur | ||
2965 | index = self.queue.find(b"</event>", index + 1) | ||
2966 | continue | ||
2962 | bb.msg.fatal("RunQueue", "failed load pickle '%s': '%s'" % (e, self.queue[7:index])) | 2967 | bb.msg.fatal("RunQueue", "failed load pickle '%s': '%s'" % (e, self.queue[7:index])) |
2963 | bb.event.fire_from_worker(event, self.d) | 2968 | bb.event.fire_from_worker(event, self.d) |
2964 | if isinstance(event, taskUniHashUpdate): | 2969 | if isinstance(event, taskUniHashUpdate): |
@@ -2970,7 +2975,7 @@ class runQueuePipe(): | |||
2970 | while index != -1 and self.queue.startswith(b"<exitcode>"): | 2975 | while index != -1 and self.queue.startswith(b"<exitcode>"): |
2971 | try: | 2976 | try: |
2972 | task, status = pickle.loads(self.queue[10:index]) | 2977 | task, status = pickle.loads(self.queue[10:index]) |
2973 | except ValueError as e: | 2978 | except (ValueError, pickle.UnpicklingError, AttributeError, IndexError) as e: |
2974 | bb.msg.fatal("RunQueue", "failed load pickle '%s': '%s'" % (e, self.queue[10:index])) | 2979 | bb.msg.fatal("RunQueue", "failed load pickle '%s': '%s'" % (e, self.queue[10:index])) |
2975 | self.rqexec.runqueue_process_waitpid(task, status) | 2980 | self.rqexec.runqueue_process_waitpid(task, status) |
2976 | found = True | 2981 | found = True |