Hi, I have what appears to be a very difficult bug.
The bug causes LilyPond 2.25.15 to sit in an infinite loop during the "Interpreting music ..." stage of compilation. The 3 files attached here reproduce the bug 100% of the time when I interpret them on a 2022 M2 MacBook Air running macOS 14.5. Crucially, the infinite loop appears to be triggered by *the total number of music expressions read during interpretation.* I say this after spending a couple of days bisecting the attached files: although the music.ily file included here is large, the file is now reduced to such a state that *commenting out almost any single voice in the input file allows LilyPond to exit the infinite loop and finish interpretation.* Strangely, it doesn't much appear to matter *which* voice(s) is commented out. Likewise, the file will interpret correctly if you comment out all \override and \revert statements. So, too, will the file interpret correctly if you comment out all \set stemLeftBeamCount and \set stemRightBeamCount statements. In other words, the bug doesn't appear to be triggered by any particular type of expression in the input files, but rather by the total volume of expressions. To reproduce the bug, unzip the archive attached here and call "lilypond music.ly" inside the resulting infinite-loop directory. When attempting to reproduce the bug, it is possible that Lily's behavior may appear to be nondeterministic; I suspect it may take two or three successive attempts to interpret music.ly before triggering the loop on some operating systems (or chip architectures), even though the loop triggers consistently on my machine. Note, too, that LilyPond sometimes (though not always) crashes out of the infinite loop with ... fatal error: intlog2 with negative argument: 0 ... issued before terminating. As a hunch, my best guess is that the loop might be triggered, somehow, by the skip-filled calls to \scaleDurations that occur in the file. These look like \scaleDurations #'(6 . 7) { s8 s8 s8 s8 s8 s8 s8 }, and are placeholders for empty tuplets that correspond to something going on at the same time in another voice. (A similar bug for skipped-filled tuplets showed up sometime around 2.25.8.) Though this wouldn't explain why such skip-filled expressions interpret correctly when all calls to \set stemLeftBeamCount are commented out, for example. Apologies for the verbose files included here; I bisected to what I believe is the minimum content to reliably trigger the loop. Trevor. -- Trevor Bača www.trevorbaca.com soundcloud.com/trevorbaca
<<attachment: infinite-loop.zip>>