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 miri Discriminant() for non-ADT #49540

Merged
merged 1 commit into from
Apr 5, 2018

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Mar 31, 2018

Fixes #49327

}
layout::Variants::Tagged { ref variants, .. } |
layout::Variants::NicheFilling { ref variants, .. } => {
if variants.get(discr_val as usize).is_none() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Discriminants and variant indices don't match. You also need to adjust read_discriminant_value to return the variant index (so a usize) and adjust all calls to it to stop doing weird magic. In case of tagged encoding you always need to iterate like the old code did, but we should be doing so inside read_discriminant_value

Copy link
Member Author

Choose a reason for hiding this comment

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

I just noticed it too

@bjorn3 bjorn3 changed the title Fix miri Discriminant() for non-ADT [WIP] Fix miri Discriminant() for non-ADT Mar 31, 2018
@TimNN
Copy link
Contributor

TimNN commented Mar 31, 2018

Your PR failed on Travis. 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.
Resolving deltas: 100% (613923/613923), completed with 4858 local objects.
---
[00:00:42] configure: rust.quiet-tests     := True
---
[00:35:49] .........................................................................i..........................
[00:35:55] ................iF..................................................................................
---
[00:36:29] ............................................................................................i.......
[00:36:35] ................................................................i...................................
---
[00:36:56] Makefile:58: recipe for target 'check' failed
[00:36:56] make: *** [check] Error 1
---
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:090e6c4d:start=1522517618136701569,finish=1522517618143477157,duration=6775588
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0112bb8b
$ dmesg | grep -i kill
[   10.604492] init: failsafe main process (1095) killed by TERM signal

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.

Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

Just a nit.

Also please squash the commits down to a single one

layout::Variants::Tagged { ref discr, .. } => {
if let ty::TyAdt(adt_def, _) = ty.sty {
let raw_discr = raw_discr.to_bytes()?;
println!("Read discriminant {}, valid discriminants {:?}", raw_discr, adt_def.discriminants(*self.tcx).collect::<Vec<_>>());
Copy link
Contributor

Choose a reason for hiding this comment

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

change this to a trace! call

@bjorn3 bjorn3 changed the title [WIP] Fix miri Discriminant() for non-ADT Fix miri Discriminant() for non-ADT Apr 1, 2018
@bjorn3
Copy link
Member Author

bjorn3 commented Apr 1, 2018

This is ready. Locally I have one miri run-pass test failing with a different error 🎊

@oli-obk
Copy link
Contributor

oli-obk commented Apr 1, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Apr 1, 2018

📌 Commit 7a28ffc has been approved by oli-obk

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 1, 2018
@bors
Copy link
Contributor

bors commented Apr 1, 2018

⌛ Testing commit 7a28ffc with merge 7586c9471cb9f02357aa9cde09a92363205daa77...

@bors
Copy link
Contributor

bors commented Apr 1, 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 Apr 1, 2018
@TimNN
Copy link
Contributor

TimNN commented Apr 1, 2018

Your PR failed on Travis. 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.
The job exceeded the maximum time limit for jobs, and has been terminated.

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.

1 similar comment
@TimNN
Copy link
Contributor

TimNN commented Apr 1, 2018

Your PR failed on Travis. 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.
The job exceeded the maximum time limit for jobs, and has been terminated.

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.

@petrochenkov petrochenkov assigned oli-obk and unassigned petrochenkov Apr 1, 2018
@bjorn3
Copy link
Member Author

bjorn3 commented Apr 3, 2018

ping @oli-obk test timeout

@oli-obk
Copy link
Contributor

oli-obk commented Apr 3, 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 Apr 3, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Apr 4, 2018
bors added a commit that referenced this pull request Apr 4, 2018
Rollup of 25 pull requests

Successful merges:

 - #49179 (Handle future deprecation annotations )
 - #49512 (Add support for variant and types fields for intra links)
 - #49515 (fix targetted value background)
 - #49516 (Add missing anchor for union type fields)
 - #49532 (Add test for rustdoc ignore test)
 - #49533 (Add #[must_use] to a few standard library methods)
 - #49540 (Fix miri Discriminant() for non-ADT)
 - #49559 (Introduce Vec::resize_with method (see #41758))
 - #49570 (avoid IdxSets containing garbage above the universe length)
 - #49577 (Stabilize String::replace_range)
 - #49599 (Fix typo)
 - #49603 (Fix url for intra link provided method)
 - #49607 (Stabilize iterator methods in 1.27)
 - #49609 (run-pass/attr-stmt-expr: expand test cases)
 - #49612 (Fix "since" version for getpid feature.)
 - #49618 (Fix build error when compiling libcore for 16bit targets)
 - #49619 (tweak core::fmt docs)
 - #49637 (Stabilize parent_id())
 - #49639 (Update Cargo)
 - #49628 (Re-write the documentation index)
 - #49594 (Add some performance guidance to std::fs and std::io docs)
 - #49625 (miri: add public alloc_kind accessor)
 - #49634 (Add a test for the fix to issue #43058)
 - #49641 (Regression test for #46314)
 - #49547 (Unignore borrowck test)

Failed merges:
@alexcrichton alexcrichton merged commit 7a28ffc into rust-lang:master Apr 5, 2018
@bjorn3 bjorn3 deleted the fix_miri_discriminant branch April 5, 2018 17:46
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.

6 participants