From 16cad8426aa9452c94a61650e3cdfc7568a00808 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 28 May 2015 12:17:25 +0200 Subject: [PATCH 1/2] Enable faulthandler only for dev build --- gns3server/crash_report.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index 2cefe0e4..150342f3 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -21,8 +21,6 @@ import struct import platform import faulthandler -# Display a traceback in case of segfault crash. Usefull when frozen -faulthandler.enable() try: import raven @@ -38,6 +36,14 @@ import logging log = logging.getLogger(__name__) +# Dev build +if __version__[4] != 0: + # Display a traceback in case of segfault crash. Usefull when frozen + # Not enabled by default for security reason + log.info("Enable catching segfault") + faulthandler.enable() + + class CrashReport: """ From a2dfeab3153347536759b0ee69b55e07e0401c78 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Thu, 28 May 2015 12:17:56 +0200 Subject: [PATCH 2/2] Load faulthandler module only for dev build --- gns3server/crash_report.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index 150342f3..984fca18 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -19,7 +19,6 @@ import os import sys import struct import platform -import faulthandler try: @@ -38,6 +37,8 @@ log = logging.getLogger(__name__) # Dev build if __version__[4] != 0: + import faulthandler + # Display a traceback in case of segfault crash. Usefull when frozen # Not enabled by default for security reason log.info("Enable catching segfault")