After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794730 - SIGSEGV when entering an exchange rate
SIGSEGV when entering an exchange rate
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: General
2.7.x
Other Linux
: Normal major
: ---
Assigned To: gnucash-general-maint
gnucash-general-maint
: 794791 794823 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2018-03-27 14:55 UTC by François Guerraz
Modified: 2018-06-30 00:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace (7.98 KB, text/plain)
2018-03-27 14:55 UTC, François Guerraz
  Details
Test case (7.36 KB, application/x-gnucash)
2018-03-27 16:55 UTC, François Guerraz
  Details
Simpler Test Case (153.29 KB, application/x-gnucash)
2018-03-29 23:51 UTC, Emi Bemol
  Details
Fixes mismatch between post button and post function. (2.45 KB, patch)
2018-03-30 18:24 UTC, John Ralls
committed Details | Review

Description François Guerraz 2018-03-27 14:55:42 UTC
Created attachment 370197 [details]
backtrace

In 2.7.8, entering an exchange rate when posting an invoice in a foreign currency, the application crashes whith the attached backtrace.
Comment 1 François Guerraz 2018-03-27 15:15:04 UTC
In 2.7.6, it doesn't crash but the invoice is not posted properly (it's possible to enter a payment but the post button is still active and nothing appears in the A/R account of the currency).
Comment 2 Geert Janssens 2018-03-27 16:47:19 UTC
Thanks for your report. However I can't reproduce it on my test system.

Can you provide more detailed steps of what you did ? And perhaps a small sample file in which I can reproduce ?
Comment 3 François Guerraz 2018-03-27 16:55:24 UTC
Created attachment 370211 [details]
Test case

To reproduce, try to post invoice 000002
Comment 4 John Ralls 2018-03-27 17:02:44 UTC
This smells rather like bug 794360. Have a look at https://github.com/Gnucash/gnucash/pull/319 for the discussion as Bob and I worked out the actual root cause.
Comment 5 François Guerraz 2018-03-27 17:15:07 UTC
2.7.8 includes PR 319 so that shouldn't happen, right?
Comment 6 François Guerraz 2018-03-27 17:25:34 UTC
nvm, I guess you meant it's the same kind of issue.
Comment 7 John Ralls 2018-03-27 17:46:30 UTC
(In reply to François Guerraz from comment #6)
> nvm, I guess you meant it's the same kind of issue.

Exactly.
Comment 8 François Guerraz 2018-03-28 07:53:25 UTC
I feel like the crash and the accounting issue may be separate as the stable (GTK2) version doesn't crash but still doesn't post the invoice properly.
1) Should I open a separate issue?
2) Any idea of a workaround? I'm currently stuck not being able to invoice this customer....
Comment 9 John Ralls 2018-03-29 22:47:32 UTC
*** Bug 794791 has been marked as a duplicate of this bug. ***
Comment 10 John Ralls 2018-03-29 22:50:26 UTC
*** Bug 794823 has been marked as a duplicate of this bug. ***
Comment 11 John Ralls 2018-03-29 23:15:20 UTC
Try this:
diff --git a/gnucash/gnome-utils/dialog-transfer.c b/gnucash/gnome-utils/dialog-transfer.c
index beab40a..13204f0 100644
--- a/gnucash/gnome-utils/dialog-transfer.c
+++ b/gnucash/gnome-utils/dialog-transfer.c
@@ -2054,8 +2054,8 @@ close_handler (gpointer user_data)

     gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW (dialog));
     gtk_widget_hide (dialog);
-    gtk_widget_destroy (dialog);
     gnc_xfer_dialog_close_cb(GTK_DIALOG(dialog), xferData);
+    gtk_widget_destroy (dialog);
     g_free (to_info);
     to_info = NULL;
     g_free (from_info);

It removes an assertion message in Debian Unstable.
Comment 12 Emi Bemol 2018-03-29 23:51:38 UTC
Created attachment 370321 [details]
Simpler Test Case

Hello, I come from 794823. After messing around for an hour debugging the obfuscating script (that's quite outdated and doesn't work, btw) I finally managed to make a test case that's quite simpler.

Steps to this testcase:
- Open [Assets:1 - Local Currency Asset]
- Make a transaction against [Expenses:Accounted in Local Currency]
- Works fine.

- Now open [Assets:2 - Foreign Currency Asset]
- Make a transaction against [Expenses:Accounted in Local Currency]
- Transfer Funds dialog opens
- Do anything: OK, Cancel or close the window
- Segfault.
Comment 13 Emi Bemol 2018-03-30 00:12:49 UTC
Just tested John Ralls patch (comment 11), can confirm it fixes the issue.
Comment 14 François Guerraz 2018-03-30 10:15:11 UTC
So this patch fixes the crash indeed.

But it's only part of the problem. As I mentioned, even with the stable version, with the test case I proposed, the invoice doesn't get posted and the transaction doesn't appear in the A/R.
Comment 15 François Guerraz 2018-03-30 10:18:13 UTC
FYI, the test-case is created using these instructions:

https://lists.gnucash.org/pipermail/gnucash-user/2004-September/011572.html
Comment 16 John Ralls 2018-03-30 18:24:05 UTC
Created attachment 370352 [details] [review]
Fixes mismatch between post button and post function.

I have a different result: The cross-currency invoice won't post and no transaction is created. I traced that to a couple of problems addressed in this patch. I've already pushed it, but if you're working from a tarball you might find it more convenient to apply it from here.

Once that's patched I find that GnuCash unstable posts your invoice correctly with both splits present.

Please test it on Arch.
Comment 17 François Guerraz 2018-03-30 20:12:21 UTC
I must be rubbish at expressing myself, but that's exactly what I meant, and your patch fixed it.

Thanks a ton!

If there's anything I can do to support the project (donation?) I'll be glad to contribute.
Comment 18 John Ralls 2018-03-30 20:19:03 UTC
We don't really have much need for money. We need volunteers to write code, write documentation, translate, do publicity, help users on the mailing list and IRC, and recruit more volunteers.
Comment 19 Strangiato 2018-04-19 14:25:00 UTC
volunteers can not work in full time to create good and stable software.
Comment 20 John Ralls 2018-06-30 00:06:05 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=794730. Please update any external references or bookmarks.