4 ms·
Nicely written, and thank you for providing such a great peice of engineering! A thought: would it help to have a modified C compiler that would crash the app
by Drdrdrq 8y ago
Nicely written, and thank you for providing such a great peice of engineering!
A thought: would it help to have a modified C compiler that would crash the app whenever UB was encountered? It might help find some bugs where non-default C compiler was used (which I assume happens, given the large amount of platforms sqlite supports). Or am I missing something?
- Leszek 8y agoI believe there's some things your have to do such aren't C compatible, e.g. store fat pointers of base+length+offset instead of raw pointers, to catch OOB accesses.
- cyan_pencil 8y agoThere is ASAN, the address sanitizer. You can enable it by passing some flags to gcc. It will make your program crash as soon as there is an out of bounds read / undefined behaviour. If debug symbols are enabled, it will also tell you which line of code was responsible. It can save you countless hours of debugging
- drorh 8y agoI would not help because modern compiler treat UB as an optimization opportunity, including a license to do whatever they want (even elimination of code).