Guile Strings

John Ralls jralls at ceridwen.us
Sat Dec 31 14:01:40 EST 2011


On Dec 31, 2011, at 1:59 AM, Geert Janssens wrote:

> Op vrijdag 30 december 2011 15:18:30 schreef John Ralls: 
>> As you can see, it's allocating a string on the heap and returning it, so
>> either the strings are already getting freed or we're already leaking them.
>> 
>> So I went ahead and built swig with the patch from the bug and gave it a
>> spin. It did indeed silence the deprecation warnings in guile-1.8.8.
>> 
> That's already good.
> 
>> Unfortunately guile-2.0 appears to have changed the way that extensions are
>> loaded, because with guile-2.0 installed make check fails with
>> 
>> ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
>> ;;;       or pass the --no-auto-compile argument to disable.
>> ;;; compiling
>> /Volumes/RAID1/Gnucash-Build/Gnucash-svn/src/gnucash-git/src/engine/test/./
>> test-create-account.scm ;;; note: source file
>> /Volumes/RAID1/Gnucash-Build/Gnucash-svn/src/gnucash-git/src/gnc-module/gnc
>> -module.scm ;;;       newer than compiled
>> /Users/john/.cache/guile/ccache/2.0-LE-4-2.0/Volumes/RAID1/Gnucash-Build/Gn
>> ucash-svn/src/gnucash-git/src/gnc-module/gnc-module.scm.go ;;; compiling
>> /Volumes/RAID1/Gnucash-Build/Gnucash-svn/src/gnucash-git/src/gnc-module/gnc
>> -module.scm ;;; WARNING: compilation of
>> /Volumes/RAID1/Gnucash-Build/Gnucash-svn/src/gnucash-git/src/gnc-module/gnc
>> -module.scm failed: ;;; ERROR: no code for module (sw_gnc_module)
>> ./test-create-account: line 2: 80147 Bus error               guile -l
>> $SRCDIR/test-create-account.scm -c "(exit (run-test))"
>> 
>> I poked at it briefly, but it couldn't get it to work.
> 
> Have you tried with environment variable GUILE_AUTO_COMPILE=0 set ? You may 
> need to remove the already autocompiled modules from /Users/john/.cache/guile 
> also.
> 
> I read somewhere [1] that guile 2 can either precompile modules for 
> performance or use the old interpreted mechanism. I never found explicit 
> documentation on how to select one or the other, but as I understand it you 
> have to disable auto compilation to get the interpreter.

Yes. It only reduces the spew, it doesn't fix the segfault at the end.

The key is in "ERROR: no code for module (sw_gnc_module)", and after debugging into it with the Guile interpreter I've established that Guile 2.0 changes the way that it loads C libraries. I could only get (dynamic-link) to find a library in /usr/lib. It ignores LD_LIBRARY_PATH and DYLD_LIBRARY_PATH and won't load even with an absolute path (though the documentation implies that it should).

I'm going to have to go code-diving in the Guile-2 sources to figure this out, but not right now.

Regards,
John Ralls





More information about the gnucash-devel mailing list