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

prepare for Intptrcast model #61781

Merged
merged 4 commits into from
Jun 17, 2019
Merged

prepare for Intptrcast model #61781

merged 4 commits into from
Jun 17, 2019

Conversation

pvdrz
Copy link
Contributor

@pvdrz pvdrz commented Jun 12, 2019

#61668 done right (I hope so). r? @RalfJung @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 12, 2019
@rust-highfive

This comment has been minimized.

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.

@RalfJung are you ok with us not nuking to_ptr and to_bits immediately? It would make the PR much more complex since we'd have to fiddle things through Allocation (in librustc where we don't know about the force* methods or InterpCX)

}
}

pub fn force_bits(&self, scalar: Scalar<M::PointerTag>) -> InterpResult<'tcx, u128> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this PR isn't going to full intptrcast in one step, but I think it should still use force_bits $somewhere. Maybe start with just

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll do these changes and add a commit :P

Copy link
Member

Choose a reason for hiding this comment

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

No please don't do anything on casts! That's just a red herring, people can still transmute stuff. We need to do conversion lazily, nor eagerly.

I thought we had discussed in detail where force_ptr is needed? Namely, the methods in "place.rs" and "operand.rs" that access memory. And then for force_bits, that would arise only inside Miri in the newest plan, in ptr_op.

Copy link
Member

Choose a reason for hiding this comment

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

Oh wait, that cast stuff is for non-ptr-sized casts. Hm. Okay we should eventually force_bits there.

But that should be properly deduplicated with the int-to-int cass, so I don't think that method is the right place. Maybe let's keep that one for later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

D: ok I haven't committed anything. What should I do next then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I've already substituted to_ptr by force_ptr in the last commit, if the bin_op change is going to happen in miri, are we done here?

Copy link
Member

Choose a reason for hiding this comment

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

Oh also force_bits shouldn't assume pointer size, that makes it rather inconvenient to use. It should take the size as argument, like to_bits does.

But it can assert that if the size is NOT pointer size, it will never see a pointer value.

I've already substituted to_ptr by force_ptr in the last commit

I hope you mean "carefully replaced in a few places", not "substituted everywhere with sed". ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hahaha, yeah I've just replaced them on the places with the @RalfJung approval seal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh sorry my bad, this was only about force_bits. I should learn to read. :(

I agree with the following two:

let n = n.to_bits(self.tcx.data_layout.pointer_size)?;

let val = val.to_bits(layout.size)?;

But this one makes no sense to change as it already panics if there are no bits there.

I'm going to do those changes then

Copy link
Contributor Author

@pvdrz pvdrz Jun 13, 2019

Choose a reason for hiding this comment

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

Oh also force_bits shouldn't assume pointer size, that makes it rather inconvenient to use. It should take the size as argument, like to_bits does.

I'm going to do this change before the other ones then and will do a couple commits in a few minutes

@RalfJung
Copy link
Member

are you ok with us not nuking to_ptr and to_bits immediately?

Absolutely, I didn't even necessarily expect them to be nuked at all.

@RalfJung RalfJung changed the title Intptrcast model prepare for Intptrcast model Jun 13, 2019
Copy link
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

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

LGTM. :) @oli-obk any objections?

@pvdrz
Copy link
Contributor Author

pvdrz commented Jun 14, 2019

I believe CI needs to be invoked again, or force bors to do the merge test

@RalfJung
Copy link
Member

Why that? Travis is green, and Azure can be ignored. ;)

@pvdrz
Copy link
Contributor Author

pvdrz commented Jun 14, 2019

Why that? Travis is green, and Azure can be ignored. ;)

I had the impression bors won't do its work until both CI pipelines are green

@oli-obk
Copy link
Contributor

oli-obk commented Jun 14, 2019

I had the impression bors won't do its work until both CI pipelines are green

bors will start even if all CI is red.

@pvdrz
Copy link
Contributor Author

pvdrz commented Jun 14, 2019

I had the impression bors won't do its work until both CI pipelines are green

bors will start even if all CI is red.

Man these bots like to live dangerously :P

@oli-obk
Copy link
Contributor

oli-obk commented Jun 14, 2019

@bors r+ go live dangerously

@bors
Copy link
Contributor

bors commented Jun 14, 2019

📌 Commit 212f233 has been approved by oli-obk

@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 Jun 14, 2019
Centril added a commit to Centril/rust that referenced this pull request Jun 14, 2019
…=oli-obk

prepare for Intptrcast model

rust-lang#61668 done right (I hope so). r? @RalfJung @oli-obk
Centril added a commit to Centril/rust that referenced this pull request Jun 14, 2019
…=oli-obk

prepare for Intptrcast model

rust-lang#61668 done right (I hope so). r? @RalfJung @oli-obk
Centril added a commit to Centril/rust that referenced this pull request Jun 16, 2019
…=oli-obk

prepare for Intptrcast model

rust-lang#61668 done right (I hope so). r? @RalfJung @oli-obk
@RalfJung
Copy link
Member

@bors r-

This seems to break Miri. And we should get at least one nightly with a working Miri, because currently the latest distributed Miri is broken.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 16, 2019
@pvdrz
Copy link
Contributor Author

pvdrz commented Jun 16, 2019

Ok problem fixed, miri tests are passing in local now

@RalfJung
Copy link
Member

Awesome!

@bors r=oli-obk,RalfJung

@bors
Copy link
Contributor

bors commented Jun 17, 2019

📌 Commit 1e38870 has been approved by oli-obk,RalfJung

@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 Jun 17, 2019
@bors
Copy link
Contributor

bors commented Jun 17, 2019

⌛ Testing commit 1e38870 with merge 4d5404b...

bors added a commit that referenced this pull request Jun 17, 2019
…lfJung

prepare for Intptrcast model

#61668 done right (I hope so). r? @RalfJung @oli-obk
@bors
Copy link
Contributor

bors commented Jun 17, 2019

💔 Test failed - checks-travis

@rust-highfive
Copy link
Collaborator

