annoying simple Guile question

Neil Williams linux at
Tue Sep 21 13:20:49 EDT 2004

When running a console application that uses guile via gnucash-env, how do I 

I free the memory I used, I call gnc_engine_shutdown() but the program hangs, 
waiting for a Ctrl-C. I've checked and all the usual tidying up functions are 
called without errors - it exits normally when allowed to complete the 
program, but if there's an error or if the user simply wants to abort, I 
can't get it to exit.

exit(1); is no help.

I have put error handlers at the start of every function that would be called 
after the abort to cause the function to return if abort is set, no odds.

The code itself has changed many times but this problem has remained since I 
started using it via guile to get access to the file backend to read the 
QofBook data from external files. It's the example code here:
(the new home for my code - codehelp doesn't have the space)

(gdb) continue

Program received signal SIGINT, Interrupt.
[Switching to Thread 16384 (LWP 30982)]
0x402b94fd in mallopt () from /lib/
#0  0x402b94fd in mallopt () from /lib/
#1  0x402b8d08 in mallopt () from /lib/
#2  0x402b7ef3 in malloc () from /lib/
#3  0x414ac2ee in operator new () from /usr/lib/
#4  0x414ac41f in operator new[] () from /usr/lib/
#5  0x415cd142 in OpenSP::String<char>::resize () from /usr/lib/
#6  0x415ccf8c in OpenSP::FileOutputByteStream::flush () 
from /usr/lib/
#7  0x415ccf09 in OpenSP::FileOutputByteStream::close () 
from /usr/lib/
#8  0x415ccd40 in OpenSP::FileOutputByteStream::~FileOutputByteStream () 
from /usr/lib/
#9  0x41583c42 in OpenSP::CmdLineApp::closeFileErrorMessage () 
from /usr/lib/
#10 0x40272ae2 in exit () from /lib/
#11 0x4010451d in scm_init_guile () from /usr/lib/
#12 0x4010420b in scm_boot_guile () from /usr/lib/
#13 0x0804a2da in main_helper (closure=0x1, argc=1077375036, argv=0x4037703c) 
at example-gncBookMerge.c:282
#14 0x4025cdc6 in __libc_start_main () from /lib/
#15 0x08049891 in ?? ()


Neil Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the gnucash-devel mailing list