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

Miri subtree update #131727

Merged
merged 61 commits into from
Oct 15, 2024
Merged

Miri subtree update #131727

merged 61 commits into from
Oct 15, 2024

Conversation

RalfJung
Copy link
Member

r? @ghost

RalfJung and others added 30 commits October 5, 2024 17:21
avoid pthread_attr_t in tests

We don't support `pthread_attr_init` so the code here is actually technically wrong (passing attributes to `pthread_create` that were not initialized properly). It's also unnecessary, we can just pass a null pointer for the attributes to indicate "default attributes please".
…Jung

Added rust-analyzer instructions for Helix

That pull request adds information on how to configure Helix to use `rust-analyzer`, and moves the existing configuration to the `src/etc` directory as it's in the `rust` repository. Not adding instructions for other IDE because there's a link leading to the how-to for `rustc`.
fix behavior of release_clock()

Fixes rust-lang/miri#3947

Thanks to `@FrankReh` for noticing this and suggesting the right approach for the fix!
CONTRIBUTING.md: explain the review bot use
Fixed pthread_getname_np impl for glibc

The behavior of `glibc` differs a bit different for `pthread_getname_np` from other implementations. It requires the buffer to be at least 16 bytes wide without exception.

[Docs](https://www.man7.org/linux/man-pages/man3/pthread_setname_np.3.html):

```
The pthread_getname_np() function can be used to retrieve the
name of the thread.  The thread argument specifies the thread
whose name is to be retrieved.  The buffer name is used to return
the thread name; size specifies the number of bytes available in
name.  The buffer specified by name should be at least 16
characters in length.  The returned thread name in the output
buffer will be null terminated.
```

[Source](https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_getname.c;hb=dff8da6b3e89b986bb7f6b1ec18cf65d5972e307#l37):

```c
int
__pthread_getname_np (pthread_t th, char *buf, size_t len)
{
  const struct pthread *pd = (const struct pthread *) th;

  /* Unfortunately the kernel headers do not export the TASK_COMM_LEN
     macro.  So we have to define it here.  */
#define TASK_COMM_LEN 16
  if (len < TASK_COMM_LEN)
    return ERANGE;
```
…poll, r=RalfJung

Fix over synchronization of epoll

Fixes rust-lang#3944.

The clock used by epoll is now per event generated, rather than by the `epoll's` ready_list.

The same epoll tests that existed before are unchanged and still pass. Also the `tokio` test case we had worked on last week still passes with this change.

This change does beg the question of how the epoll event states should change. Perhaps rather than expose public crate bool fields, so setters should be provided that include a clock parameter or an optional clock parameter. Also should all the epoll event possibilities have their clock sync tested the way these commit lay out testing. In this first go around, only the pipe's EPOLLIN is tested. The EPOLLOUT might deserve testing too, as would the eventfd. Any future source of epoll events would also fit into that category.
The shim syscall logic doesn't support ID 290, SYS_eventfd2.
syscall eventfd2

Add plumbing so syscall of SYS_eventfd2 can take advantage of the eventfd support already built into Miri.
… r=saethlin

Fix spelling in README

Great project! I was reading some docs and found these that I think are spelling errors.
…alfJung

epoll event adding: no need to join, there's no old clock here
epoll: rename blocking_epoll_callback since it is not just called after unblocking

`@tiif` does `return_ready_list` seem like a reasonable name?
…em, r=RalfJung,saethlin,oli-obk

remove -Zmiri-panic-on-unsupported flag

Fixes rust-lang/miri#3952, see that issue for discussion.
RalfJung and others added 14 commits October 14, 2024 17:44
Do not store synchronization primitive IDs in adressable memory

We shouldn't store this in a place where the program can mess with it.

Fixes rust-lang/miri#1649

Blocked by rust-lang#131593
Avoid some needless monomorphizations

All code paths always end up boxing the type, so let's do it eagerly in the `callback!` macro instead
…fJung

Added a variadic argument helper

`@RalfJung,` as you wished (:
ensure that a macOS os_unfair_lock that is moved while being held is not implicitly unlocked

Fixes rust-lang/miri#3859

We mark an os_unfair_lock that is moved while being held as "poisoned", which means it is not considered forever locked. That's not quite what the real implementation does, but allowing arbitrary moves-while-locked would likely expose a ton of implementation details, so hopefully this is good enough.
use new check_min_arg_count helper in more places
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 15, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 15, 2024

The Miri subtree was changed

cc @rust-lang/miri

@rustbot
Copy link
Collaborator

rustbot commented Oct 15, 2024

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@RalfJung
Copy link
Member Author

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Oct 15, 2024

📌 Commit 1f501a7 has been approved by RalfJung

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 15, 2024
@bors
Copy link
Contributor

bors commented Oct 15, 2024

⌛ Testing commit 1f501a7 with merge 00367d5...

@bors
Copy link
Contributor

bors commented Oct 15, 2024

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 00367d5 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 15, 2024
@bors bors merged commit 00367d5 into rust-lang:master Oct 15, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 15, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (00367d5): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 2.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.4% [2.4%, 2.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.4% [2.4%, 2.4%] 1

Cycles

Results (secondary 9.7%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
9.7% [9.7%, 9.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 782.323s -> 783.753s (0.18%)
Artifact size: 332.59 MiB -> 332.64 MiB (0.01%)

@RalfJung RalfJung deleted the miri-sync branch October 16, 2024 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants