-
Notifications
You must be signed in to change notification settings - Fork 4
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
PCLint and Coverity results with white paper examples #2
Comments
Hi there @ubercool2 , |
Full disclosure: I am also a PolySync employee. Here are a few thoughts that arrived in my head given your conclusion @ubercool2:
|
First off, hats of to PolySync team for challenging safety standards and putting safety first. We all need this in AD industry.
Here is our tests with your examples from the paper:
Mutable Aliasing
Breaking the
const
PromisePCLint: correct detection
Coverity: correct detection
Unreliable Pattern Matching
Some of the problems can be avoided when using C++:
Mutable Aliasing:
Don't use pointers. 99% of points can be replaced by references which are much safer.
Pointers allow encoding optionality which is very often not desired. Use constructs like gsl::not_null from https://github.com/Microsoft/GSL/blob/master/include/gsl/pointers.
Breaking the ‘const‘ Promise
Avoiding c-style casts also solves this problem as const cast in C++ is easy to detect.
Unreliable Pattern Matching
C++ has typed enums which solve this problem.
Data Races
Again, do not use pointers.
We feel that Rust has a lot of promise, but comparing it to C in the kinds of safety critical applications, and arguing that Rust is a better solution now, is at least hard. We see an issue of maturity. The maturity is lacking for us in three ways: first fundamental features and libraries are still missing or in development (maturity of the ecosystem), second it has not been (as far as we know) used in real-time software where determinism is required (We believe Rust still liberally uses dynamic memory allocation, so memory fragmentation is a thing), and third Rust still depends on lots of C/C++ code which can be unsafe if not used properly in the Rust bindings.
The text was updated successfully, but these errors were encountered: