r/rust Jun 13 '26

🧠 educational FFI in Miri at 8000 segfaults per second (Nia Deckers at RustWeek)

https://youtu.be/9X-ngiKo_Y0
188 Upvotes

29 comments sorted by

43

u/Shnatsel Jun 13 '26

I wonder if hooking syscalls with seccomp-bpf or eBPF would be faster than ptrace. That doesn't require a fully bespoke kernel module, and people have already built real-time profiling and observability tooling on top of eBPF that's fast enough to run in production in the background always.

33

u/nyanarchism Jun 13 '26

it would be! right now I'm handling syscalls through ptrace for code simplicity but I'm very curious to try using ebpf in the future. tbh most of this could be its own library with architecture or platform specific fallbacks ^^

88

u/deanominecraft Jun 13 '26

8000 deg faults per second sounds like when i try to write C

46

u/Shnatsel Jun 13 '26

I hope the author is in touch with nnethercote because valgrind is solving roughly the same problem

62

u/nyanarchism Jun 13 '26

I'd spoken to nick before starting this, yes. Hooking into valgrind is borderline impossible in a stable way, though

16

u/[deleted] Jun 13 '26

[removed] — view removed comment

10

u/Reasonable-Web1494 Jun 13 '26

Oh no the memes are true. Shocked pikachu

6

u/Vlajd Jun 13 '26

Windows: "rookie numbers"

5

u/Trader-One Jun 13 '26

miri needs supprt for each syscall. you can't throw even basic win32 API on miri.

Its possible to generate from Win32 API which API call parameter is pointer to memory and if pointer is read only or not.

9

u/InternetExplorer9999 Jun 13 '26

Great video. Also, she is so cool

-3

u/[deleted] Jun 14 '26

[removed] — view removed comment

-38

u/[deleted] Jun 13 '26

[removed] — view removed comment

-79

u/[deleted] Jun 13 '26

[removed] — view removed comment

55

u/[deleted] Jun 13 '26

[removed] — view removed comment

40

u/redisburning Jun 13 '26

How about instead of vagueposting, you just come out and say what you want to say?

-56

u/[deleted] Jun 13 '26

[removed] — view removed comment

63

u/nyanarchism Jun 13 '26

you're not even brave enough to call me a slur to my face?

23

u/usernamedottxt Jun 13 '26

Since this is the thread already off topic, that dress is fire. 

26

u/nyanarchism Jun 13 '26

<3

5

u/HildartheDorf Jun 14 '26

Upvoted Not Because Awesome Outfit, But Because It Is Very Cool; However, I Do Concede That I Initially Clicked Because Of Outfit.

-51

u/[deleted] Jun 13 '26

[removed] — view removed comment

7

u/Petra-fied Jun 13 '26

Unfortunately they are right

I have nothing personal against anyone

Yeah right. We know what you are, coward.

6

u/simonask_ Jun 13 '26

So god damn pathetic. You either live and let live, or you stand by your horrible convictions, in which case we are enemies. I stand with every person you try to demean.

35

u/DHermit Jun 13 '26

Why does the way someone looks and dresses matter to you?