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.
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
MappingInfostore 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.