4 ms·
> the problem is totally obvious and trivial to debug. We live in parallel universes that must have intersected in this thread.
by lolc 2y ago
> the problem is totally obvious and trivial to debug.
We live in parallel universes that must have intersected in this thread.
- flohofwoe 2y agoDebugging tools got a lot better in the last two decades, memory corruption issues and leaks are by far not as scary anymore as in the 90s and early 2ks, for instance check out the realtime memory debugging panel in Visual Studio that's been there since VS2015. Also as mentioned at the top of the thread: compiler warnings, ASAN, UBSAN, TSAN and static analyzers are essential these days when writing C or C++ code. The only barrier is to actually know about and use those tools in the development workflow. Rust is still superior of course (for memory safety at least), because it actually prevents most of those issues in the first place, but it's not like the rest of the world has been twiddling thumbs in the meantime.
- Leherenn 2y agoIt certainly got better, but it's still not trivial. With the sanitizers, you need to have code that actually triggers the UB, coverage is not enough. If your UTF-8 parsing code UB only on some very specific input, then unless your tests or own environment happen to have this input, you'll be none the wiser. Fuzz testing helps, but it's not commonly used in my experience.