Fixing a 20-year-old bug in Enlightenment E16

April 15, 2026
Celebrate the New Year 2022 with golden number candles on a pink backdrop.
Photo by cottonbro studio on Pexels

The freeze

An enthusiast discovered a deterministic desktop freeze in Enlightenment E16 that only triggered when opening one particular PDF. The user — who admits to loving E16’s tiny memory footprint and old-school themability — says the hang happened every time that file was opened in Atril. Out of habit and curiosity they attached gdb, watched stacks pile into imlib2’s font cache, and traced the problem back through E16’s text-layout routines until a single function kept showing up: TextstateTextFitMB, the middle-ellipsis truncation code that tries to squeeze a window title into limited pixels.

The old Newton

Dumping locals across samples revealed a clean oscillation in the truncation loop: the code would nuke a few characters, then add some back, over and over. It has been reported that the root cause dates to a faulty implementation of Newton’s method used for measuring and fitting text — an algorithmic misstep that can produce precisely this kind of non-converging ping-pong. The bug allegedly goes back to about 2006, hiding in plain sight in a codebase that’s been loved, patched and sometimes ignored for decades.

Why it matters

The fix was simple in spirit: stop the oscillation, make the fitting routine converge. The author patched the truncation/math logic and the hang disappeared. It’s a small victory, but a vivid one — proof that ancient code still bites and that hobbyist maintainers can still do surgical work on legacy projects. Who knew Newton would be haunting desktop decorations twenty years on? The incident is a reminder: technical debt and clever-but-flawed math can linger for ages, and sometimes all you need is patience, a debugger, and a willingness to use software older than you are.

Sources: iczelia.net, Lobsters