Rust SIG Meeting - 2026-06-09 #29
Replies: 10 comments
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey folks 👋 welcome to our 11th meeting of 2026.
Rust SIG Meeting 2026-06-09
Agenda
Check-in area
We had roughly 15 people present at peak attendance, including those listed below.
Housekeeping
#rust-sigTasks / action items
Meeting Minutes
Shared Memory, in Rust, the Memory-Safe Language!? Yes: iceoryx2; Christian Eltzschig - ekxide
Slides: ekxide_where-rust's-safety-guarantees-stop_shared-memory-concurrency-and-unsafe-boundaries.pdf
Key takeaways
Send/Sync, and tooling improve confidence, but they do not automatically make shared-memory IPC safe.Background: iceoryx2
The slide deck introduced iceoryx2 as:
ara::comand ROS 2 APIs;The live notes also captured that the original iceoryx work started in the Bosch ecosystem, and that the later rewrite moved to Rust for the reasons discussed below.
How iceoryx2 works
At the simplest level, two or more processes map and access the same shared-memory region.
The slide diagram shows
Process A / Sender -> Shared Memory <- Process B / Receiver: the shared-memory region is the handoff point, not a copied message buffer owned by a broker.Why Rust was chosen
iceoryx2 targets safety-critical and high-reliability systems, so reliability and correctness are not optional engineering goals. The slides cited two memory-safety motivations:
The speaker’s framing was not “Why Rust?” but rather: “Why would we stay with C++?” Rust removes large classes of memory-safety and data-race bugs in safe code, whereas C++ leaves developers with the full burden of preventing those classes manually. (Slides p. 5)
Rust safety guarantees: ownership and borrowing
Rust’s ownership model provides a strong baseline:
Illustrative example from the slides:
The point of the example is that Rust can prevent mutation that could invalidate an outstanding reference. (Slides p. 7)
Rust safety guarantees:
SendandSyncThe speaker emphasized that having formal names for these concepts is already valuable.
Send: ownership of a value can be transferred to another thread.Sync: a shared reference can be sent to another thread; in practice, this means shared concurrent access by reference is permitted.Problematic C++ example discussed in the talk, cleaned up for syntax:
The slide notes that an iceoryx2
Sampleis notSendorSync. The Rust type system can express that a sample should not be moved to another thread or shared across threads when doing so would violate the protocol. In C++, the API has to rely much more heavily on convention and review. (Slides p. 9)Rust safety guarantees: tooling like Miri and Loom
The slide deck framed Miri and Loom as important evidence-generating tools, not proof that everything is correct.
The talk’s answer to “Can we now write lock-free low-level code without fear?” was: No — but with better evidence. (Slides p. 10)
The Seqlock Case Study
Introduction
The seqlock case study focused on a shared-memory data structure with:
The tempting safety-critical argument is that a crashing writer or reader cannot block another process. The slide immediately questioned that assumption: “or can it?” (Slides p. 12)
The diagrams on slides p. 12–13 show two cells: one write cell and one read cell. The writer copies data into the write cell, readers copy out of the read cell, and the sequence counter determines which cell is currently used for reading versus writing.
Naive implementation
The slide’s simplified shape of the structure was:
The sequence counter defines the read and write cell.
Writer flow:
Reader flow:
Rust implementation sketch
The slides showed an implementation shape along these lines:
This sketch is useful because it looks plausible, but the rest of the talk examined where the model cracks. (Slides p. 15–16)
Where the model cracks
The speaker asked three review questions before walking through the failure modes:
Data races and undefined behavior
The naive implementation uses
copy_non_overlappingon both the writer and reader side. Miri detects undefined behavior in this setup.The key issue is that concurrent reading and writing with
copy_non_overlappingis undefined behavior even when the data race is detected and the copied data is never touched. In a safety-critical system, this is not an acceptable implementation detail to wave away.The slide’s proposed direction was to use atomic bytes for the payload representation:
This avoids the plain non-atomic concurrent copy, but it leads into the next problem. (Slides p. 19–20)
Padding and undefined behavior
The slides used a
repr(C)example:Reading padding bytes is undefined behavior. Switching from
copy_non_overlappingto an atomic byte-wise copy still does not automatically solve the issue, because byte-wise copying can read padding bytes. Miri still detects undefined behavior.The proposed solution was a proc macro plus derive that generates a member-wise accessor for byte-wise copy, avoiding padding bytes rather than treating the entire object representation as uniformly valid data. (Slides p. 21–22)
Pointer provenance
The talk then moved to pointer provenance. Thin pointers in Rust and C++ have two conceptual components:
Undefined behavior depends on both the address and the provenance. A pointer can point to the right numeric address and still be invalid for the intended access if its provenance is wrong. (Slides p. 23)
This becomes especially tricky in shared memory:
The slides explicitly asked: “Is this correct?” The live discussion noted that similar “conjuring” is often necessary when interacting with hardware, writing drivers, or writing operating-system code. The safety argument therefore has to be explicit at the boundary where raw bytes become typed Rust values. (Slides p. 24)
Acquire-release memory ordering
Acquire-release ordering is used to establish a happens-before relationship:
When a reader observes the value that the writer placed in the
sequence_counter, it should also observe the changes in the corresponding write cell. (Slides p. 25)A view into the past
Acquire-release can still allow a reader to observe a consistent value from the past. The slide gave the scenario:
The question is: what value does
Thave for a particular reader? Acquire-release can provide consistency, but not necessarily “the newest” value. If the algorithm requires the newest data, it needs additional synchronization outside the basic acquire-release relationship.The speaker connected this issue to a lock-free flatmap implementation. The captured note was: if a key is visible, do not update; otherwise add the key and value. The solution discussed was a generation counter that changes on every read and write, forcing both sides to synchronize to fresher values. (Slides p. 26)
As-if rule
The live notes captured a related compiler-optimization concern: the compiler is allowed to reorder statements when a single-threaded execution cannot observe the difference. For example, setting
A = 5andB = 6may be reordered if the single-threaded result is unchanged.In concurrent code, that freedom can break the intended protocol unless the program uses the right atomic operations and memory orderings. The captured solution was to use atomic acquire-release semantics to constrain the relevant reordering.
What tools can and cannot prove
Miri
Miri is excellent for checking unsafe code for many forms of undefined behavior, but it only checks paths that are executed.
Practical implications from the notes:
Loom
Loom systematically tests possible thread interleavings and helps validate memory orderings. The live notes added that Loom can help establish where happens-before relationships are correctly formed, or point out where they are wrong.
Limits:
Beyond testing: verification with Kani?
The slides described Kani as a tool that can check assertions, contracts, panics, overflows, and many undefined-behavior cases. It may be one route for verifying lock-free algorithms, but only against the model and properties supplied to it.
The important slide completion for the original notes’ placeholder is:
Conclusion
The talk concluded with three major points:
The concluding open question was whether Rust could have an edition or mode for safety-critical deployments with less undefined behavior, even if that costs performance. (Slides p. 33)
The discussion after the slides noted that explicit annotations could be one route, but they are difficult because the developer must already be aware of the relevant undefined-behavior risk. Miri helps, but it is not perfect.
Q&A notes
Question: How is in-place construction handled? Rust lacks placement new at the moment.
PlacementDefaulttrait.Defaultto avoid ambiguity.Question: Could there be a safer Rust mode or edition that costs performance? Since shared memory is used for performance, are there alternatives?
Question: How was the decision made to take iceoryx2 down the Rust route? Were there objections that did not materialize? Any choices you would make differently?
SeqLockfor a constant memory size.todo!()to progressively build out functionality.Question: How did customers react to the prospect of certifying Rust?
Question: How have these topics been addressed in the C/C++ implementation? Isn’t the shared-memory problem more about leaving the language model and entering hardware/OS specifics?
unsafeboundaries plus tools such as Miri and Loom provide more evidence and more structure than the C/C++ baseline.Follow-up: Do you assume the peer follows the protocol? What if the other process goes wild or is implemented incorrectly?
The answer was summarized in three categories:
This allows iceoryx2 to be used in a trust model where the OS is the trusted base.
Follow-up: For synchronization data, don’t you need to ensure the protocol succeeds no matter what?
Question: Binary-level coverage analysis as a substitute for MC/DC — how is that argument made?
Question: What about external crates? If you use them, how do you certify them?
libc,serde, and maybe one more crate.libc.serdeorlibcimplementation would benefit many projects.Recent events / things coming up for Rust
No recent events or upcoming items were captured in the source notes.
Requested topics
No requested topics were captured in the source notes.
Material
Beta Was this translation helpful? Give feedback.
All reactions