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

disable tls with Box::leak test on solaris/illumos. #3675

Closed
wants to merge 1 commit into from

Conversation

devnexen
Copy link
Contributor

on these platforms, thread_local is disabled as there is no support for cleanup callback, the test is leaking here.

@saethlin
Copy link
Member

Instead of ignoring the test on the target, can you add -Zmiri-ignore-leaks using the revisions system such as done in this test:

//@revisions: default uniq
//@compile-flags: -Zmiri-tree-borrows
//@[uniq]compile-flags: -Zmiri-unique-is-unique

@saethlin
Copy link
Member

I think you need multiple revisions as in the example. Does the test now fail on Linux if you add a leak to it?

on these platforms, thread_local is disabled as there is no support for cleanup callback, the test is leaking here.
@RalfJung
Copy link
Member

RalfJung commented Jun 16, 2024

I don't see why this test should be ignored on Solarish. It shows that we are not properly recognizing main thread TLS variables as being allowed-to-leak -- that should be fixed, not ignored. There is no cleanup callback called here on any platform, since Cell<Option<&'static i32>> has no destructor -- that's the entire point.

@RalfJung
Copy link
Member

RalfJung commented Jun 17, 2024

Also, other tests like tls_macro_drop and tls_static work fine. "on these platforms, thread_local is disabled" does not seem to be correct. The cleanup callback is called when it is needed. So I don't follow your PR description either.

@RalfJung RalfJung added the S-waiting-on-author Status: Waiting for the PR author to address review comments label Jun 29, 2024
@RalfJung
Copy link
Member

@devnexen what are your plans for this PR?

Looking at the test, what happens here is that the logic for ignoring memory leaks in the main thread TLS state does not work on Solarish. We already have ignore-target-windows, so adding more ignore-target with an explanation for why they are ignored seems fine. I realize that's what you did originally, but you didn't explain to us why you did what we did so we weren't able to give you proper advice. I now spent the effort of digging into the problem myself, but often I won't have the time for that and we rely on contributors to explain to us what it is they are doing and why.

So to move this forward, please update not only the patch but also the PR description. The explanation for why we want to ignore some targets is: thread_local! doesn't use #[thread_local] statics on these targets.

Also, if the goal of the PR is to make more tests pass on Solarish, please adjust ci.sh and add tls to the list of tests being run.

@RalfJung
Copy link
Member

Thinking about this some more, it's probably best if that test just checks cfg(target_thread_local) directly. That makes it then work on Solarish without any further changes. :)

I implemented that in #3822, so that supersedes this PR. Thanks for looking into this!

@RalfJung RalfJung closed this Aug 17, 2024
@devnexen
Copy link
Contributor Author

Thanks. Sorry I put it aside I no longer access my illumos VM at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: Waiting for the PR author to address review comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants