Reference:
Safer Usage Of C++
CLang user manual:
https://clang.llvm.org/docs/UsersManual.html
https://clang.llvm.org/docs/ClangCommandLineReference.html
Enable flags:
-fno-exceptions
-ftrapv
-fwrapv
fsanitize=signed-integer-overflow
-Wdangling-gsl
-fno-delete-null-pointer-checks (named as such for historical reasons) that defines null pointer dereferences. With this flag, dereferences of null are never optimized away.
MiraclePtr:
scpptool
is a command line tool to help enforce a memory and data race safe subset of C++.
https://github.com/duneroadrunner/scpptool
"SaferCPlusPlus" is essentially a collection of safe data types intended to facilitate memory and data race safe C++ programming.
https://github.com/duneroadrunner/SaferCPlusPlus
https://github.com/duneroadrunner/SaferCPlusPlus-AutoTranslation2
StarScan
Heap scanning use-after-free prevention
MiraclePtr aka raw_ptr aka BackupRefPtr
Pointer Safety Ideas
https://docs.google.com/document/d/1qsPh8Bcrma7S-5fobbCkBkXWaAijXOnorEqvIIGKzc0/edit#
P1705R1
Enumerating Core Undefined Behavior
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1705r1.html
Automatic Reference Counting
https://en.wikipedia.org/wiki/Automatic_Reference_Counting
Blink GC API reference
https://docs.google.com/presentation/d/1XPu03ymz8W295mCftEC9KshH9Icxfq81YwIJQzQrvxo/edit#slide=id.p
2 basic types of memory safety
spatial:
The program will behave in a defined and safe way if it accesses memory outside valid bounds.
Examples include array bounds, struct and union field access, and iterator access.
temporal:
The program will behave in a defined and safe way if it accesses memory when that memory is not valid at the time of the access.
Examples include use after free (UAF), double-free, use before initialization, and use after move (UAM).
[[clang::lifetimebound]]
https://clang.llvm.org/docs/AttributeReference.html#lifetimebound
ABSL
Use absl::variant Instead Of enums for state machines
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.