Hello Sean Wilson,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/c/public/gem5/+/12167
to review the following change.
Change subject: testlib: No catch of custom exceptions in sandbox
......................................................................
testlib: No catch of custom exceptions in sandbox
Custom exceptions are not always properly pickled which could lead to
the sandbox test executor to crash when it tries to re __init__ pickled
exceptions thrown from the failed test.
Change-Id: I4e2ffe5802dda668b5d61c5a16e0989717121a04
Signed-off-by: Sean Wilson <[email protected]>
---
M ext/testlib/sandbox.py
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/ext/testlib/sandbox.py b/ext/testlib/sandbox.py
index 7f8fe2d..49fe133 100644
--- a/ext/testlib/sandbox.py
+++ b/ext/testlib/sandbox.py
@@ -133,18 +133,16 @@
class SubprocessException(Exception):
- def __init__(self, exception, trace):
+ def __init__(self, trace):
super(SubprocessException, self).__init__(trace)
class ExceptionProcess(multiprocessing.Process):
- class Status():
+ class Status(object):
def __init__(self, exitcode, exception_tuple):
self.exitcode = exitcode
if exception_tuple is not None:
- self.trace = exception_tuple[1]
- self.exception = exception_tuple[0]
+ self.trace = exception_tuple[0]
else:
- self.exception = None
self.trace = None
def __init__(self, *args, **kwargs):
@@ -156,9 +154,9 @@
try:
super(ExceptionProcess, self).run()
self._cconn.send(None)
- except Exception as e:
+ except Exception:
tb = traceback.format_exc()
- self._cconn.send((e, tb))
+ self._cconn.send((tb, ))
raise
@property
@@ -186,7 +184,7 @@
status = self.p.status
if status.exitcode:
- raise SubprocessException(status.exception, status.trace)
+ raise SubprocessException(status.trace)
def entrypoint(self):
self.io_manager.setup()
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12167
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I4e2ffe5802dda668b5d61c5a16e0989717121a04
Gerrit-Change-Number: 12167
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Wilson <[email protected]>
Gerrit-Reviewer: Sean Wilson <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev