-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Segfault during tests on rust 1.27.x on macOS (SIGSEGV: invalid memory reference) #52390
Comments
I can't reproduce on macOS or Ubuntu; what version of macOS do you have? Can you get a backtrace on the segfault? Is the segfault persistent, or is it transient? |
I am on OS X 10.11.6. Running |
You'll need to run with something like lldb or gdb to get the segfault or look for a core dump (I believe those are generated on macOS, though you may need to do something to get them). I am testing on 10.13.5 so this is possibly related to #51828, though that claims to only be a problem on 10.10. |
Could you run |
I do get repeated assertion failures in makes_a_passphrase_with_special_char, but even those don't happen on every run. |
Running in lldb I get:
Edit note: running multiple times gets to the very same failure. |
@Mark-Simulacrum Regarding this, I think it is due to the test itself lacking for a check. If the special char is a digit and inserted in a digit, it can match a dictionary word and the test fails. I have not yet figured how to write a better test to catch this. The problem seems to occur very early in the process, and in |
Can you run |
|
@Mark-Simulacrum Sorry for the delay, it was already late here in Europe. Follows a new run with its backtrace:
|
tagging as T-compiler under assumption that this is in our wheel house, at least until we seen evidence to the contrary |
If I can help in some way please let me know. |
@ejpcmac In the debugger when it crashed, could you execute |
@kennytm For sure. I’ll do it as soon as I’m home. |
@kennytm Here I am:
|
Thanks @ejpcmac! As the debugger error shows, the segfault is indeed caused by unaligned TLS access ( As mentioned in the issue there's no bug in 1.28-beta. We may workaround in 1.27 by forcing a diff --git a/src/libstd/thread/local.rs b/src/libstd/thread/local.rs
index a170abb262..79293acc2c 100644
--- a/src/libstd/thread/local.rs
+++ b/src/libstd/thread/local.rs
@@ -177,6 +177,7 @@ macro_rules! __thread_local_inner {
$crate::thread::__StaticLocalKeyInner::new();
#[thread_local]
+ #[cfg_attr(target_os = "macos", link_section = "__DATA,__thread_data")]
#[cfg(all(target_thread_local, not(target_arch = "wasm32")))]
static __KEY: $crate::thread::__FastLocalKeyInner<$t> =
$crate::thread::__FastLocalKeyInner::new(); ... but this won't affect other |
I don't think it's worth 1.27.3. We already decided that we're not going to backport the original TLS patch -- and 1.28 will be out in two weeks anyway. |
visiting for triage. I concur with @Mark-Simulacrum 's assessment. Only question is whether to close this bug today, or close it after 1.28 is released. |
Visiting in compiler team meeting. Inclination is to close now in favor of using 1.28 (released on Aug 2) |
Problem description
Running the tests for a program I’ve written leads to a segfault when compiled by Rust 1.27.0 or 1.27.1:
The tests work well on Rust
1.26.2
,1.28-beta.10
and today’s nightly. Only the1.27.x
releases seem impacted by this bug.Meta
Note that the debug and release binaries seem to work properly. Only the test runner seem to be impacted.
The text was updated successfully, but these errors were encountered: