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

Make runtime and trap errors well defined #1401

Merged
merged 9 commits into from
Apr 28, 2020

Conversation

MarkMcCaskey
Copy link
Contributor

@MarkMcCaskey MarkMcCaskey commented Apr 23, 2020

Resolves #1328

This PR goes through and gives explicit types for all the errors instead of using Box<dyn Any + Send> where possible. This gives users better insight into what the specific errors are and should help with debugging in the case of mistakes in our code.

The remaining uses of Box<dyn Any> are due to the structure of our dependency graph -- this is probably solvable but it seems fine as is as all error types are now explicit and the remaining Box<dyn Any>s are either fully user controlled or not for end-user consumption.

Review

  • Add a short description of the the change to the CHANGELOG.md file

@MarkMcCaskey MarkMcCaskey added 📦 lib-compiler-cranelift About wasmer-compiler-cranelift 📦 lib-deprecated About the deprecated crates labels Apr 23, 2020
@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Apr 24, 2020
@bors
Copy link
Contributor

bors bot commented Apr 24, 2020

try

Build failed:

  • wasmerio.wasmer

@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Apr 24, 2020
@MarkMcCaskey
Copy link
Contributor Author

bors try-

@MarkMcCaskey MarkMcCaskey force-pushed the feature/runtime-errors-and-traps-are-well-defined branch from 197f2f8 to ae40d05 Compare April 24, 2020 21:32
@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Apr 24, 2020
@MarkMcCaskey MarkMcCaskey force-pushed the feature/runtime-errors-and-traps-are-well-defined branch from ae40d05 to 9723270 Compare April 24, 2020 21:55
@MarkMcCaskey
Copy link
Contributor Author

bors try-

@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Apr 24, 2020
@bors
Copy link
Contributor

bors bot commented Apr 24, 2020

try

Build failed:

@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Apr 26, 2020
@bors
Copy link
Contributor

bors bot commented Apr 26, 2020

try

Build failed:

@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Apr 27, 2020
@MarkMcCaskey
Copy link
Contributor Author

bors try-

@MarkMcCaskey MarkMcCaskey marked this pull request as ready for review April 27, 2020 20:33
@MarkMcCaskey MarkMcCaskey requested a review from Hywan as a code owner April 27, 2020 20:33
@MarkMcCaskey MarkMcCaskey force-pushed the feature/runtime-errors-and-traps-are-well-defined branch from e1eac95 to d0cd9d5 Compare April 27, 2020 21:01
@MarkMcCaskey
Copy link
Contributor Author

bors try-

@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Apr 27, 2020
@MarkMcCaskey MarkMcCaskey force-pushed the feature/runtime-errors-and-traps-are-well-defined branch from d0cd9d5 to 72196ee Compare April 27, 2020 21:35
@MarkMcCaskey
Copy link
Contributor Author

bors try-

@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Apr 27, 2020
@bors
Copy link
Contributor

bors bot commented Apr 27, 2020

try

Build failed:

@MarkMcCaskey MarkMcCaskey force-pushed the feature/runtime-errors-and-traps-are-well-defined branch from 72196ee to 74ddc8e Compare April 27, 2020 21:59
@MarkMcCaskey
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Apr 27, 2020
@MarkMcCaskey MarkMcCaskey changed the title Make runtime and trap errors well defined (WIP) Make runtime and trap errors well defined Apr 27, 2020
@bors
Copy link
Contributor

bors bot commented Apr 27, 2020

try

Build succeeded:

@MarkMcCaskey MarkMcCaskey added 📦 lib-compiler-llvm About wasmer-compiler-llvm 📦 lib-compiler-singlepass About wasmer-compiler-singlepass labels Apr 27, 2020
CHANGELOG.md Outdated Show resolved Hide resolved
examples/callback-guest/callback-guest.rs Outdated Show resolved Hide resolved
lib/clif-backend/src/signal/mod.rs Outdated Show resolved Hide resolved
lib/clif-backend/src/signal/windows.rs Outdated Show resolved Hide resolved
lib/llvm-backend/cpp/object_loader.hh Outdated Show resolved Hide resolved
lib/runtime-core/src/error.rs Outdated Show resolved Hide resolved
lib/runtime-core/src/error.rs Outdated Show resolved Hide resolved
nearprotocol-bulldozer bot pushed a commit to near/nearcore that referenced this pull request Apr 28, 2020
Due to wasmerio/wasmer#1409 we need to rollback Wasmer to older version. I am replacing some of Wasmer generated error with Unknown to avoid undoing too much code from this PR: #2505

After the following PR lands wasmerio/wasmer#1401 we would need to revisit error handling from Wasmer anyway. CC @fckt  

### Testing

Ran near-evm test. CI passes.
@syrusakbary
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Apr 28, 2020
1401: Make runtime and trap errors well defined r=syrusakbary a=MarkMcCaskey

Resolves #1328 

This PR goes through and gives explicit types for all the errors instead of using `Box<dyn Any + Send>` where possible.  This gives users better insight into what the specific errors are and should help with debugging in the case of mistakes in our code.

The remaining uses of `Box<dyn Any>` are due to the structure of our dependency graph -- this is probably solvable but it seems fine as is as all error types are now explicit and the remaining `Box<dyn Any>`s are either fully user controlled or not for end-user consumption.

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Mark McCaskey <[email protected]>
@bors
Copy link
Contributor

bors bot commented Apr 28, 2020

Build failed:

  • wasmerio.wasmer

@syrusakbary
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Apr 28, 2020

Build succeeded:

  • wasmerio.wasmer

@bors bors bot merged commit d23a3f3 into master Apr 28, 2020
@bors bors bot deleted the feature/runtime-errors-and-traps-are-well-defined branch April 28, 2020 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 lib-compiler-cranelift About wasmer-compiler-cranelift 📦 lib-compiler-llvm About wasmer-compiler-llvm 📦 lib-compiler-singlepass About wasmer-compiler-singlepass 📦 lib-deprecated About the deprecated crates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RuntimeError is not always downcastable to the host error
3 participants