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

faulthandler does not correctly filter fatal exceptions on Windows #74742

Closed
zooba opened this issue Jun 2, 2017 · 9 comments
Closed

faulthandler does not correctly filter fatal exceptions on Windows #74742

zooba opened this issue Jun 2, 2017 · 9 comments
Assignees
Labels
3.7 (EOL) end of life OS-windows type-bug An unexpected behavior, bug, or error

Comments

@zooba
Copy link
Member

zooba commented Jun 2, 2017

BPO 30557
Nosy @pfmoore, @vstinner, @tjguk, @ned-deily, @zware, @eryksun, @zooba
PRs
  • bpo-30557: faulthandler now correctly filters and displays exception codes on Windows #1924
  • [3.6] bpo-30557: faulthandler now correctly filters and displays exception … #1960
  • bpo-30557: Fix test_faulthandler #1969
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/zooba'
    closed_at = <Date 2017-06-06.20:47:54.209>
    created_at = <Date 2017-06-02.21:09:30.875>
    labels = ['type-bug', '3.7', 'OS-windows']
    title = 'faulthandler does not correctly filter fatal exceptions on Windows'
    updated_at = <Date 2017-06-06.20:47:54.208>
    user = 'https://github.com/zooba'

    bugs.python.org fields:

    activity = <Date 2017-06-06.20:47:54.208>
    actor = 'steve.dower'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2017-06-06.20:47:54.209>
    closer = 'steve.dower'
    components = ['Windows']
    creation = <Date 2017-06-02.21:09:30.875>
    creator = 'steve.dower'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30557
    keywords = []
    message_count = 9.0
    messages = ['295054', '295055', '295216', '295217', '295232', '295272', '295281', '295284', '295301']
    nosy_count = 7.0
    nosy_names = ['paul.moore', 'vstinner', 'tim.golden', 'ned.deily', 'zach.ware', 'eryksun', 'steve.dower']
    pr_nums = ['1924', '1960', '1969']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue30557'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @zooba
    Copy link
    Member Author

    zooba commented Jun 2, 2017

    faulthandler adds a structured exception handler on Windows so we can dump a Python traceback before crashing. This should only be done for fatal exceptions, but is currently done for some non-fatal exceptions.

    The current test is flags & EXCEPTION_NONCONTINUABLE, which is incorrect (as evidenced by the fact that the check is wrong in its current context and should be !(flags & EXCEPTION_NONCONTINUABLE)).

    Instead, code & 0x80000000 determines whether the exception is an error. If not, we should skip logging any info.

    @zooba zooba added the 3.7 (EOL) end of life label Jun 2, 2017
    @zooba zooba self-assigned this Jun 2, 2017
    @zooba zooba added OS-windows type-bug An unexpected behavior, bug, or error labels Jun 2, 2017
    @zooba
    Copy link
    Member Author

    zooba commented Jun 2, 2017

    Also, it displays exception codes as decimal, but should be hex. I'll fix that too

    @zooba
    Copy link
    Member Author

    zooba commented Jun 5, 2017

    New changeset e6a23c8 by Steve Dower in branch 'master':
    bpo-30557: faulthandler now correctly filters and displays exception codes on Windows (bpo-1924)
    e6a23c8

    @ned-deily
    Copy link
    Member

    @zooba
    Copy link
    Member Author

    zooba commented Jun 6, 2017

    Thanks. Apparently that "filter out bit 4" thing didn't exist in Win7. Guess I need to track down the actual docs and confirm exactly where that happens.

    Doesn't break the important functionality though, just the test. I don't know that the exit code is stable when the process crashes, so perhaps I should just test for non-zero.

    @vstinner
    Copy link
    Member

    vstinner commented Jun 6, 2017

    It seems like all 3.x Windows buildbots are red... except of x86 Windows7 3.x.

    Only on Windows older than 7 SP 1, so on Windows 7 for buildbots, the bit is cleared.

    I created #1969 to try to fix buildbots.

    @zooba
    Copy link
    Member Author

    zooba commented Jun 6, 2017

    New changeset 6a1d84e by Steve Dower (Victor Stinner) in branch 'master':
    bpo-30557: Fix test_faulthandler (bpo-1969)
    6a1d84e

    @zooba
    Copy link
    Member Author

    zooba commented Jun 6, 2017

    My backport wasn't merged, so I cherrypicked Victor's fix into that PR. Once the buildbots are green again, I'll merge it.

    @zooba
    Copy link
    Member Author

    zooba commented Jun 6, 2017

    New changeset 2bafc0d by Steve Dower in branch '3.6':
    [3.6] bpo-30557: faulthandler now correctly filters and displays exception … (bpo-1960)
    2bafc0d

    @zooba zooba closed this as completed Jun 6, 2017
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life OS-windows type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants