rust/src/libstd/sys/wasm
kennytm 8b8c6ee796
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.
2018-02-04 23:28:57 +08:00
..
args.rs Implement extensible syscall interface for wasm 2018-01-30 23:22:19 +00:00
backtrace.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
cmath.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
condvar.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
env.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
fs.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
memchr.rs Move rust memchr impl to libcore 2017-12-13 01:15:18 -06:00
mod.rs Implement extensible syscall interface for wasm 2018-01-30 23:22:19 +00:00
mutex.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
net.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
os.rs Implement extensible syscall interface for wasm 2018-01-30 23:22:19 +00:00
os_str.rs Add lossless debug implementation for unix OsStrs 2017-12-18 01:52:56 +00:00
path.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
pipe.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
process.rs Capture environment at spawn 2017-12-24 14:24:31 +00:00
rwlock.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
stack_overflow.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
stdio.rs Implement extensible syscall interface for wasm 2018-01-30 23:22:19 +00:00
thread.rs Use a range to identify SIGSEGV in stack guards 2018-01-31 11:41:29 -08:00
thread_local.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
time.rs Implement extensible syscall interface for wasm 2018-01-30 23:22:19 +00:00