A short tale of a read overflow
antirez.com
antirez.com
Eventually i realised that i had compiled my application against one version of Boost, and then dynamically linked to a library i had compiled against a different version. This was all due to bad library path hygiene - my OS had one version of Boost installed, and i was trying to use another that i had installed locally, but GCC was ignoring my path options and getting seduced by the system Boost. After this, i learned about the --sysroot flag to GCC, which has helped to prevent this happening again.
So yeah, protip: know what it is you're actually running. Also, never use C/C++.
Interesting. Boost's shared pointer implementation is header-only. Are they using shared_ptr in an API for a non-header Boost library?
https://stackoverflow.com/questions/10334511/why-do-c-librar...
In my experience, GDB should get some blame at least --- far too many times I've seen it fail on code of the form
var = foo();
where the value of var will clearly be in the return value register after executing the function call, but GDB steadfastly refuses to display var, claming it's been optimised out and unavailable. Inspecting eax/rax clearly shows the value is available.
Unless you use one of the sanitizers while fuzzing, right? If not ASan then I would wager MSan could detect this.
Incidentally, something's a little funny with this article. Missing spaces between words in a few places. E.g. "replacement formalloc()"
“Harmless” only in a sense that the read won’t crash, but likely harmful if the result of the read is input to computation.