Music freed when getting duration length with Guile 2.2
(before !1065 (merged)) During repeated documentation builds, it's possible to observe the following crash:
#0 0x0000561e8b3c55fc in Prob::internal_get_property (this=this@entry=0x0, sym=0x7f2f3be59400) at /code/LilyPond/src/lily/prob.cc:164
164 SCM s = scm_sloppy_assq (sym, mutable_property_alist_);
[Current thread is 1 (Thread 0x7f2f3e1e30c0 (LWP 2455867))]
(gdb) bt
#0 0x0000561e8b3c55fc in Prob::internal_get_property(scm_unused_struct*) const (this=this@entry=0x0, sym=duration) at /code/LilyPond/src/lily/prob.cc:164
#1 0x0000561e8b34d243 in Music::duration_length_callback(scm_unused_struct*) (m=<optimized out>) at /code/LilyPond/src/lily/music.cc:305
#2 0x00007f2f41006a51 in vm_regular_engine (thread=0x0, vp=0x7f2f3b945f30, registers=0x7f2f40f9b9a0 <scm_apply_subr+176>, resume=1090660640) at ../../guile-2.2.7/libguile/vm-engine.c:786
#3 0x00007f2f4100c3a0 in scm_call_n (proc=<optimized out>, argv=argv@entry=0x7ffd95880158, nargs=nargs@entry=1) at ../../guile-2.2.7/libguile/vm.c:1260
#4 0x00007f2f40f88908 in scm_call_1 (proc=<optimized out>, arg1=<optimized out>) at ../../guile-2.2.7/libguile/eval.c:485
#5 0x0000561e8b34d67f in Music::get_length() const (this=0x561e9121c700) at /code/LilyPond/src/lily/include/smobs.hh:336
#6 Music::get_length() const (this=0x561e9121c700) at /code/LilyPond/src/lily/music.cc:90
#7 0x0000561e8b34ea6f in Music::to_event() const (this=0x561e9121c700) at /code/LilyPond/src/lily/music.cc:255
#8 0x0000561e8b34ee6e in Music::send_to_context(Context*) (this=<optimized out>, c=0x561e943d7390) at /code/LilyPond/src/lily/music.cc:284
#9 0x0000561e8b4a5244 in Volta_specced_music_iterator::process(Moment) (this=this@entry=0x561e943d72e0, m=...) at /code/LilyPond/src/lily/volta-specced-music-iterator.cc:84
#10 0x0000561e8b3f44e0 in Sequential_iterator::process(Moment) (this=0x561e8ddabd90, until=...) at /code/LilyPond/src/lily/sequential-iterator.cc:163
#11 0x0000561e8b3f44e0 in Sequential_iterator::process(Moment) (this=this@entry=0x561e94fe3320, until=...) at /code/LilyPond/src/lily/sequential-iterator.cc:163
#12 0x0000561e8b3f44e0 in Sequential_iterator::process(Moment) (this=this@entry=0x561e8d31af70, until=...) at /code/LilyPond/src/lily/sequential-iterator.cc:163
#13 0x0000561e8b4a487b in Volta_repeat_iterator::process(Moment) (this=this@entry=0x561e8d31af70, m=...) at /code/LilyPond/src/lily/volta-repeat-iterator.cc:66
#14 0x0000561e8b3f44e0 in Sequential_iterator::process(Moment) (this=0x561e95877b00, until=...) at /code/LilyPond/src/lily/sequential-iterator.cc:163
#15 0x0000561e8b2ddaa8 in Global_context::iterate(Music*, bool) (this=this@entry=0x561e8f3c5920, music=music@entry=0x561e95878110, force_found_music=force_found_music@entry=false) at /code/LilyPond/src/lily/global-context.cc:189
#16 0x0000561e8b2dc44f in ly_run_translator(scm_unused_struct*, scm_unused_struct*) (mus=<optimized out>, output_def=output_def@entry=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7f2f3bf9c960)
at /code/LilyPond/src/lily/global-context-scheme.cc:112
#17 0x0000561e8b3e5066 in Score::book_rendering(Output_def*, Output_def*) (this=0x561e94fe4820, layoutbook=0x561e94fe2e00, default_def=0x561e943ce560) at /code/LilyPond/src/lily/score.cc:136
#18 0x0000561e8b2612ed in Book::process_score(scm_unused_struct*, Paper_book*, Output_def*)
(this=this@entry=0x561e94fe2da0, score_scm=<error reading variable: ERROR: Cannot access memory at address 0x0>0x7f2f3bf9caa0, output_paper_book=output_paper_book@entry=0x561e95877cc0, layout=layout@entry=0x561e943ce560)
at /code/LilyPond/src/lily/book.cc:224
#19 0x0000561e8b261cd4 in Book::process(Output_def*, Output_def*, Paper_book*) (this=0x561e94fe2da0, default_paper=<optimized out>, default_layout=0x561e943ce560, parent_part=parent_part@entry=0x0) at /code/LilyPond/src/lily/book.cc:298
#20 0x0000561e8b261d47 in Book::process(Output_def*, Output_def*) (this=<optimized out>, default_paper=<optimized out>, default_layout=<optimized out>) at /code/LilyPond/src/lily/book.cc:196
#21 0x0000561e8b2603bf in ly_book_process_to_systems(scm_unused_struct*, scm_unused_struct*, scm_unused_struct*, scm_unused_struct*)
(book_smob=<optimized out>, default_paper=<optimized out>, default_layout=<optimized out>, output="40/lily-dede231e") at /code/LilyPond/src/lily/book-scheme.cc:108
After !1065 (merged), the error is
ERROR: In procedure ly:music::duration-length-callback:
In procedure ly:duration-length-callback: Wrong type argument in position 1 (expecting Music): #<finalized smob 7f01eabbb320>
As this wasn't seen before with Guile 1.8, this might well be another GC-related issue.
Edited by Jonas Hahnfeld