You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Detect guard pages and dump the real stack instead when encountering stack overflows on Linux #24
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.
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.
Activity
Gankra commentedon Jul 28, 2022
Is this the same issue as rust-minidump/rust-minidump#638 or is it happening for a different reason on macos?
gabrielesvelto commentedon Jul 29, 2022
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.
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows
Write stacks correctly during stack overflows (#78)