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

Add a regression test for mutating a non-mut #[thread_local] #57107

Merged
merged 1 commit into from
Jan 19, 2019

Conversation

mjbshaw
Copy link
Contributor

@mjbshaw mjbshaw commented Dec 24, 2018

This should close #54901 since the regression has since been fixed.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 24, 2018
@nagisa
Copy link
Member

nagisa commented Dec 25, 2018

Two things before this can land:

  1. This should be an ui test instead;
  2. I believe it is valid, and even preferred, to not have the license header anymore.

@mjbshaw
Copy link
Contributor Author

mjbshaw commented Dec 25, 2018

Thanks, @nagisa. I have fixed and amended the commit.

@nagisa
Copy link
Member

nagisa commented Dec 25, 2018

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 25, 2018

📌 Commit 458a5a85164aa5bbc54a0811a7ee5a0a8ebc22a9 has been approved by nagisa

@bors
Copy link
Contributor

bors commented Dec 25, 2018

🌲 The tree is currently closed for pull requests below priority 500, this pull request will be tested once the tree is reopened

@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 Dec 25, 2018
@bors
Copy link
Contributor

bors commented Dec 27, 2018

⌛ Testing commit 458a5a85164aa5bbc54a0811a7ee5a0a8ebc22a9 with merge f4016cd3d553d5d37477de1dc7696ca20a1082ea...

@bors
Copy link
Contributor

bors commented Dec 27, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 27, 2018
@rust-highfive
Copy link
Collaborator

The job dist-i686-freebsd of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
Building stage2 tool cargo (i686-unknown-freebsd)
[01:12:12]  Downloading crates ...
[01:12:32] warning: spurious network error (2 tries remaining): [6] Couldn't resolve host name (Could not resolve host: crates.io)
[01:12:52] warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Could not resolve host: crates.io)
[01:13:12] error: failed to download from `https://crates.io/api/v1/crates/openssl-src/111.1.0+1.1.1a/download`
[01:13:12] Caused by:
[01:13:12]   [6] Couldn't resolve host name (Could not resolve host: crates.io)
[01:13:12] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "i686-unknown-freebsd" "-j" "4" "--release" "--locked" "--color" "always" "--manifest-path" "/checkout/src/tools/cargo/Cargo.toml" "--features" "rustc-workspace-hack/all-static" "--message-format" "json"
[01:13:12] expected success, got: exit code: 101
---
travis_time:end:108d13b0:start=1545893253224258916,finish=1545893253232488449,duration=8229533
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:04359fb4
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:35e0dfa0
travis_time:start:35e0dfa0
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:00766830
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@kennytm
Copy link
Member

kennytm commented Dec 27, 2018

@bors retry

@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 Dec 27, 2018
@bors
Copy link
Contributor

bors commented Dec 28, 2018

⌛ Testing commit 458a5a85164aa5bbc54a0811a7ee5a0a8ebc22a9 with merge 7a79e0333d3b3f05c318e43dee2df1da798d0745...

@bors
Copy link
Contributor

bors commented Dec 28, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 28, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-nopt of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[01:22:10] 
[01:22:10] ---- [ui (nll)] ui/thread-local-mutation.rs stdout ----
[01:22:10] diff of stderr:
[01:22:10] 
[01:22:10] - error[E0594]: cannot assign to immutable thread-local static item
[01:22:10] + error[E0594]: cannot assign to immutable static item `S`
[01:22:10] 3    |
[01:22:10] 3    |
[01:22:10] 4 LL |     S = "after"; //~ ERROR cannot assign to immutable thread-local static item
[01:22:10] -    |     ^^^^^^^^^^^
[01:22:10] +    |     ^^^^^^^^^^^ cannot assign
[01:22:10] 6 
[01:22:10] 7 error: aborting due to previous error
[01:22:10] 7 error: aborting due to previous error
[01:22:10] 8 
[01:22:10] 
[01:22:10] 
[01:22:10] The actual stderr differed from the expected stderr.
[01:22:10] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thread-local-mutation.nll/thread-local-mutation.nll.stderr
[01:22:10] To update references, rerun the tests and pass the `--bless` flag
[01:22:10] To only update this specific test, also pass `--test-args thread-local-mutation.rs`
[01:22:10] error: 1 errors occurred comparing output.
[01:22:10] status: exit code: 1
[01:22:10] status: exit code: 1
[01:22:10] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/thread-local-mutation.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thread-local-mutation.nll/a" "-Zborrowck=migrate" "-Ztwo-phase-borrows" "-Crpath" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thread-local-mutation.nll/auxiliary" "-A" "unused"
[01:22:10] ------------------------------------------
[01:22:10] 
[01:22:10] ------------------------------------------
[01:22:10] stderr:
[01:22:10] stderr:
[01:22:10] ------------------------------------------
[01:22:10] {"message":"cannot assign to immutable static item `S`","code":{"code":"E0594","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/thread-local-mutation.rs","byte_start":290,"byte_end":301,"line_start":11,"line_end":11,"column_start":5,"column_end":16,"is_primary":true,"text":[{"text":"    S = \"after\"; //~ ERROR cannot assign to immutable thread-local static item","highlight_start":5,"highlight_end":16}],"label":"cannot assign","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0594]: cannot assign to immutable static item `S`\n  --> /checkout/src/test/ui/thread-local-mutation.rs:11:5\n   |\nLL |     S = \"after\"; //~ ERROR cannot assign to immutable thread-local static item\n   |     ^^^^^^^^^^^ cannot assign\n\n"}
[01:22:10] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[01:22:10] {"message":"For more information about this error, try `rustc --explain E0594`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0594`.\n"}
[01:22:10] ------------------------------------------
[01:22:10] 
[01:22:10] thread '[ui (nll)] ui/thread-local-mutation.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3245:9
[01:22:10] 
---
[01:22:10] 
[01:22:10] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:495:22
[01:22:10] 
[01:22:10] 
[01:22:10] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--host-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "8.0.0svn\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always" "--compare-mode" "nll"
[01:22:10] 
[01:22:10] 
[01:22:10] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:22:10] Build completed unsuccessfully in 0:07:20
[01:22:10] Build completed unsuccessfully in 0:07:20
[01:22:10] make: *** [check] Error 1
[01:22:10] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:170fff84
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Dec 28 10:53:38 UTC 2018
---
travis_time:end:08a2f860:start=1545994420344206932,finish=1545994420351602241,duration=7395309
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0621f912
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0a222176
travis_time:start:0a222176
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:14539e57
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@kennytm kennytm 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 Dec 28, 2018
@mjbshaw
Copy link
Contributor Author

