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

Update exec to align with POSIX standard #93

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

Yaxuan-w
Copy link
Member

@Yaxuan-w Yaxuan-w commented Nov 16, 2024

Description

Fixes #33

To facilitate discussions around implementation details. Feedback and suggestions are welcome to refine the approach.

To fully implement the exec functionality while aligning with POSIX standards.

In our implementation, WASM is responsible for handling functionalities such as loading and executing the new program, preserving process attributes, and resetting memory and the stack. In RawPOSIX, the focus is on memory management inheritance and resource cleanup and release. Specifically, RawPOSIX handles tasks such as clearing memory mappings, resetting shared memory, managing file descriptors (closing or inheriting them based on the should_cloexec flag in fdtable), resetting semaphores, and managing process attributes and threads (terminating unnecessary threads).

Type of change

  • 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)
  • This change requires a documentation update

How Has This Been Tested?

NEED TEST

Checklist:

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been added to a pull request and/or merged in other modules (native-client, lind-glibc, lind-project)

@@ -222,8 +238,9 @@ impl Cage {
// newsigset.insert(0, mainsigset);
}

// Update status
let newcage = Cage {
Copy link
Contributor

Choose a reason for hiding this comment

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

we can talk a bit more about this on Monday but I believe that we don't need to create a new cage struct here, the old one should be sufficient

@qianxichen233
Copy link
Contributor

Have you changed the test for exec, or any other place that used exec_syscall? Since the function signature of exec_syscall is changed (from taking one argument to taking no argument), then for example, ut_lind_exec under sys_tests.rs should be updated to use exec_syscall with no argument provided.

@Yaxuan-w
Copy link
Member Author

Have you changed the test for exec, or any other place that used exec_syscall? Since the function signature of exec_syscall is changed (from taking one argument to taking no argument), then for example, ut_lind_exec under sys_tests.rs should be updated to use exec_syscall with no argument provided.

The implementation details still need to be confirmed, which is also the purpose of this PR. Plan to discuss this further on Monday and will update the tests (including implementations and signatures) once everything is finalized. Feel free to share any specific concerns or suggestions you might have—we can address them together :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix RawPOSIX exec()
3 participants