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

provide thread name to OS for Solarish systems #62309

Merged
merged 1 commit into from
Aug 2, 2019
Merged

Conversation

jlevon
Copy link
Contributor

@jlevon jlevon commented Jul 2, 2019

Fixes #62302

Passes a Linux bootstrap build. python x.py test src/tools/tidy happy.
I tested this with a small test binary that spawns a few threads, and verified
that:

  • on an illumos system lacking the libc function, the binary runs but no OS-level
    thread names are set
  • on an illumos system with the feature, the binary runs, and the thread names are
    visible and correct under tools like MDB, pstack, core dump, etc.

@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 @kennytm (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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 2, 2019
@Dylan-DPC-zz
Copy link

ping from triage @jlevon can you fix the license/copyright stuff? thanks

@Dylan-DPC-zz Dylan-DPC-zz added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 15, 2019
@jlevon
Copy link
Contributor Author

jlevon commented Jul 15, 2019

@Dylan-DPC I already answered there, that there is nothing to fix. The original commenter seems to have confused copyright with licensing. I marked the conversation as Resolved, perhaps that what you were waiting for?

@Mark-Simulacrum
Copy link
Member

We prefer to keep the tree without Copyright markers for anyone/any organization; I am not a lawyer so I can't personally say whether the copyright marker you've left is separate from licensing or such (I definitely see your point, though!). Is it possible for you to remove the "Copyright" header on that file?

@jlevon
Copy link
Contributor Author

jlevon commented Jul 15, 2019

Hi Mark, is that policy written up somewhere? As I already mentioned, COPYRIGHT explicitly mentions files may contain Copyright markers, and I couldn't find any other mention. Is there some specific issue with the above?

Joyent corporate policy requires a copyright notice to present (see https://github.com/joyent/rfd/blob/master/rfd/0164/README.md for details). This is presumably for legal reasons way beyond my ken as just another engineer.

@papertigers
Copy link

@Mark-Simulacrum does @jlevon's response clear things up? Would love to see this merged as setting thread names on illumos is currently a no-op, and having them would help with debugging.

@Mark-Simulacrum
Copy link
Member

Ah, missed that previous comment. I'm not sure if the policy is specifically recorded anywhere, and suspect that it probably isn't. I'm going to somewhat blindly r? @alexcrichton who I believe might have better answers for what we can/can't do here, or at least know who to ask.

@alexcrichton
Copy link
Member

Thanks for the cc here. I won't really pretend I know how best to handle this myself, but @jlevon there's probably two ways to go about this. One is as been mentioned it'll be easiest if you're ok removing the comment and we can r+/merge. That follows the pattern of all the other PRs we receive, so it's easy to put in the "yep this is fine" bucket. The other strategy is that if you'd prefer this is left in we'll probably need to double check with someone (probably lawyers of some form). The "most accessible" ones we know of are from Mozilla, and they often take months to get back to us on issues like this.

From my perspective it'd be great if we could make this as standard as other PRs are, but if you'd like I can try to set things in motion to get a consulation on the legal side of things to see what the implications of a comment are like this for us and how we'd handle it. This isn't a situation we've encountered in rust-lang/rust before (contributors asking to place license headers in files they modify) AFAIK and may take some time to navigate.

In any case I leave it up to you to let me know how you'd like to proceed!

@jlevon
Copy link
Contributor Author

jlevon commented Jul 25, 2019

Thanks for the reply Alex. FWIW it's a copyright notice not a license header - very different things. Of course I can understand you might want to check with someone knowledgeable on the legal side, so please do so.

This is our corporate policy as I mentioned, as an individual contributor I have no control over this. However, I will also re-raise this issue internally and report back.

@alexcrichton
Copy link
Member

Ah sorry yeah my legalese is very imprecise and flat out wrong most of the time. The main point I wanted to convey is that this sort of comment in a PR to rust-lang/rust is something that's nonstandard for us and we do not have a process in place for handling it. It'd be easiest if this could be removed but if it can't it'll likely just block this from landing for a significant amount of time, and I'd hate to prevent improvements from happening sooner!

@jlevon
Copy link
Contributor Author

jlevon commented Jul 25, 2019

Yep, understood, thanks.

@hdhoang
Copy link
Contributor

hdhoang commented Aug 2, 2019

ping from triage @jlevon, any updates on this?

@jlevon
Copy link
Contributor Author

jlevon commented Aug 2, 2019

Yes, good news, we have permission to drop the Copyright attribution lines for Rust repositories.

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 2, 2019
#[cfg(target_os = "solaris")]
pub fn set_name(name: &CStr) {
weak! {
fn pthread_setname_np(
Copy link
Contributor

Choose a reason for hiding this comment

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

We could use oneline:

fn pthread_setname_np(libc::pthread_t, *const libc::c_char) -> libc::c_int

@alexcrichton
Copy link
Member

@bors: r+

Ok thanks for checking on your end @jlevon!

@bors
Copy link
Contributor

bors commented Aug 2, 2019

📌 Commit 6be2d9a has been approved by alexcrichton

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 2, 2019
@bors
Copy link
Contributor

bors commented Aug 2, 2019

⌛ Testing commit 6be2d9a with merge b0e40bf...

bors added a commit that referenced this pull request Aug 2, 2019
provide thread name to OS for Solarish systems

Fixes #62302

Passes a Linux bootstrap build. python x.py test src/tools/tidy happy.
I tested this with a small test binary that spawns a few threads, and verified
that:

 - on an illumos system lacking the libc function, the binary runs but no OS-level
    thread names are set
 - on an illumos system with the feature, the binary runs, and the thread names are
    visible and correct under tools like MDB, pstack, core dump, etc.
@bors
Copy link
Contributor

bors commented Aug 2, 2019

☀️ Test successful - checks-azure
Approved by: alexcrichton
Pushing b0e40bf to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide thread name to OS for Solarish systems