Open cederom opened 3 years ago
Code proposition for easy backtracking this kind of problems of python crashes: https://github.com/pyocd/pyOCD/pull/1033 :-)
faulthandler
module is not default part of Python 3.3+. This may bring important/helpful information in case of problems :-)
Hello world :-)
Something terrible happened on my system and pyOCD started to segfault :-( I have tried different pyOCD versions, Python versions, etc. Was there a big change in USB handling recently in pyOCD @flit ? Other applications using Python and PyUSB/LibUSB works fine. Any hints welcome :-)
I was not really able to debug whole python with pyocd neither with gdb nor pdb/pudb3.
But I have found amazing module that simply catches all segfaults and prints nice backtrack automatically on crash :-)
Without
faulthandler
:With
faulthandler
we instantly get a backtrace on crash and we simply can see the cause of the problem:This only required two lines to be added:
The question is do we want to have such traceback in the code just in case code crashes and we simply get what we need at will?
If so where should we put that? In
pyocd
script?