GnuCash
Contact   Instructions
Bug 797924 - Crash when searching for customer to process payment
Summary: Crash when searching for customer to process payment
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Business (show other bugs)
Version: 4.2
Hardware: PC Mac OS
: Normal major
Target Milestone: ---
Assignee: core
QA Contact: core
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-28 00:57 EDT by Adrien
Modified: 2021-01-30 16:05 EST (History)
5 users (show)

See Also:


Attachments
Crash Report (14.12 KB, text/plain)
2020-08-28 00:57 EDT, Adrien
no flags Details
Trace File (10.70 KB, text/plain)
2020-08-28 00:57 EDT, Adrien
no flags Details
Crash Report 2 (14.16 KB, text/plain)
2021-01-05 11:36 EST, Adrien
no flags Details
TraceFile 2 (1.49 MB, text/plain)
2021-01-05 11:44 EST, Adrien
no flags Details

Description Adrien 2020-08-28 00:57:17 EDT
Created attachment 373846 [details]
Crash Report

I attempted to Process Payment for a customer. While typing in the beginning of the customer name, GnuCash crashed before I could get a list to select from.

Crash Report and Trace File attached.

Not sure I'll be able to reproduce this one, but I'll try if needed.
Comment 1 Adrien 2020-08-28 00:57:47 EDT
Created attachment 373847 [details]
Trace File
Comment 2 Adrien 2020-08-28 01:01:52 EDT
Sure enough, after relaunching and re-attempting to Process Payment, everything worked as expected.

If it helps any, my tabs upon re-opening were different. I had changed them since the last time I opened GnuCash, and instead of restoring the tabs at the point of the crash, it restored at the point of the last successful close.

It appears that all intervening transactions however, are correct and in place.
Comment 3 John Ralls 2020-08-28 12:02:40 EDT
The state file is written out only at the end of the session (i.e. when you quit or open a different book) so it's no surprise that your tabs weren't restored. I thought I remembered a bug about that but now I can't find it.

The trace file shows that Chris Lam missed a couple of spots in the (_ -> (G_ transition (and grep finds a bunch more). It also shows a lot of 

* 12:05:50 ERROR <gnc.ledger> [gnc_split_register_get_trans_split()] bad row 
* 12:05:50 ERROR <gnc.register.gnome> gnucash_sheet_cursor_set_from_table: assertion 'gnucash_sheet_cell_valid (sheet, v_loc)' failed

throughout what appears to be a 3-day session suggesting a problem with one of your accounts. However the last one was 11 minutes before the crash so it's probably unrelated.

I do think I see what crashed so I'll push a fix. Without being able to reliably reproduce the crash though we'll never know if I'm right.
Comment 4 John Ralls 2020-08-28 14:29:37 EDT
> The trace file shows that Chris Lam missed a couple of spots in the (_ -> (G_ transition (and grep finds a bunch more). 

Didn't read that backtrace right. It's reporting an unbound variable '_' in your custom consolidate-transacations.scm at line 117.
Comment 5 John Ralls 2020-08-28 14:32:11 EDT
I've pushed a commit to prevent the crash I imagine in gnc_general_search_set_selected and since we'll likely never know if that's the actual problem I'm closing this.
Comment 6 Adrien 2020-08-28 14:36:20 EDT
Thanks John. Should it repeat, I'll let you know.
Comment 7 Adrien 2021-01-05 11:35:28 EST
I got another crash recently at this same point in the workflow. (though I think this time I got a list of Vendors, and had just hit TAB to select one)

I'm attaching crash reports (which took some time before it generated) and a TraceFile.
Comment 8 Adrien 2021-01-05 11:36:01 EST
Created attachment 373968 [details]
Crash Report 2
Comment 9 Adrien 2021-01-05 11:44:54 EST
Created attachment 373969 [details]
TraceFile 2
Comment 10 Adrien 2021-01-05 11:57:19 EST
Upping to 4.2 since that is my current version. Will upgrade to 4.4 shortly, but can't guarantee that it will repeat of course.
Comment 11 John Ralls 2021-01-30 16:05:28 EST
I see the problem. At https://github.com/Gnucash/gnucash/blob/maint/gnucash/gnome-search/gnc-general-search.c#L513:

        priv->guid = * ((GncGUID *)(get_guid->param_getfcn
                                    (gsl->selected_item, get_guid)));
tries to dereference the return value of get_guid->param_getfcn(). If that's NULL it crashes.

The ASM is 
libgnc-gnome-search.dylib[0xea67] <+359>: callq  *0x10(%rsi)
libgnc-gnome-search.dylib[0xea6a] <+362>: movq   (%rax), %rcx

362 is the index of the crash in the second crash report.

Fixed in 029f3283e for 4.5.

Note You need to log in before you can comment on or make changes to this bug.