-
Notifications
You must be signed in to change notification settings - Fork 354
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
illumos support #3198
illumos support #3198
Conversation
8139798
to
92f989c
Compare
☔ The latest upstream changes (presumably #3260) made this pull request unmergeable. Please resolve the merge conflicts. |
@devnexen what is the status of this PR? You opened it as a draft, so I assume you are not currently looking for feedback. If you don't plan to work on it in the near future, it'd be better to close the PR -- this way the open PRs reflect things that people are actively working on. We can always reopen when you have time to get back to this! |
92f989c
to
4dac66a
Compare
☔ The latest upstream changes (presumably #3436) made this pull request unmergeable. Please resolve the merge conflicts. |
Was this meant to ask for review? Github doesn't seem to send notifications on this event, so I missed this -- sorry. In the future, please just post a comment when a PR is ready. You can write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code mostly looks good, but is lacking test coverage.
Also, it will need a rebase to resolve conflicts.
Also, after rebasing, please add solaris/illumos to the unofficial target list in the README and set yourself as maintainer. |
b937325
to
f7cab83
Compare
Looks like something changed in |
Or, rather, previously only no_std was tested so the pre-main code was not even executed. I think the PR should be adjusted to add only what is needed for The goal should be for |
Do I need to implement something in particular to fix the out-of-bounds issue ? |
That looks like the pthread offsets don't work for Solarish. This seems to be a mutex, so this is the relevant comment: Lines 61 to 68 in baf32fd
It looks like something else is writing to the field that Miri uses to store the MutexId, and then Miri doesn't deal well with the invalid MutexId. |
tests/pass-dep/shims/libc-misc.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are keeping this diff, please also add libc-misc to CI.
But probably it's better to drop this diff for now, and focus on the core that's needed to get started.
e8d742b
to
0309159
Compare
Almost there. :) There's something wrong with the signature of pthread_join... I assume So here Line 45 in af37aca
you need to use something like this instead let thread_id = this.read_scalar(thread)?.to_int(this.libc_ty_layout("pthread_t").size)?; |
Also, is it possible there's something wrong with your system clock? Your commits show up as coming 20-50minutes from the future...^^ |
9e147d0
to
670e66e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks good, apart from a few nits. Why is it still marked WIP? :)
@@ -146,6 +146,7 @@ case $HOST_TARGET in | |||
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal $BASIC panic/panic concurrency/simple atomic threadname libc-getentropy libc-getrandom libc-misc fs env num_cpus | |||
MIRI_TEST_TARGET=i686-unknown-freebsd run_tests_minimal $BASIC panic/panic concurrency/simple atomic threadname libc-getentropy libc-getrandom libc-misc fs env num_cpus | |||
MIRI_TEST_TARGET=aarch64-linux-android run_tests_minimal $VERY_BASIC hello panic/panic | |||
MIRI_TEST_TARGET=x86_64-unknown-illumos run_tests_minimal $VERY_BASIC hello panic/panic pthread-sync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also run tests with x86_64-pc-solaris
? You've added two OSes everywhere but we're only testing one of them.
README.md
Outdated
@@ -227,6 +227,7 @@ degree documented below): | |||
- We have unofficial support (not maintained by the Miri team itself) for some further operating systems. | |||
- `freebsd`: **maintainer wanted**. Supports `std::env` and parts of `std::{thread, fs}`, but not `std::sync`. | |||
- `android`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works. | |||
- `solaris/illumos`: maintained by @devnexen. Support very incomplete, but a basic "hello world" works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `solaris/illumos`: maintained by @devnexen. Support very incomplete, but a basic "hello world" works. | |
- `solaris`/`illumos`: maintained by @devnexen. Support very incomplete, but a basic "hello world" works. |
let this = self.eval_context_mut(); | ||
match link_name.as_str() { | ||
// errno | ||
"__errno" => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is __errno
(with two _
right)? libc and std seem to use triple-underscore ___errno
.
If this is dead code (i.e., not needed for these tests), then please remove it entirely.
src/concurrency/thread.rs
Outdated
impl From<ThreadId> for i128 { | ||
fn from(t: ThreadId) -> Self { | ||
t.0.into() | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used, is it?
Ah, Solaris in This can be quite the rabbit hole of little functions that need to be added -- usually with stubs like this that don't actually do anything. It's up to you whether you want to add that, or restrict the PR to illumos. (You should definitely test this locally though, iterating via CI will take way too long.) |
You will probably have to extend this hack to also allow solaris, not just macos: Lines 47 to 49 in 10e8bb8
It looks like |
README.md
Outdated
@@ -227,6 +227,7 @@ degree documented below): | |||
- We have unofficial support (not maintained by the Miri team itself) for some further operating systems. | |||
- `freebsd`: **maintainer wanted**. Supports `std::env` and parts of `std::{thread, fs}`, but not `std::sync`. | |||
- `android`: **maintainer wanted**. Support very incomplete, but a basic "hello world" works. | |||
- `solaris` / `illumos`: maintained by @devnexen. Support very incomplete, but a basic "hello world" works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `solaris` / `illumos`: maintained by @devnexen. Support very incomplete, but a basic "hello world" works. | |
- `illumos`: maintained by @devnexen. Support very incomplete, but a basic "hello world" works. |
Great, thanks! |
☀️ Test successful - checks-actions |
No description provided.