Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix segfault on probestack with dynamic alloca. #244

Merged
merged 2 commits into from
May 28, 2018

Conversation

qnighy
Copy link
Contributor

@qnighy qnighy commented May 27, 2018

When dynamic alloca is used, __rust_probestack is called even if the allocation is small. This patch fixes the segfault (false stack smash) occuring when dynamic alloca attempts to allocate a small fragment of stack memory.

I need it fixed to implement rust-lang/rust#48055.

@alexcrichton
Copy link
Member

Thanks! Could you add a comment mentioning why the initial check is done? (in that it's not required in the general case, only for alloca)

@qnighy
Copy link
Contributor Author

qnighy commented May 28, 2018

Added a comment.

@alexcrichton alexcrichton merged commit 6eb8f8d into rust-lang:master May 28, 2018
@alexcrichton
Copy link
Member

👍

bors added a commit to rust-lang/rust that referenced this pull request Aug 19, 2018
Implement Unsized Rvalues

This PR is the first step to implement RFC1909: unsized rvalues (#48055).

## Implemented

- `Sized` is removed for arguments and local bindings. (under `#![feature(unsized_locals)]`)
- Unsized locations are allowed in MIR
- Unsized places and operands are correctly translated at codegen

## Not implemented in this PR

- Additional `Sized` checks:
  - tuple struct constructor (accidentally compiles now)
  - closure arguments at closure generation (accidentally compiles now)
  - upvars (ICEs now)
- Generating vtable for `fn method(self)` (ICEs now)
- VLAs: `[e; n]` where `n` isn't const
- Reduce unnecessary allocations

## Current status

- [x] Fix `__rust_probestack` (rust-lang/compiler-builtins#244)
  - [x] Get the fix merged
- [x] `#![feature(unsized_locals)]`
  - [x] Give it a tracking issue number
- [x] Lift sized checks in typeck and MIR-borrowck
  - [ ] <del>Forbid `A(unsized-expr)`</del> will be another PR
- [x] Minimum working codegen
- [x] Add more examples and fill in unimplemented codegen paths
- [ ] <del>Loosen object-safety rules (will be another PR)</del>
- [ ] <del>Implement `Box<FnOnce>` (will be another PR)</del>
- [ ] <del>Reduce temporaries (will be another PR)</del>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants