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 334090 - Crash while saving file during an in-progress transaction edit.
Crash while saving file during an in-progress transaction edit.
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Register
git-master
Other Linux
: Normal critical
: ---
Assigned To: David Hampton
Chris Shoemaker
: 334482 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-03-10 03:39 UTC by Chris Shoemaker
Modified: 2018-06-29 20:59 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Chris Shoemaker 2006-03-10 03:39:09 UTC
I just ran into a crash from an assertion I added a week or so ago:

** ERROR **: file Account.c: line 277 (xaccFreeAccount): assertion failed: (acc->splits == NULL)

Specifically, this happens because there is a transaction currently being edited in the register when I click 'quit' and then select 'save'.

The Splits in the account don't get removed because their transaction's edit level is never dropping to zero.

NOTE: Before I added this assertion, this was a silent data-corruption bug.  It would have silent persisted parts of the in-progress transaction, even if it they did not balance.  And since the imbalance checks were disabled during book shutdown (read saving) the imbalanced transaction would be saved without balancing.

IOW, it would save a transaction like this:

<gnc:transaction version="2.0.0">
  <trn:id type="guid">8ce250fc0b815d91116f11efa2de0f23</trn:id>
  <trn:currency>
    <cmdty:space>ISO4217</cmdty:space>
    <cmdty:id>USD</cmdty:id>
  </trn:currency>
  <trn:date-posted>
    <ts:date>2005-11-10 00:00:00 -0500</ts:date>
  </trn:date-posted>
  <trn:date-entered>
    <ts:date>2005-12-22 22:11:07 -0500</ts:date>
    <ts:ns>40909000</ts:ns>
  </trn:date-entered>
  <trn:description>in progress edit</trn:description>
  <trn:splits>
    <trn:split>
      <split:id type="guid">476ea7f89b8612f66dd74e5db483f23b</split:id>
      <split:memo>in progress</split:memo>
      <split:reconciled-state>y</split:reconciled-state>
      <split:reconcile-date>
        <ts:date>2005-11-08 00:00:00 -0500</ts:date>
      </split:reconcile-date>
      <split:value>100/100</split:value>
      <split:quantity>100/100</split:quantity>
      <split:account type="guid">70d78e08aca2da44b026d95e8f2142d6</split:account>
    </trn:split>
    <trn:split>
      <split:id type="guid">900fcbca0016d8f62c66a2bb2dcf6d30</split:id>
      <split:memo>in progress2</split:memo>
      <split:reconciled-state>n</split:reconciled-state>
      <split:value>-83333/100</split:value>
      <split:quantity>-83333/100</split:quantity>
      <split:account type="guid">5340a7a55e6d9cba3f73d3c81ae604d6</split:account>
    </trn:split>
  </trn:splits>
</gnc:transaction>


(Note the imbalance.)


What should happen:
  The register should ask 'record, discard, etc?' before saving the file.

I've verified this was silent data-corruption in pre-r13434 and I've encountered the assertion failure in r13533.
Comment 1 Christian Stimming 2006-03-10 13:52:14 UTC
Is this related to bug#155327 ?
Comment 2 Chris Shoemaker 2006-03-10 14:53:12 UTC
Re: comment #1, no, not related.
Comment 3 David Hampton 2006-03-13 04:38:31 UTC
Fixed in 13615.
Comment 4 Christian Stimming 2006-03-13 10:52:08 UTC
So can the bug be closed?
Comment 5 Andreas Köhler 2006-03-15 00:10:22 UTC
*** Bug 334482 has been marked as a duplicate of this bug. ***
Comment 6 Chris Shoemaker 2006-03-17 20:09:01 UTC
I'm still hitting this bug in a slightly different scenario.  I don't hit it when clicking 'quit' or 'save' but when trying to open another file, which implicitly pops up the save dialog for the currently open book.

I think it might be a better approach to just require that the in-progress edit be completed before allowing the register to lose focus.  This would keep a "shorter account" (bad pun, I know) of open transactions.

I don't really see much benefit in keeping multiple transactions open concurrently.
Comment 7 Christian Stimming 2006-04-18 13:27:46 UTC
Not yet closed (in 1.9.5), is it?
Comment 8 Chris Shoemaker 2006-04-28 17:19:39 UTC
No.  Trying to open another file while editing a transaction is still broken.

It lets you save the inconsistent state to a file and _then_ it asks you if you want to commit the transaction.  Clicking 'Cancel' is the worst-case with the crash below.   But that's not the real bug here.  The real bug is that I should be asked to commit or discard the transaction _before_ saving the file.

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 20637)

  • #0 gnc_split_register_get_info
    at split-register-util.c line 68
  • #1 gnc_split_register_current_trans_expanded
    at split-register.c line 211
  • #2 gnc_plugin_page_register_ui_update
    at gnc-plugin-page-register.c line 621
  • #3 gnc_plugin_page_register_refresh_cb
    at gnc-plugin-page-register.c line 2802
  • #4 gnc_gui_refresh_internal
    at gnc-component-manager.c line 762
  • #5 gnc_gui_refresh_all
    at gnc-component-manager.c line 809
  • #6 gnc_post_file_open
    at gnc-file.c line 811
  • #7 gnc_file_open_file
    at gnc-file.c line 852
  • #8 gnc_plugin_file_history_cmd_open_file
    at gnc-plugin-file-history.c line 593
  • #9 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #10 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #11 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #12 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #13 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #14 gtk_action_create_menu_item
    from /usr/lib/libgtk-x11-2.0.so.0
  • #15 gtk_action_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #16 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #17 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #18 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #19 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #20 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #21 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #22 gtk_menu_shell_activate_item
    from /usr/lib/libgtk-x11-2.0.so.0
  • #23 gtk_menu_shell_activate_item
    from /usr/lib/libgtk-x11-2.0.so.0
  • #24 gtk_menu_reorder_child
    from /usr/lib/libgtk-x11-2.0.so.0
  • #25 gtk_marshal_VOID__UINT_STRING
    from /usr/lib/libgtk-x11-2.0.so.0
  • #26 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #27 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #28 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #29 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #30 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #31 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #32 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #33 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #34 gdk_screen_get_setting
    from /usr/lib/libgdk-x11-2.0.so.0
  • #35 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #36 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #37 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #38 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #39 gnc_ui_start_event_loop
    at gnc-gnome-utils.c line 368
  • #40 inner_main
    at gnucash-bin.c line 472
  • #41 scm_boot_guile
    from /usr/lib/libguile.so.12
  • #42 main
    at gnucash-bin.c line 508

Comment 9 David Hampton 2006-04-28 20:47:21 UTC
Fixed in r13871.
Comment 10 John Ralls 2018-06-29 20:59:15 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=334090. Please update any external references or bookmarks.