Spin the wheel and get 5 random cool links!
Bugs and debugging # A list of bugs encountered in the wild. Not as much fun as those, though. 🐞 = bug cause Logical Errors # Python program got stuck where it shouldn’t — 🐞 Confused threading.Thread.start() with threading.Thread.run() In C++ code, used << instead of <<= in an assignment, which caused a bitmask to be all 0, leading to a bunch of numbers being 0 as well… Forgot that assert() is disabled in CMake non-debug configurations (ReleaseWithDebugSymbols). Camera calibration never converged — 🐞 used wrong units (cm instead of mm) for a physically measured value when setting a constant OpenCV camera calibration: copy-pasted code, and then forgot to update resolution for one of the cameras… Python script got stuck after a day of runtime — 🐞 accidentally imported a python module repeatedly, where each import caused a file open, which caused a file descriptor starvation issue on the system In Go, used time.time{} to mean the unset default value, but for some rare inputs it actually was a valid value, leading to a confusing bug where a variable was unexpectedly written to twice Forgetting to resize a std::vector led to memory access error A C++ module used by linked module was dependent on static initialization, which was not called from the first module Multi threaded Python module receiving messages through UDP was behaving erratically — 🐞 Multiple threads were reading from a queue, but all the threads should have received ALL the messages. A Python program was calling another process via subprocess.Popen(). There were some “magic” messages which the subprocess could write to stdout (JSON) which the parent process would interpret, e.g. to show progress in the GUI, or extend a timeout. In some cases, it seemed that some of the messages would not arrive until a later point in program execution. Setting PYTHONUNBUFFERED=1 did not help. After running both parent and child under strace, it was clear that the child was actually doing the “correct” thing, and was not bu