Removal of static mergeData context

Derek Atkins warlord at MIT.EDU
Sat Jan 15 14:48:17 EST 2005


Applied to HEAD.

We can work on debugging this once I commit.

-derek

Neil Williams <linux at codehelp.co.uk> writes:

> This is the patch for qof_book_merge that removes all calls to a static 
> qof_book_mergeData struct or static qof_book_mergeRule struct.
>
> There are also improvements to the targetting - how to use the differences 
> between entities to determine which is the best match. This is done, as ever, 
> in a completely generic manner and don't be surprised if some of the matches 
> appear counter-intuitive. The merge code only deals with the QofObject and 
> QofClass parameters and it may sometimes pair an expense with a liability. 
> This code can be improved.
>
> I'm getting SIGSEGV in Group.c when saving files that have been merged 
> successfully. gdb reports it as xaccGroupGetNumSubAccounts().
> Reproduce:
> Start GnuCash with --nofile
> File -> New (I always test with a Childcare Expenses new file, just 2 
> accounts, no other data.)
> File -> Add New Hierarchy (I test with adding a Car Loan).
> In the merge dialog, set each collision as NEW.
> Save
>
> xaccGroupGetNumSubAccounts (grp=0x8002975) at Group.c:384
> 384       num_acc = g_list_length (grp->accounts);
>
> (gdb) bt
> #0  xaccGroupGetNumSubAccounts (grp=0x8002975) at Group.c:384
> #1  0x403ed5ed in xaccGroupGetNumSubAccounts (grp=0x83f61c0) at Group.c:390
> #2  0x4046925f in gnc_book_write_to_xml_filehandle_v2 (book=0x8164e80, 
> out=0x830e488) at io-gncxml-v2.c:1081
> #3  0x4046967a in gnc_book_write_to_xml_file_v2 (book=0x0, filename=0x0, 
> compress=0) at io-gncxml-v2.c:1202
> #4  0x40458815 in gnc_file_be_write_to_file (fbe=0x82f2550, book=0x8164e80, 
> datafile=0x82f25c0 "/opt/fixing/temp/10",
>     make_backup=1) at gnc-backend-file.c:494
> #5  0x40459239 in file_sync_all (be=0x82f2550, book=0x8164e80) at 
> gnc-backend-file.c:705
> #6  0x4043752d in qof_session_save (session=0x8323c08, 
> percentage_func=0x409ae5b0 <gnc_mdi_show_progress>)
>     at qofsession.c:690
> #7  0x40449dcb in gnc_file_save () at gnc-file.c:746
> #8  0x4044a156 in gnc_file_save_as () at gnc-file.c:903
> #9  0x40449d5c in gnc_file_save () at gnc-file.c:738
> #10 0x4039d949 in gnc_main_window_file_save_cb (widget=0x8321758, data=0x0) at 
> window-main.c:485
>
> Work is ongoing.
>
> -- 
>
> Neil Williams
> =============
> http://www.dclug.org.uk/
> http://www.nosoftwarepatents.com/
> http://sourceforge.net/projects/isbnsearch/
> http://www.williamsleesmill.me.uk/
> http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3
>
>
> _______________________________________________
> gnucash-patches mailing list
> gnucash-patches at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-patches

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-patches mailing list