about summary refs log tree commit diff
path: root/src/test/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-02-04 23:28:57 +0800
committerGitHub <noreply@github.com>2018-02-04 23:28:57 +0800
commit8b8c6ee79613037e3a7886d1b80c34fcc538511b (patch)
tree22b188653b638ea4eaced940df87fa0e48409fbb /src/test/debuginfo/enum-thinlto.rs
parent349115efdac1b3731be10e4e5d1bd2c67a43552a (diff)
parent55b54a999bcdb0b1c1f42b6e1ae670beb0717086 (diff)
downloadrust-8b8c6ee79613037e3a7886d1b80c34fcc538511b.tar.gz
rust-8b8c6ee79613037e3a7886d1b80c34fcc538511b.zip
Rollup merge of #47912 - cuviper:glibc-stack-guard, r=alexcrichton
Use a range to identify SIGSEGV in stack guards

Previously, the `guard::init()` and `guard::current()` functions were
returning a `usize` address representing the top of the stack guard,
respectively for the main thread and for spawned threads.  The `SIGSEGV`
handler on `unix` targets checked if a fault was within one page below that
address, if so reporting it as a stack overflow.

Now `unix` targets report a `Range<usize>` representing the guard memory,
so it can cover arbitrary guard sizes.  Non-`unix` targets which always
return `None` for guards now do so with `Option<!>`, so they don't pay any
overhead.

For `linux-gnu` in particular, the previous guard upper-bound was
`stackaddr + guardsize`, as the protected memory was *inside* the stack.
This was a glibc bug, and starting from 2.27 they are moving the guard
*past* the end of the stack.  However, there's no simple way for us to know
where the guard page actually lies, so now we declare it as the whole range
of `stackaddr ± guardsize`, and any fault therein will be called a stack
overflow.  This fixes #47863.
Diffstat (limited to 'src/test/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions