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

SGX target: simplify usercall internals #58235

Merged
merged 1 commit into from Feb 13, 2019

Conversation

Projects
None yet
6 participants
@jethrogb
Copy link
Contributor

jethrogb commented Feb 6, 2019

This moves logic from assembly to Rust and removes the special case for exit/panic handling, merging it with regular usercall handling.

Also, this fixes a bug in the exit usercall introduced in a75ae00. The bug would make regular exits look like panics with high probability. It would also with some probability leak information through uncleared registers.

cc @VardhanThigle

r? @alexcrichton

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 6, 2019

The job x86_64-gnu-llvm-6.0 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.
travis_time:end:102dd250:start=1549472906374749143,finish=1549473004216121198,duration=97841372055
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---

[00:07:28] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:07:28] tidy error: /checkout/src/libstd/sys/sgx/abi/usercalls/raw.rs:26: line longer than 100 chars
[00:07:28] tidy error: /checkout/src/libstd/sys/sgx/abi/usercalls/raw.rs:173: line longer than 100 chars
[00:07:28] tidy error: /checkout/src/libstd/sys/sgx/abi/usercalls/raw.rs:189: line longer than 100 chars
[00:07:28] tidy error: /checkout/src/libstd/sys/sgx/abi/usercalls/raw.rs:205: line longer than 100 chars
[00:07:28] tidy error: /checkout/src/libstd/sys/sgx/abi/usercalls/raw.rs:220: line longer than 100 chars
[00:07:28] tidy error: /checkout/src/libstd/sys/sgx/abi/usercalls/raw.rs:234: line longer than 100 chars
[00:07:29] some tidy checks failed
[00:07:29] 
[00:07:29] 
[00:07:29] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:07:29] 
[00:07:29] 
[00:07:29] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:07:29] Build completed unsuccessfully in 0:00:46
[00:07:29] Build completed unsuccessfully in 0:00:46
[00:07:29] make: *** [tidy] Error 1
[00:07:29] Makefile:68: recipe for target 'tidy' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:00473384
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Feb  6 17:17:52 UTC 2019
---
travis_time:end:0e88b464:start=1549473473520725912,finish=1549473473525365568,duration=4639656
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:03d2cafd
$ 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:0566f070
travis_time:start:0566f070
$ 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:3b874afc
$ 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)

@jethrogb jethrogb force-pushed the jethrogb:jb/sgx-usercall-internals branch from d78d5c0 to a93b663 Feb 6, 2019

Jethro Beekman
SGX target: simplify usercall internals
This moves logic from assembly to Rust and removes the special
case for exit/panic handling, merging it with regular usercall
handling.

Also, this fixes a bug in the exit usercall introduced in a75ae00.
The bug would make regular exits look like panics with high
probability. It would also with some probability leak information
through uncleared registers.

@jethrogb jethrogb force-pushed the jethrogb:jb/sgx-usercall-internals branch from a93b663 to 0d2ab0b Feb 6, 2019

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Feb 7, 2019

@bors: r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 7, 2019

📌 Commit 0d2ab0b has been approved by alexcrichton

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Feb 13, 2019

Adding space for rollup, @bors p=1

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 13, 2019

⌛️ Testing commit 0d2ab0b with merge f3fb1b1...

bors added a commit that referenced this pull request Feb 13, 2019

Auto merge of #58235 - jethrogb:jb/sgx-usercall-internals, r=alexcric…
…hton

SGX target: simplify usercall internals

This moves logic from assembly to Rust and removes the special case for exit/panic handling, merging it with regular usercall handling.

Also, this fixes a bug in the exit usercall introduced in a75ae00. The bug would make regular exits look like panics with high probability. It would also with some probability leak information through uncleared registers.

cc @VardhanThigle

r? @alexcrichton
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 13, 2019

💔 Test failed - checks-travis

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Feb 13, 2019

The job arm-android 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:42:06] test string::test_str_clear ... ok
[01:42:06] test string::test_str_truncate_invalid_len ... ok
[01:42:06] test string::test_str_truncate ... ok
[01:42:06] test string::test_str_truncate_split_codepoint ... ok
[01:42:06] died due to signal 11
[01:42:06] 
[01:42:06] 
[01:42:06] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "arm-linux-androideabi" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "alloc" "--"
[01:42:06] expected success, got: exit code: 3
---
travis_time:end:09637c74:start=1550034732702458711,finish=1550034732712632745,duration=10174034
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:277fc860
$ 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:027cd0d8
travis_time:start:027cd0d8
$ 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:0f5c2305
$ 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)

@jethrogb

This comment has been minimized.

Copy link
Contributor Author

jethrogb commented Feb 13, 2019

Looks like #55861

@kennytm

This comment has been minimized.

Copy link
Member

kennytm commented Feb 13, 2019

@bors retry

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 13, 2019

⌛️ Testing commit 0d2ab0b with merge ccd23b9...

bors added a commit that referenced this pull request Feb 13, 2019

Auto merge of #58235 - jethrogb:jb/sgx-usercall-internals, r=alexcric…
…hton

SGX target: simplify usercall internals

This moves logic from assembly to Rust and removes the special case for exit/panic handling, merging it with regular usercall handling.

Also, this fixes a bug in the exit usercall introduced in a75ae00. The bug would make regular exits look like panics with high probability. It would also with some probability leak information through uncleared registers.

cc @VardhanThigle

r? @alexcrichton
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Feb 13, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: alexcrichton
Pushing ccd23b9 to master...

@bors bors added the merged-by-bors label Feb 13, 2019

@bors bors merged commit 0d2ab0b into rust-lang:master Feb 13, 2019

1 check passed

homu Test successful
Details

@bors bors referenced this pull request Feb 13, 2019

Open

libstd => 2018 #58208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment