Commit Graph

7 Commits (6eb8f8d710c5d77b0914bec56f68336ad3f06aac)

Author SHA1 Message Date
Masaki Hara 1d15be6a86 Explain why we need extra check in probestack. 2018-05-28 13:29:35 +09:00
Masaki Hara 56293ad7c7 Fix segfault on probestack with dynamic alloca. 2018-05-27 23:28:17 +09:00
Dan Gohman a6ecd1a73f Add "volatile" and "memory" clobber to asm! that doesn't fall through.
Use the "volatile" option and the "memory" clobber on inline asm that does
things like return directly, to reduce the chances of compilers rearranging
the code.
2017-11-15 12:49:10 -08:00
Matt Ickstadt a40cc6a12d Don't compile probestack functions during testing 2017-09-15 18:13:06 -05:00
Alex Crichton 91eaa85902 Don't mangle probes all the time 2017-07-07 20:35:14 -07:00
Alex Crichton f9f6bd0589 Tweak definition of probestack functions
It looks like the old `__rust_probestack` routine is incompatible with newer
linux kernels. My best guess for this is that the kernel's auto-growth logic is
failing to trigger, causing what looks like a legitimate segfault to get
delivered. My best guess for why *that's* happening is that the faulting address
is below `%rsp`, whereas previously all faulting stack addresses were above
`%rsp`. The probestack routine does not modify `%rsp` as it's probing the stack,
and presumably newer kernels are interpreting this as a legitimate violation.

This commit tweaks the probestack routine to instead update `%rsp` incrementally
as probing happens. The ABI of the function, however, requires that `%rsp`
isn't changed as part of the function so it's restored at the end to the
previous value.
2017-07-07 10:16:03 -07:00
Alex Crichton 7ccf8408d0 Add `__rust_probestack` intrinsic
Will be required for rust-lang/rust#42816
2017-07-06 06:58:32 -07:00