Elektrine lite

← Feed

@stylus@social.afront.org

Post #2423043

2026-04-13 22:45 UTC

@void_friend@tech.lgbt as you might expect, after a little bit longer it prints The 4294967296th exception is the same exception

Replies (1)

  • @void_friend@tech.lgbt 2026-04-15 08:08

    @stylus@social.afront.org Thank you very much for running the experiment. I don't know how fluent you are in Caml, but it shows a deliberate but undocumented limitation in the implementation of generative exceptions (each call to f is supposed to generate a new exception according to documentation). It's not even worth reporting (first, the implementers know; second, 32-bit OCaml is no longer supported). Writing the PoC, and seeing it work, I realized that the line if !c = 0L then the_exn := Foo; isn't even necessary! The bug is not just that one Foo if saved will end up equal to another Foo. A certain Foo should also eventually end up being equal to the pre-defined Exit exception, a much sharper manifestation of the bug that could make plausible code misbehave if it ran long enough.

    Open ##2423044