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 340125 - Crash when closing a book
Crash when closing a book
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: Register
git-master
Other Linux
: Normal critical
: ---
Assigned To: Chris Shoemaker
Chris Shoemaker
Depends on:
Blocks:
 
 
Reported: 2006-04-29 16:32 UTC by Bengt Thuree
Modified: 2018-06-29 21:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GnuCash file (1.96 KB, application/x-compressed-tar)
2006-04-29 16:34 UTC, Bengt Thuree
Details

Description Bengt Thuree 2006-04-29 16:32:55 UTC
Backtrace was generated from '/home/bengt/unstable/gnucash/bin/gnucash'

I got into a weird state in a bank account after trying to purchase a foreign stock (HK) and deleted a lot of lines. 
So, I decided to reload the datafile, and got this crash.

Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread -1230043456 (LWP 6314)]
0xffffe410 in __kernel_vsyscall ()

Thread 1 (Thread -1230043456 (LWP 6314))

  • #0 __kernel_vsyscall
  • #1 __waitpid_nocancel
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 libgnomeui_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #3 <signal handler called>
  • #4 __kernel_vsyscall
  • #5 raise
    from /lib/tls/i686/cmov/libc.so.6
  • #6 abort
    from /lib/tls/i686/cmov/libc.so.6
  • #7 g_logv
    from /usr/lib/libglib-2.0.so.0
  • #8 g_log
    from /usr/lib/libglib-2.0.so.0
  • #9 g_assert_warning
    from /usr/lib/libglib-2.0.so.0
  • #10 xaccFreeAccount
    at Account.c line 278
  • #11 acc_free
    at Account.c line 333
  • #12 qof_commit_edit_part2
    at qofutil.c line 300
  • #13 xaccAccountCommitEdit
    at Account.c line 404
  • #14 xaccAccountDestroy
    at Account.c line 413
  • #15 xaccFreeAccountGroup
    at Group.c line 298
  • #16 xaccAccountCommitEdit
    at Account.c line 363
  • #17 xaccAccountDestroy
    at Account.c line 413
  • #18 xaccFreeAccountGroup
    at Group.c line 298
  • #19 xaccAccountCommitEdit
    at Account.c line 363
  • #20 xaccAccountDestroy
    at Account.c line 413
  • #21 xaccFreeAccountGroup
    at Group.c line 293
  • #22 xaccAccountGroupDestroy
    at Group.c line 247
  • #23 xaccCollSetAccountGroup
    at Group.c line 98
  • #24 xaccSetAccountGroup
    at Group.c line 123
  • #25 group_book_end
    at Group.c line 1249
  • #26 qof_object_book_end
    at qofobject.c line 83
  • #27 qof_book_destroy
    at qofbook.c line 118
  • #28 qof_session_destroy
    at qofsession.c line 1354
  • #29 gnc_clear_current_session
    at gnc-session.c line 63
  • #30 gnc_post_file_open
    at gnc-file.c line 629
  • #31 gnc_plugin_file_history_cmd_open_file
    at gnc-plugin-file-history.c line 593
  • #32 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #33 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #34 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #35 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #36 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #37 _gtk_action_emit_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #38 gtk_action_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #39 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #40 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #41 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #42 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #43 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #44 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #45 gtk_menu_shell_activate_item
    from /usr/lib/libgtk-x11-2.0.so.0
  • #46 gtk_menu_shell_activate_item
    from /usr/lib/libgtk-x11-2.0.so.0
  • #47 gtk_menu_reorder_child
    from /usr/lib/libgtk-x11-2.0.so.0
  • #48 _gtk_marshal_BOOLEAN__BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #49 g_cclosure_new_swap
    from /usr/lib/libgobject-2.0.so.0
  • #50 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #51 g_signal_stop_emission
    from /usr/lib/libgobject-2.0.so.0
  • #52 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #53 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #54 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #55 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #56 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #57 _gdk_events_queue
    from /usr/lib/libgdk-x11-2.0.so.0
  • #58 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #59 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #60 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #61 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #62 gnc_ui_start_event_loop
    at gnc-gnome-utils.c line 368
  • #63 inner_main
    at gnucash-bin.c line 476
  • #64 scm_boot_guile
    from /usr/lib/libguile.so.12
  • #65 main
    at gnucash-bin.c line 512
  • #0 __kernel_vsyscall

