News for hackers. Stuff that matters.
Re:Some Were Meant For C (2017) [pdf] by icandoit on Monday March 01, 2021 @04:02PM (#26308375)
If you want to do something about it look into UBSan. Turn vague concerns into bugs, and then into commits :).

https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html

UndefinedBehaviorSanitizer (UBSan) is a fast undefined behavior detector. UBSan modifies the program at compile-time to catch various kinds of undefined behavior during program execution, for example:

- Using misaligned or null pointer

- Signed integer overflow

- Conversion to, from, or between floating-point types which would overflow the destination

GCC has similar features.

Re:Some Were Meant For C (2017) [pdf] by cozzyd on Monday March 01, 2021 @06:03PM (#26309716)
Unfortunately, ubsan is not implemented on all targets, as I just found out a few seconds ago trying to enable it on my arm-none-eabi project. (I suppose technically I just need to implement all of the stubs to hard fault or something... why doesn't gcc do that for me?).
Re:Some Were Meant For C (2017) [pdf] by pjmlp on Tuesday March 02, 2021 @03:13AM (#26313046)
> UBSan modifies the program at compile-time to catch various kinds of undefined behavior during program execution

Which makes it unusable with binary libraries.

Re:Some Were Meant For C (2017) [pdf] by saagarjha on Wednesday March 03, 2021 @12:01AM (#26324958)
It’s not intended to be something you ship.
Re:Some Were Meant For C (2017) [pdf] by pjmlp on Wednesday March 03, 2021 @03:19AM (#26325958)
Plenty of us link to binary libraries.
Re:Some Were Meant For C (2017) [pdf] by adrianN on Monday March 01, 2021 @11:50PM (#26312009)
UBSan is awesome, but you need an awesome test suite to really unlock its power.
Re:Some Were Meant For C (2017) [pdf] by rurban on Tuesday March 02, 2021 @06:48AM (#26314275)
If you are too lazy to write tests, either formally verify it (cbmc or satabs) or fuzz it. Libfuzzer works great finding ubsan and asan bugs fast.