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

Inform user that partitions are not to be executed alone #21

Open
wucke13 opened this issue Dec 16, 2022 · 9 comments
Open

Inform user that partitions are not to be executed alone #21

wucke13 opened this issue Dec 16, 2022 · 9 comments
Assignees

Comments

@wucke13
Copy link
Contributor

wucke13 commented Dec 16, 2022

https://github.com/aeronautical-informatics/apex-linux/blob/3a503936950c6e47ac293481f1ff78a87a80b89a/partition/src/lib.rs#L28

panics if one tries to execute a partition freestanding, without the hypervisor:

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: TypedError { err: PartitionInit, source: environment variable not found }', /sources/apex-rs-linux-0.1.0-main/src/lib.rs:28:45
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
zsh: IOT instruction (core dumped)  result/bin/taws

Maybe it would be clever to print a message to the user, explaining briefly what to do instead (run the partition through the hypervisor).

@dadada
Copy link
Collaborator

dadada commented Dec 17, 2022

We should make sure the environment is checked as early as possible. Doing this lazily might not be the right way, since it's harder to find a condition in which it is save to abort the execution of the partition later, than earlier.

@cvengler
Copy link
Member

How does one execute a parition freestanding in the first place? The partition crate is a library crate, isn't it? And running the partition binary stand-alone results in an infinite running process but not in an error (on my machine).

@dadada
Copy link
Collaborator

dadada commented Dec 19, 2022

I also can not reproduce the crash, same as @emilengler. Tested with the hello example and another partition. I'd like to close the issue as non-relevant.

@dadada dadada removed their assignment Dec 19, 2022
@wucke13
Copy link
Contributor Author

wucke13 commented Dec 30, 2022

How does one execute a parition freestanding in the first place? The partition crate is a library crate, isn't it? And running the partition binary stand-alone results in an infinite running process but not in an error (on my machine).

The partition images are just normal executables, statically linked. You can totally just execute them like ./partition-image.

@wucke13
Copy link
Contributor Author

wucke13 commented Dec 30, 2022

I also can not reproduce the crash, same as @emilengler. Tested with the hello example and another partition. I'd like to close the issue as non-relevant.

I'm wondering then, what behavior do you see when directly executing a partition?

@dadada
Copy link
Collaborator

dadada commented Dec 30, 2022

I'm wondering then, what behavior do you see when directly executing a partition?

The partition waits for a file-mutex that it never manages to aquire, but I don't see any crashes.

@dadada
Copy link
Collaborator

dadada commented Dec 30, 2022

Could you maybe provide a backtrace?

@cvengler
Copy link
Member

Any updates?

@sevenautumns
Copy link
Collaborator

Not really.
Priority lies with #47 rn.
Because we are going to use ptrace(2) for hypervisor/partition communication, we will probably remove the Lazy statics in partitions as well.
This Issue will be addressed after #47 resolved.

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

No branches or pull requests

4 participants