Hi all, This isn't an problem as regards en-users, but only occurs when running LilyPond under gdb.
The problem is that running under gdb fails early on in initialization in the main.cc/guile-init.cc code with the call to ly_init_ly_module called from ly_c_init_guile, called from main_with_guile, which is a call-back from scm_boot_with_guile in main(). Basically gdb causes the guile code to barf saying it can't find lily.scm in the current setting of %load-path. I've added some code to show the value of %load-path in the start-up which shows what the value of %load-path is before the call and it looks fine if I run it up without gdb and with --loglevel=DEBUG. Here's a vanilla gdb session using Han-Wen's .gdbinit, the pwd is the build directory under the lilypond git directory: ----------------------------------------------------------------------- ian@nanny-ogg ~/src/lilypond/build (T3154)$ gdb --command ../.gdbinit GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-linux-gnu". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Breakpoint 1 at 0x834b744: file /home/ian/src/lilypond/flower/warn.cc, line 191. Breakpoint 2 at 0x8147057: file /home/ian/src/lilypond/lily/grob.cc, line 729. (gdb) run Starting program: /home/ian/src/lilypond/build/lily/out/lilypond [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1". GNU LilyPond 2.17.19 warning: not relocating, no 2.17.19/ or current/ found under /home/ian/src/lilypond/build/lily/share/lilypond/ ERROR: In procedure primitive-load-path: ERROR: Unable to find file "lily.scm" in load path [Inferior 1 (process 11595) exited with code 01] (gdb) ======================================================================= Here's a run showing the value of the Guile %load-path variable just before the call: ----------------------------------------------------------------------- (gdb) pwd Working directory /home/ian/src/lilypond/build. (gdb) set args --loglevel=DEBUG (gdb) run Starting program: /home/ian/src/lilypond/build/lily/out/lilypond --loglevel=DEBUG [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1". Log level set to 287 GNU LilyPond 2.17.19 Relocation: is absolute: argv0=/home/ian/src/lilypond/build/lily/out/lilypond warning: not relocating, no 2.17.19/ or current/ found under /home/ian/src/lilypond/build/lily/share/lilypond/ warning: no such directory: /home/ian/src/lilypond/build/lily/bin for PATH Relocation: compile datadir=, new datadir= Relocation: framework_prefix=/home/ian/src/lilypond/build/lily/out/.. Setting INSTALLER_PREFIX to /home/ian/src/lilypond/build/lily/out/.. warning: no such directory: /home/ian/src/lilypond/build/lily/out/../bin for PATH Setting GUILE_MIN_YIELD_1 to 65 Setting GUILE_MIN_YIELD_2 to 65 Setting GUILE_MIN_YIELD_MALLOC to 65 Setting GUILE_INIT_SEGMENT_SIZE_1 to 10485760 Setting GUILE_MAX_SEGMENT_SIZE to 104857600 LILYPOND_DATADIR="/usr/local/share/lilypond/2.17.19" LOCALEDIR="/usr/local/share/locale" Effective prefix: "/home/ian/src/lilypond/build/lily/share/lilypond/2.17.19" Guile/Scheme load path main.cc,263: %load-path= "("/home/ian/src/lilypond/build/lily/share/lilypond/2.17.19/scm" "/home/ian/src/lilypond/build/lily/share/lilypond/2.17.19" "/usr/local/share/guile/site" "/usr/local/share/guile/1.8" "/usr/local/share/guile" )" PATH="/home/ian/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" [#f] ERROR: In procedure primitive-load-path: ERROR: Unable to find file "lily.scm" in load path [Inferior 1 (process 14272) exited with code 01] (gdb) ======================================================================= I'd like to collect information for any work-rounds people have employed so we can document this in the CG. The only stuff we have about using C++ debuggers is an old .gdbinit file from Han-Wen. David, Mike, Keith, Phil it's obvious from your posts and patches that you're able to massage gdb to get past this so you can do some *useful* debugging. Could you guys let me know what you do in the way of setting things for gdb so I can get a patch in to make sure it's in the CG. If something about this is already in the CG, please point me to it so I maybe make it easier to find for people on GNU development learning curve. Version information: OS: Ubuntu 13.04 LilyPond: 2.17.19 Gdb: 7.5.91.20130417-cvs-ubuntu, configured as "i686-linux-gnu" Copy of .gdbinit in the git repository directory: ----------------------------------------------------------------------- ian@nanny-ogg ~/src/lilypond/build (T3154)$ cat ../.gdbinit file ~/src/lilypond/build/out/bin/lilypond #cd ~/src/lilypond/ b programming_error b Grob::programming_error define ps print ly_display_scm($arg0) end define pgrob print ly_display_scm($arg0->self_scm_) print ly_display_scm($arg0->mutable_property_alist_) print ly_display_scm($arg0->immutable_property_alist_) print ly_display_scm($arg0->object_alist_) end define pmusic print ly_display_scm($arg0->self_scm_) print ly_display_scm($arg0->mutable_property_alist_) print ly_display_scm($arg0->immutable_property_alist_) end ======================================================================= The start-up/guile initialization/relocation code is fairly complicated and fragile, and I think some things gdb have changed for this version may have broken it, for instance you specifically have to enable a .gdbinit which is not in your default home folder by adding this to your ~/.gdbinit: add-auto-load-safe-path /home/ian/src/lilypond/.gdbinit I'll continue poking at this myself, but I'd appreciate any insights other developers can give. Cheers, Ian _______________________________________________ bug-lilypond mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-lilypond
