by uecker · 1w ago · 0 comments
Do you get a panic or a segfault?
And to the GP: yes, if your safe Rust program segfaults because of a bug in the Rust standard library, then you file a bug with the Rust project. I agree this is nice!
But in most real-world cases, your Rust program will segfault (or panic) due to a bug in your own code or in some code in one of its many dependencies. Then you also debug it.
But indeed you are in a good place if you manage to get a segfault. The much worse case is that the program misbehaves in some unexplainable way.
The strategy when integrating unsafe segments to your Rust codebase is that you provide a safe interface for them, then very carefully review the code, and also use tools such as Miri to test them. Ideally your business side would not have any unsafe code in it.