8000 Detect guard pages and dump the real stack instead when encountering stack overflows on Linux · Issue #24 · rust-minidump/minidump-writer · GitHub
[go: up one dir, main page]

Skip to content

Detect guard pages and dump the real stack instead when encountering stack overflows on Linux #24

Closed

Description

@gabrielesvelto

After landing bug 1678152 in Firefox we noticed that several of the crash reports we got had an empty stack. The first frame was fine but the rest of the stack appeared to be an empty 4KiB chunk. As it turns out in those crashes the stack pointer had been bumped straight into the guard page below the stack causing this code code to mistake the guard page for the stack and dumping it. The new writer inherited this flaw from Breakpad. To fix this we should have MappingInfo store the readable/writable flags in addition to the executable one and if the mapping we find here is non readable/writable then we should shift the stack pointer to the previous page and pick the previous mapping instead.

Activity

  1. Gankra commented on Jul 28, 2022

    @Gankra
    Contributor

    Is this the same issue as rust-minidump/rust-minidump#638 or is it happening for a different reason on macos?

  2. gabrielesvelto commented on Jul 29, 2022

    @gabrielesvelto
    ContributorAuthor

    It could be the same reason. In fact given the logic should be the same it's highly likely and it intersects what @Swatinem noted about assuming the stack is a single memory region. Also I'm unsure if we're handling stack overflows on macOS properly so we might never have actually tested that particular code path. The last time I tried enabling Firefox' stack overflow tests on macOS it just didn't work so we might never have caught one for all we know.

  • added 9 commits that reference this issue on Apr 28, 2023
    97fc6e1
    3dcc8c7
    a604403
    d8179ce
    8945477
    8d66c57
    7024a97
    f92b998
    cc90c1e
  • added 3 commits that reference this issue on May 17, 2023
    14ffd55
    d1c35f4
    04bfdb7
  • added a commit that references this issue on May 26, 2023
    e706902
  • Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      No labels
      No labels

      Type

      No type

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        0