Researcher finds 17 unreported bugs in Clojure core, reproduces five
A developer used the Lean 4 theorem prover and differential testing against java.util to uncover 17 previously unreported bugs in Clojure's core data structures, which have been in production since 2007. Reproducing five of them on Clojure 1.12.7 and OpenJDK 21, they confirmed the findings in under an hour. One bug, in the vector reduce implementation, causes reduce to loop forever on vectors of exactly 65,505 elements, traced to an incorrect bitmask in the shipped code. The mask has reportedly been present since a 2010 commit, and the author proposed a corrected version verified in Lean. The author also reports a HAMT hash-map bug in which dissoc on hash-collision nodes uses the wrong hash, with the issue appearing for keys that are equal but hash differently.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in