diff options
author | 2016-06-20 09:52:43 +0300 | |
---|---|---|
committer | 2016-06-20 11:55:14 +0300 | |
commit | 0bcd7377e8d476a0eb8f7d7f55f59e0c6df91f28 (patch) | |
tree | b4439497f2cb4788822b73e320d00175fe585e63 | |
parent | b9726ed2056ed2de756e6af702b5ed51101c9674 (diff) |
WATCHDOG: using exit() might get stuck because it deallocates memory
on an already unstable state - need to use abort or C++ exceptions which
uses abort
-rw-r--r-- | src/trex_watchdog.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/trex_watchdog.cpp b/src/trex_watchdog.cpp index 79dadb16..c72ce69e 100644 --- a/src/trex_watchdog.cpp +++ b/src/trex_watchdog.cpp @@ -250,8 +250,8 @@ void TrexWatchDog::_main() { /* nothing to do more... the other thread will terminate, but if not - we terminate */ sleep(5); - printf("\n\n*** WATCHDOG violation detected on task '%s' which have failed to response to the signal ***\n\n", monitor->get_name().c_str()); - exit(1); + fprintf(stderr, "\n\n*** WATCHDOG violation detected on task '%s' which have failed to response to the signal ***\n\n", monitor->get_name().c_str()); + abort(); } } |