You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@teaclave.apache.org by GitBox <gi...@apache.org> on 2022/02/03 08:46:11 UTC

[GitHub] [incubator-teaclave] qinkunbao opened a new pull request #608: update WAMR

qinkunbao opened a new pull request #608:
URL: https://github.com/apache/incubator-teaclave/pull/608


   ## Description
   
   1. Update WAMR dependencies.
   2. Remove assert and unwrap.
   
   ## Type of change (select or add applied and delete the others)
   
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [ ] API change with a documentation update
   - [ ] Additional test coverage
   - [ ] Code cleanup or just sync with upstream third-party crates
   
   ## How has this been tested?
   
   ## Checklist
   
   - [x] Fork the repo and create your branch from `master`.
   - [x] If you've added code that should be tested, add tests.
   - [x] If you've changed APIs, update the documentation.
   - [x] Ensure the tests pass (see CI results).
   - [x] Make sure your code lints/format.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] dingelish commented on a change in pull request #608: update WAMR

Posted by GitBox <gi...@apache.org>.
dingelish commented on a change in pull request #608:
URL: https://github.com/apache/incubator-teaclave/pull/608#discussion_r798854144



##########
File path: executor/src/wamr.rs
##########
@@ -100,6 +101,19 @@ extern "C" {
 #[derive(Default)]
 pub struct WAMicroRuntime;
 
+macro_rules! early_terminate {
+    ($cond:expr, $msg:expr, $func:block) => {
+        if !($cond) {
+            reset_thread_context()?;
+            #[allow(unused_unsafe)]

Review comment:
       consider removal. after this pr, `wasm_runtime_***` will looks like "safe" if it's wrapped in early_terminate




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] mssun commented on pull request #608: update WAMR

Posted by GitBox <gi...@apache.org>.
mssun commented on pull request #608:
URL: https://github.com/apache/incubator-teaclave/pull/608#issuecomment-1051250737


   This PR becomes stale. Closing.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] qinkunbao commented on pull request #608: update WAMR

Posted by GitBox <gi...@apache.org>.
qinkunbao commented on pull request #608:
URL: https://github.com/apache/incubator-teaclave/pull/608#issuecomment-1029456173


   > I suggest to wrap C APIs into a struct and use `new` and `drop` for resource management.
   
   Sounds good! Will do.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] mssun closed pull request #608: update WAMR

Posted by GitBox <gi...@apache.org>.
mssun closed pull request #608:
URL: https://github.com/apache/incubator-teaclave/pull/608


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] mssun commented on pull request #608: update WAMR

Posted by GitBox <gi...@apache.org>.
mssun commented on pull request #608:
URL: https://github.com/apache/incubator-teaclave/pull/608#issuecomment-1029454074


   I suggest to wrap C APIs into a struct and use `new` and `drop` for resource management.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org


[GitHub] [incubator-teaclave] bigdata-memory commented on a change in pull request #608: update WAMR

Posted by GitBox <gi...@apache.org>.
bigdata-memory commented on a change in pull request #608:
URL: https://github.com/apache/incubator-teaclave/pull/608#discussion_r799717288



##########
File path: executor/src/wamr.rs
##########
@@ -191,17 +213,33 @@ impl TeaclaveExecutor for WAMicroRuntime {
                 std::ptr::null(),
             )
         };
-        assert!((entry_func as usize) != 0);
+        early_terminate!(
+            (entry_func as usize) != 0,
+            "wasm_runtime_lookup_function failed",
+            {
+                wasm_runtime_deinstantiate(module_instance);
+                wasm_runtime_unload(module);
+                wasm_runtime_destroy();
+            }
+        );
 
         let exec_env = unsafe { wasm_runtime_create_exec_env(module_instance, DEFAULT_STACK_SIZE) };
-        assert!((exec_env as usize) != 0);
+        early_terminate!(
+            (exec_env as usize) != 0,
+            "wasm_runtime_create_exec_env failed",
+            {
+                wasm_runtime_deinstantiate(module_instance);
+                wasm_runtime_unload(module);

Review comment:
       Looks like this block of code can be further abstracted away w.r.t. DRY.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@teaclave.apache.org
For additional commands, e-mail: notifications-help@teaclave.apache.org