Malloc broke Serenity’s JPGLoader, or: how to win the lottery (2021)

The author delves into an intriguing bug found in SerenityOS regarding JPG image decoding, resulting in incorrect colors. Through a lengthy process of bisecting and debugging, the issue was tracked down to a flawed implementation that caused non-deterministic iteration over image components stored in a HashTable. The bug was previously masked by fortunate circumstances until changes revealed the underlying problem. Surprisingly, the issue was fixed by making JPGloader iterate components deterministically. The author expresses gratitude to those involved in solving the bug and highlights the importance of addressing seemingly simple problems that could uncover significant issues.

https://sin-ack.github.io/posts/jpg-loader-bork/

To top