Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging a crash #55

Open
glensc opened this issue Dec 13, 2023 · 1 comment
Open

Debugging a crash #55

glensc opened this issue Dec 13, 2023 · 1 comment
Labels

Comments

@glensc
Copy link
Contributor

glensc commented Dec 13, 2023

Started using this library:

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.

@glensc glensc changed the title Debugging an crash Debugging a crash Dec 13, 2023
@sdelafond sdelafond added the bug label Dec 15, 2023
@SimonHeimberg
Copy link

You already tried -f, which often helped me. 🤔

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants