xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #2290: fault-handler.patch

File fault-handler.patch, 1.7 KB (added by Antoine Martin, 21 months ago)

faulthandler doesn't work?

  • xpra/client/client_base.py

     
    5757DETECT_LEAKS = envbool("XPRA_DETECT_LEAKS", False)
    5858LEGACY_SALT_DIGEST = envbool("XPRA_LEGACY_SALT_DIGEST", True)
    5959MOUSE_DELAY = envint("XPRA_MOUSE_DELAY", 0)
     60FAULT_HANDLER = envbool("XPRA_FAULT_HANDLER", True)
    6061
    6162
    6263def noop():
     
    232233            self.handle_app_signal(signum)
    233234        signal.signal(signal.SIGINT, os_signal)
    234235        signal.signal(signal.SIGTERM, os_signal)
     236        if FAULT_HANDLER:
     237            import faulthandler
     238            faulthandler.enable()
    235239
    236240    def signal_disconnect_and_quit(self, exit_code, reason):
    237241        log("signal_disconnect_and_quit(%s, %s) exit_on_signal=%s", exit_code, reason, self.exit_on_signal)
  • xpra/server/server_core.py

     
    7474SERVER_SOCKET_TIMEOUT = envfloat("XPRA_SERVER_SOCKET_TIMEOUT", "0.1")
    7575LEGACY_SALT_DIGEST = envbool("XPRA_LEGACY_SALT_DIGEST", True)
    7676CHALLENGE_TIMEOUT = envint("XPRA_CHALLENGE_TIMEOUT", 120)
     77FAULT_HANDLER = envbool("XPRA_FAULT_HANDLER", True)
    7778
    7879
    7980HTTP_UNSUPORTED = b"""HTTP/1.1 400 Bad request syntax or unsupported method
     
    404405            callback(signum)
    405406        signal.signal(signal.SIGINT, os_signal)
    406407        signal.signal(signal.SIGTERM, os_signal)
     408        if FAULT_HANDLER:
     409            import faulthandler
     410            faulthandler.enable()
    407411
    408 
    409412    def run(self):
    410413        self.install_signal_handlers(self.signal_quit)
    411414        def start_ready_callbacks():