Comment 1 Bengt Thuree 2006-04-29 16:34:29 UTC
Created attachment 64525 [details]
GnuCash file

The following appears on the console:

** ERROR **: file Account.c: line 278 (xaccFreeAccount): assertion failed: (acc->splits == NULL)
Comment 2 Derek Atkins 2006-04-29 16:41:11 UTC
If you look in /tmp/gnucash.trace I bet you'll see more information..  In particular, I bet you'll see this error:

    PERR (" instead of calling xaccFreeAccount(), please call \n"
          " xaccAccountBeginEdit(); xaccAccountDestroy(); \n");

Something is clearly wrong with the destroy path.  I suspect this is
Chris' fault ;)
Comment 3 Derek Atkins 2006-04-29 16:54:42 UTC
Okay, working with Bengt on IRC, this problem happens when the current book is being closed.

<bengt> do you want me to do close or quit?
<warlord> shouldn't matter
<bengt> ** ERROR **: file Account.c: line 278 (xaccFreeAccount): assertion failed: (acc->splits == NULL)

I've changed the subject to be a little more accurate.
Comment 4 Bengt Thuree 2006-04-29 16:56:28 UTC
The step by step procedure to reproduce this one is as follows.

1) Set opening balace to 100,000 HKD into HK Bank
2) Open HK Bank
3) Create a Purchase Split as below
  HK Bank         -50,000
  Expenses:Com:HK -1,000
  Stock:HK         49,000
ENTER
4) Check the Opening Balance transaction
5) Re open the purchase transaction
6) highlight the stock purchase row, and right click and select Edit Exchange
Data
7) Click To Amount
8) Press Cancel
9) Press DELETE
10) Press delete on the headline for this purchase transaction -> do not work
11) File -> Quit
(or reload)
Comment 5 Bengt Thuree 2006-04-29 17:03:08 UTC
the /tmp/gnucash.trace has the following entry

Warning: xaccSplitAssignToLot(): split with zero amount; value=0/10000 gflag=ff gsplit=(nil)
Error: xaccFreeAccount():  instead of calling xaccFreeAccount(), please call
 xaccAccountBeginEdit(); xaccAccountDestroy();
Comment 6 Chris Shoemaker 2006-04-29 22:07:46 UTC
In Comment #4, does step 1 mean to create a new account or enter a transaction into an existing account using the register?

in step 3) the transaction doesn't balance.  Is that intentional?

Also, I can't seem to correlate the accounts in the instructions with the accounts in the file.

What does step 5 mean?  Click the 'Split' toolbar button?  Which register mode is this?

In step 6, which row is the stock purchase row?

I'm not sure what row you mean in step 9.

I can see the problem in step 10.
Comment 7 Chris Shoemaker 2006-04-29 22:51:08 UTC
Ok, and in step 11, I chose 'quit w/o saving' and am able to reproduce.

Actually, I've been able to reproduce in fewer steps, but steps 9 and 10 seem essential.
Comment 8 Bengt Thuree 2006-04-29 23:54:08 UTC
Great  :)
Sorry, it was a bit late when I did all the testing here. (again...)
And I did not try to get a small step by step sequence, just trying to be able to reproduce it... :)

3) Create a Purchase Split as below
  HK Bank         -50,000
  Expenses:Com:HK   1,000
  Stock:HK         49,000
4) Check the Opening Balance transaction
5) Re open the purchase transaction (Click the Split toolbar button, basic ledger)
6) highlight the stock purchase row, and right click and select Edit Exchange
Data (stock purchase row = assets:investments:Borkerage Account:Boom:0694.HK)
7) Click To Amount
8) Press Cancel (I regreted setting the number of stocks, so pressed CANCEL)
9) Press DELETE (in the toolbar)



Let me know if I should try to explain a bit more :)
Comment 9 Chris Shoemaker 2006-04-30 00:46:51 UTC
Ok, should be fixed in r13883.
Comment 10 John Ralls 2018-06-29 21:02:53 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=340125. Please update any external references or bookmarks.