The job dist-x86_64-apple-alt 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.
wry
xmoto
zxing-cpp
==> Downloading https://homebrew.bintray.com/bottles/xz-5.2.4.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/e7/e7be50f4ee00e35887f3957263334eb3baba59e8c061919060f9259351be6880?__gda__=exp=1560776987~hmac=f5a0eb6bafb8280c0687aa7883ff7cebe733f12f5474bc3431b68a3a10d30374&response-content-disposition=attachment%3Bfilename%3D%22xz-5.2.4.high_sierra.bottle.tar.gz%22&response-content-type=application%2Fgzip&requestInfo=U2FsdGVkX1-fpewvHiK0gS5H8XIrZwr5DBdqsEQc-LiptDhDjIIYh2fpi3PjL5WvbQ4HUfwbRmCkxO0QiNs2JtlXeqV4pcPZ0PhpTHDw4d94m92W8RNCOXhbVq-VRJZS4AWvrRB_sdg6_p6lEaBSFA&response-X-Checksum-Sha1=32dc0b28e61f32b40c20e2993418aa8cb6e746d5&response-X-Checksum-Sha2=e7be50f4ee00e35887f3957263334eb3baba59e8c061919060f9259351be6880
🍺  /usr/local/Cellar/xz/5.2.4: 92 files, 1MB
==> `brew cleanup` has not been run in 30 days, running now...
Removing: /Users/travis/Library/Caches/Homebrew/boost-1.66.0.high_sierra.bottle.tar.gz... (84.6MB)
Removing: /Users/travis/Library/Caches/Homebrew/carthage-0.28.0.high_sierra.bottle.tar.gz... (8.3MB)
---
Pruned 0 symbolic links and 5 directories from /usr/local
==> Installing dependencies for swig: pcre
==> Installing swig dependency: pcre
==> Downloading https://homebrew.bintray.com/bottles/pcre-8.43.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/03/0389911a93a88efd4a69b52dea8ecb872fdb55bcfff45d2f7313be5f79730861?__gda__=exp=1560776999~hmac=8335a62405a58e2f985537e436a88a715905fbfeaf3c8883bf846719a5dff7b1&response-content-disposition=attachment%3Bfilename%3D%22pcre-8.43.high_sierra.bottle.tar.gz%22&response-content-type=application%2Fgzip&requestInfo=U2FsdGVkX18Qsmno3zxnWl1O2nk_XJ9bHKCCLwSfPeaK5L0w6ddJPMJ6XB3mXxVu9tX7bIgs4pUqSHo49ki-SZuOEmgPYBx4qJUezmlgnoXUalEpqebSgVU_F_-57aESrfarUaXZDDplz4ahpOFKww&response-X-Checksum-Sha1=c67d4b99bb245f0ea56b34118dd6325b06a7250c&response-X-Checksum-Sha2=0389911a93a88efd4a69b52dea8ecb872fdb55bcfff45d2f7313be5f79730861
🍺  /usr/local/Cellar/pcre/8.43: 204 files, 5.5MB
==> Installing swig
==> Downloading https://homebrew.bintray.com/bottles/swig-4.0.0.high_sierra.bottle.tar.gz
==> Downloading https://homebrew.bintray.com/bottles/swig-4.0.0.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/ae/aed79cb436b3a0ac5812c4085e3121ffd62866397b8c7eaa06815ed8ec1e22b7?__gda__=exp=1560777002~hmac=a9ecf974f9c74c125a4633d9a1f3dfc192d7b405425f6978d6791b0d0c74e878&response-content-disposition=attachment%3Bfilename%3D%22swig-4.0.0.high_sierra.bottle.tar.gz%22&response-content-type=application%2Fgzip&requestInfo=U2FsdGVkX1-6-wmxVnWn-4IzKOjDx2j1kOanyPqDn6gNeqzVh9tfhhDzCX_kLLjyooorwdOCdQiJl1jAjvIZw5LDfBjkD7x2IA2H5tUaHjH1y9-eIps0iWqOuxRej0gjHKTLCCDTNbjxPR7wmf6fzA&response-X-Checksum-Sha1=a9c428aee4337d91061a69c02d7ae508b627d03f&response-X-Checksum-Sha2=aed79cb436b3a0ac5812c4085e3121ffd62866397b8c7eaa06815ed8ec1e22b7
🍺  /usr/local/Cellar/swig/4.0.0: 722 files, 5.4MB
travis_time:end:11556a98:start=1560775909732083000,finish=1560776322479357000,duration=412747274000
travis_fold:end:install
travis_fold:start:before_script.1
---
[00:01:50]    Compiling serde_derive v1.0.81
[00:02:17]    Compiling toml v0.4.10
[00:02:17]    Compiling serde_json v1.0.33
[00:02:22]    Compiling bootstrap v0.0.0 (/Users/travis/build/rust-lang/rust/src/bootstrap)
No output has been received in the last 30m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build 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. (Feature Requests)

@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 Jun 17, 2019
@oli-obk
Copy link
Contributor

oli-obk commented Jun 17, 2019

@bors retry timeout

@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 Jun 17, 2019
@bors
Copy link
Contributor

bors commented Jun 17, 2019

⌛ Testing commit 1e38870 with merge b25ee64...

bors added a commit that referenced this pull request Jun 17, 2019
…lfJung

prepare for Intptrcast model

#61668 done right (I hope so). r? @RalfJung @oli-obk
@bors
Copy link
Contributor

bors commented Jun 17, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk,RalfJung
Pushing b25ee64 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 17, 2019
@bors bors merged commit 1e38870 into rust-lang:master Jun 17, 2019
@pvdrz pvdrz deleted the intptrcast-model branch June 17, 2019 20:59
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.

5 participants