mjbshaw commented Dec 29, 2018

I'm a bit confused by the diff here. Locally, (using rustc 1.33.0-nightly (60e825389 2018-12-28), which includes the parent of merge 7a79e03), rustc gives the output:

error[E0594]: cannot assign to immutable thread-local static item
  --> t.rs:11:5
   |
11 |     S = "after"; //~ ERROR cannot assign to immutable thread-local static item
   |     ^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0594`.

This is slightly different that what the test is emitting on Travis. I don't know why Travis is getting a different output.

@kennytm
Copy link
Member

kennytm commented Dec 29, 2018

@mjbshaw Try to enable NLL and check the error message?

@bors
Copy link
Contributor

bors commented Jan 15, 2019

📌 Commit f4ded5b has been approved by nikomatsakis

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 15, 2019
@nikomatsakis
Copy link
Contributor

@bors rollup

@nikomatsakis
Copy link
Contributor

@mjbshaw sorry to hear you were confused! We definitely need to improve the docs on the testing system. Seems like you got it setup right; in the future, the --bless switch may be useful. Alternatively, please feel free to hop on Zulip with any questions or just ping the reviewer (me, I guess =)

Centril added a commit to Centril/rust that referenced this pull request Jan 15, 2019
…tsakis

Add a regression test for mutating a non-mut #[thread_local]

This should close rust-lang#54901 since the regression has since been fixed.
bors added a commit that referenced this pull request Jan 16, 2019
Rollup of 6 pull requests

Successful merges:

 - #56884 (rustdoc: overhaul code block lexing errors)
 - #57065 (Optimize try_mark_green and eliminate the lock on dep node colors)
 - #57107 (Add a regression test for mutating a non-mut #[thread_local])
 - #57268 (Add a target option "merge-functions", and a corresponding -Z flag (works around #57356))
 - #57551 (resolve: Add a test for issue #57539)
 - #57598 (Add missing unpretty option help message)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Jan 17, 2019
…tsakis

Add a regression test for mutating a non-mut #[thread_local]

This should close rust-lang#54901 since the regression has since been fixed.
Centril added a commit to Centril/rust that referenced this pull request Jan 17, 2019
…tsakis

Add a regression test for mutating a non-mut #[thread_local]

This should close rust-lang#54901 since the regression has since been fixed.
Centril added a commit to Centril/rust that referenced this pull request Jan 17, 2019
…tsakis

Add a regression test for mutating a non-mut #[thread_local]

This should close rust-lang#54901 since the regression has since been fixed.
Centril added a commit to Centril/rust that referenced this pull request Jan 18, 2019
…tsakis

Add a regression test for mutating a non-mut #[thread_local]

This should close rust-lang#54901 since the regression has since been fixed.
Centril added a commit to Centril/rust that referenced this pull request Jan 18, 2019
…tsakis

Add a regression test for mutating a non-mut #[thread_local]

This should close rust-lang#54901 since the regression has since been fixed.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 18, 2019
…tsakis

Add a regression test for mutating a non-mut #[thread_local]

This should close rust-lang#54901 since the regression has since been fixed.
Centril added a commit to Centril/rust that referenced this pull request Jan 18, 2019
…tsakis

Add a regression test for mutating a non-mut #[thread_local]

This should close rust-lang#54901 since the regression has since been fixed.
bors added a commit that referenced this pull request Jan 18, 2019
Rollup of 11 pull requests

Successful merges:

 - #57107 (Add a regression test for mutating a non-mut #[thread_local])
 - #57132 (Document that `-C opt-level=0` implies `-C debug-assertions`.)
 - #57212 (docs(rustc): Link to the book's source in rustc)
 - #57302 (Fix unused_assignments false positive)
 - #57350 (Better error note on unimplemented Index trait for string)
 - #57635 (use structured macro and path resolve suggestions)
 - #57650 (librustc_metadata: Pass a default value when unwrapping a span)
 - #57657 (Add regression test to close #53787)
 - #57658 (Two HIR tweaks)
 - #57720 (Fix suggestions given mulitple bad lifetimes)
 - #57725 (Use structured suggestion to surround struct literal with parenthesis)

Failed merges:

r? @ghost
@bors bors merged commit f4ded5b into rust-lang:master Jan 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Write to #[thread_local] is not respected
7 participants