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 stack overflow detection on FreeBSD #32726

Merged
merged 5 commits into from
Apr 13, 2016
Merged

Fix stack overflow detection on FreeBSD #32726

merged 5 commits into from
Apr 13, 2016

Conversation

asomers
Copy link
Contributor

@asomers asomers commented Apr 4, 2016

No description provided.

src/libstd/sys/unix/thread.rs
	Implement several stack-related functions on FreeBSD

src/libstd/sys/unix/stack_overflow.rs
	Fix a comment
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

}
assert_eq!(libc::pthread_attr_destroy(&mut attr), 0);
ret
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty similar to get_stack_start with Linux/Android/NetBSD below, perhaps the two could share code? If the only difference is the name of the function pthread_getattr_np, then some renaming-on import should suffice I think.

#[cfg(not(target_os = "freebsd"))]
let e = libc::pthread_getattr_np(libc::pthread_self(), &mut attr);
if e == 0 {
//if libc::pthread_getattr_np(libc::pthread_self(), &mut attr) == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code.

@asomers
Copy link
Contributor Author

asomers commented Apr 13, 2016

@alexcrichton does it look good to you now?

@alexcrichton
Copy link
Member

@bors: r+ 78ea972

Thanks! Looks good to me

@bors
Copy link
Contributor

bors commented Apr 13, 2016

⌛ Testing commit 78ea972 with merge 7d4d3cb...

bors added a commit that referenced this pull request Apr 13, 2016
Fix stack overflow detection on FreeBSD
@bors bors merged commit 78ea972 into rust-lang:master Apr 13, 2016
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.

5 participants