Debugging a crash
Started using this library:
- https://github.com/glensc/plex-fuse/pull/1
but it crashes in non-debug mode, and in debug mode no errors. catching exception does not help.
how to get logs out of the problem?
In that example, crash can be avoided by not using any plex server related in section_types method
this still crashes even faulti part is catch'ed:
@cached_property
def section_types(self):
try:
self.server
except Exception as e:
...
return {}
tl;dr: crashes on macos in normal mode. does not crash under -f, does not crash under -d, and under -d no known exception is thrown.
You already tried -f, which often helped me. :thinking:
Suggesting some ideas:
stdout to file
import sys
sys.stderr = open("~/fuse_debug.txt", "w")
#sys.stdout = sys.stderr # maybe also normal output
Then see if any error gets written into ~/.fuse_debug.txt
redirect traceback
Or a similar idea, write your own function replacing sys.get_traceback() to do custom printing, see https://docs.python.org/3/library/sys.html#sys.excepthook or http://stackoverflow.com/questions/6234405/ddg#16993115
debugger
Possibly the debugger can help. But I fail to get anything more useful than implementing one of the above things without changing the code. Anyway, redirect stdout: python3 -m pdb ./xxx/theCodeToDebug.py
(pdb) !import sys
(pdb) !sys.stderr = open("~/fuse_debug.txt", "w")
c
The debugger is left when main() is called, and I know no possibility to avoid this.