glsnake's lighting depends on uninitialised stack memory.
gl_init declares `float light_pos[][3]` and passes each row to glLightfv(GL_POSITION), which reads four floats.
Light 0's w happens to be light_pos[1][0], which is 0.0.
Light 1's w comes from past the array; valgrind reports "Conditional jump or move depends on uninitialised value(s)" from a stack allocation in gl_init.
The value is the low half of a pointer, so the picture changes between launches.
A large w puts light 1 at the viewer, a small one puts it far off along (0, 20, -1) or the opposite way.
With address randomisation on, 25 frames gave 9 different pictures; the light at the viewer was the most common, 17 of 25.
With it off (setarch -R), 6 of 6 runs drew the same picture, but preloading a library that draws nothing changed 5.07 % of the pixels.
The same code is in 6.17, the current upstream release.
The attached patch gives both rows a w: light 0 keeps w = 0, and light 1 sits at the viewer, the picture most launches showed.
Three pictures attached: light 1 as the sun (w = 0), at the viewer, and as a lamp at (0, 20, -1).
In our own build the user can also pick among the three; that part is our choice and not part of this report.
I found and measured this with the help of an AI assistant (Claude).
Daniel
These runs were in a Debian sid container; the kernel shown is the host's.