Hacker News new | ask | show | jobs
by lilyball 2484 days ago
> It's possible to write code in these languages without these bugs

I would go so far as to say in any non-trivial codebase it's virtually impossible to avoid introducing a bug of this nature. SQLite is probably the codebase that has the highest chance of being safe from this, due to its extremely thorough test suite and amount of fuzzing that's been done, but even that codebase was found to have a significant bug (I forget the details) in one of the optional first-party extensions, as that extension did not have the same rigorous test suite that the SQLite core did.

To be clear, when I say thorough test suite, IIRC SQLite's test suite has 3x as many lines of code as the code being tested. And I think there's some sort of instrumentation to ensure the test suite covers every single code path.

2 comments

> IIRC SQLite's test suite has 3x as many lines of code as the code being tested

Actually it has a shocking 662x as many lines of tests as it has code[1].

I agree though, SQLite is an amazing piece of software.

[1]: https://sqlite.org/testing.html

Covering the every single branch of code isn’t enough. One needs to test that every single branch isn’t vulnerable to an overflow attack.

It’s kind of testing every possible valid, invalid and malicious input the program can take in.

Gets even crazier with race conditions and such.

Testing is really hard. And given how many companies skip on testing I am led to believe security is a myth. There’s gonna be someone somewhere with an exploit getting your info.

Yeah, which is why fuzzing is important even with tests covering every code path. And even with that, this is why I simply said that SQLite is probably the codebase that comes the closest, rather than saying it actually is bug-free.