Seg fault while writing file

John David Ravenscroft j.ravenscroft at gmail.com
Sat May 28 16:59:23 EDT 2016


Thanks John.

 I have a much larger stack trace this time. The end of the trace file
looks like it dies somewhere between counting gncEntry objects and
gncInvoice objects. Earlier on in using gnuCash, I manually removed some
invoices I'd created while trying to get gnucash to calculate tax on a
gross amount (for a specific scheme in the UK). I gave up on that and
removed the test invoices from the file. Might That have caused this, later
down the line?

Below is stack, followed by last few lines of tracefile:

Reading symbols from gnucash...Reading symbols from
/usr/lib/debug/.build-id/cf/b382061b2f465013eeb6f5974e2540f07e6e2c.debug...done.
done.
(gdb) run --debug
Starting program: /usr/bin/gnucash --debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffdd1fd700 (LWP 14623)]
[New Thread 0x7fffdc9fc700 (LWP 14624)]
[New Thread 0x7fffca0bf700 (LWP 14626)]
Found Finance::Quote version 1.18
[New Thread 0x7fffc8c04700 (LWP 14627)]
[Thread 0x7fffc8c04700 (LWP 14627) exited]
[New Thread 0x7fffc8c04700 (LWP 14630)]

Program received signal SIGSEGV, Segmentation fault.
g_type_check_instance_cast (type_instance=type_instance at entry=0x1874f20,
iface_type=38926656) at /build/buildd/glib2.0-2.40.2/./gobject/gtype.c:4002
4002    /build/buildd/glib2.0-2.40.2/./gobject/gtype.c: No such file or
directory.
(gdb) bt
#0  g_type_check_instance_cast (type_instance=type_instance at entry=0x1874f20,
iface_type=38926656) at /build/buildd/glib2.0-2.40.2/./gobject/gtype.c:4002
#1  0x00007ffff4b408fa in entry_dom_tree_create (entry=0x26c0ba0) at
gnc-entry-xml-v2.c:172
#2  xml_add_entry (entry_p=0x26c0ba0, out_p=0x2991d20) at
gnc-entry-xml-v2.c:837
#3  0x00007ffff6cc4f69 in qof_object_foreach_sorted
(type_name=type_name at entry=0x7ffff4b56475 "gncEntry", book=<optimised out>,
    cb=cb at entry=0x7ffff4b40630 <xml_add_entry>,
user_data=user_data at entry=0x2991d20)
at qofobject.c:247
#4  0x00007ffff4b4025a in entry_write (out=0x2991d20, book=<optimised out>)
at gnc-entry-xml-v2.c:847
#5  0x00007ffff6ccda07 in g_hash_table_foreach_sorted (hash_table=0x7d3240,
func=0x7ffff6cc47e0 <foreach_backend>, user_data=0x7fffffffc920,
    compare_func=<optimised out>) at qofutil.c:47
#6  0x00007ffff6cc516a in qof_object_foreach_backend
(backend_name=0x1874f20 "", backend_name at entry=0x7ffff4b5564c "gnc:file:2",
cb=0x7ffff4b4e8a0 <write_data_cb>,
    user_data=0x1, user_data at entry=0x7fffffffc990) at qofobject.c:441
#7  0x00007ffff4b4ffce in write_book (gd=0x2512db0, book=0x2552a00,
out=0x2991d20) at io-gncxml-v2.c:1057
#8  gnc_book_write_to_xml_filehandle_v2 (book=book at entry=0x2552a00,
out=out at entry=0x2991d20) at io-gncxml-v2.c:1357
#9  0x00007ffff4b50179 in gnc_book_write_to_xml_file_v2
(book=book at entry=0x2552a00,

    filename=filename at entry=0x7eb920
"/home/john/RES/accounting/gnucash/2016.gnucash.tmp-h5PlIg", compress=1) at
io-gncxml-v2.c:1631
#10 0x00007fffca39c658 in gnc_xml_be_write_to_file (fbe=fbe at entry=0x257a800,
book=book at entry=0x2552a00,
    datafile=0x7a83d0 "/home/john/RES/accounting/gnucash/2016.gnucash",
make_backup=1) at gnc-backend-xml.c:732
#11 0x00007fffca39ccc7 in xml_sync_all (be=0x257a800, book=0x2552a00) at
gnc-backend-xml.c:1009
#12 0x00007ffff6cccf71 in qof_session_save (session=session at entry=0x1d79310,
percentage_func=0x7ffff78ec8e0 <gnc_window_show_progress>) at
qofsession.c:753
#13 0x00007ffff7899e71 in gnc_file_save () at gnc-file.c:1294
#14 0x00007ffff7b87a85 in gnc_main_window_cmd_file_save (action=<optimised
out>, data=0x244b480) at gnc-plugin-basic-commands.c:475
#15 0x00007ffff3a9e3b8 in g_closure_invoke (closure=0x24c9c30,
return_value=0x0, n_param_values=1, param_values=0x7fffffffcdb0,
invocation_hint=0x7fffffffcd50)
    at /build/buildd/glib2.0-2.40.2/./gobject/gclosure.c:768
#16 0x00007ffff3aafd3d in signal_emit_unlocked_R (node=node at entry=0x7b0930,
detail=detail at entry=0, instance=instance at entry=0x8841a0,
    emission_return=emission_return at entry=0x0,
instance_and_params=instance_and_params at entry=0x7fffffffcdb0) at
/build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:3551
#17 0x00007ffff3ab7a29 in g_signal_emit_valist (instance=<optimised out>,
signal_id=<optimised out>, detail=<optimised out>, var_args=var_args at entry
=0x7fffffffcf38)
    at /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:3307
#18 0x00007ffff3ab7ce2 in g_signal_emit (instance=instance at entry=0x8841a0,
signal_id=<optimised out>, detail=detail at entry=0)
    at /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:3363
#19 0x00007ffff635a1b0 in _gtk_action_emit_activate (action=0x8841a0) at
/build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtkaction.c:795
#20 0x00007ffff635a9ed in IA__gtk_action_activate (action=<optimised out>)
at /build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtkaction.c:826
#21 0x00007ffff64d7b39 in button_clicked (widget=<optimised out>,
button=0x1d6e130) at
/build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtktoolbutton.c:771
#22 0x00007ffff3a9e5e7 in _g_closure_invoke_va (closure=0x24d53d0,
return_value=0x0, instance=0x1874a80, args=0x7fffffffd218, n_params=0,
param_types=0x0)
    at /build/buildd/glib2.0-2.40.2/./gobject/gclosure.c:831
#23 0x00007ffff3ab7088 in g_signal_emit_valist (instance=0x1874a80,
signal_id=<optimised out>, detail=0, var_args=var_args at entry=0x7fffffffd218)
    at /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:3215
#24 0x00007ffff3ab7ce2 in g_signal_emit (instance=<optimised out>,
signal_id=<optimised out>, detail=<optimised out>)
    at /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:3363
#25 0x00007ffff6372585 in gtk_real_button_released (button=0x1874a80) at
/build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtkbutton.c:1712
#26 0x00007ffff3a9e5e7 in _g_closure_invoke_va (closure=0x8207b0,
return_value=0x0, instance=0x1874a80, args=0x7fffffffd4d8, n_params=0,
param_types=0x0)
    at /build/buildd/glib2.0-2.40.2/./gobject/gclosure.c:831
---Type <return> to continue, or q <return> to quit---
#27 0x00007ffff3ab7088 in g_signal_emit_valist (instance=0x1874a80,
signal_id=<optimised out>, detail=0, var_args=var_args at entry=0x7fffffffd4d8)
    at /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:3215
#28 0x00007ffff3ab7ce2 in g_signal_emit (instance=<optimised out>,
signal_id=<optimised out>, detail=<optimised out>)
    at /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:3363
#29 0x00007ffff63714d9 in gtk_button_button_release (widget=<optimised
out>, event=<optimised out>) at
/build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtkbutton.c:1604
#30 0x00007ffff6413815 in _gtk_marshal_BOOLEAN__BOXED (closure=0x65f3d0,
return_value=0x7fffffffd6d0, n_param_values=<optimised out>,
param_values=0x7fffffffd780,
    invocation_hint=<optimised out>, marshal_data=0x7ffff63714c0
<gtk_button_button_release>) at gtkmarshalers.c:86
#31 0x00007ffff3a9e3b8 in g_closure_invoke (closure=0x65f3d0,
return_value=0x7fffffffd6d0, n_param_values=2, param_values=0x7fffffffd780,
    invocation_hint=0x7fffffffd720) at
/build/buildd/glib2.0-2.40.2/./gobject/gclosure.c:768
#32 0x00007ffff3aafafb in signal_emit_unlocked_R (node=node at entry=0x65f420,
detail=detail at entry=0, instance=instance at entry=0x1874a80,
    emission_return=emission_return at entry=0x7fffffffd850,
instance_and_params=instance_and_params at entry=0x7fffffffd780)
    at /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:3589
#33 0x00007ffff3ab76f9 in g_signal_emit_valist (instance=<optimised out>,
signal_id=<optimised out>, detail=<optimised out>, var_args=var_args at entry
=0x7fffffffd918)
    at /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:3317
#34 0x00007ffff3ab7ce2 in g_signal_emit (instance=instance at entry=0x1874a80,
signal_id=<optimised out>, detail=detail at entry=0)
    at /build/buildd/glib2.0-2.40.2/./gobject/gsignal.c:3363
#35 0x00007ffff6523684 in gtk_widget_event_internal
(widget=widget at entry=0x1874a80,
event=event at entry=0x7271f0)
    at /build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtkwidget.c:5010
#36 0x00007ffff6523959 in IA__gtk_widget_event (widget=widget at entry=0x1874a80,
event=event at entry=0x7271f0)
    at /build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtkwidget.c:4807
#37 0x00007ffff6411fc4 in IA__gtk_propagate_event (widget=0x1874a80,
event=0x7271f0) at /build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtkmain.c:2509
#38 0x00007ffff641237b in IA__gtk_main_do_event (event=0x7271f0) at
/build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtkmain.c:1699
#39 0x00007ffff46be3ec in gdk_event_dispatch (source=<optimised out>,
callback=<optimised out>, user_data=<optimised out>)
    at /build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gdk/x11/gdkevents-x11.c:2425
#40 0x00007ffff6026e04 in g_main_dispatch (context=0x650e50) at
/build/buildd/glib2.0-2.40.2/./glib/gmain.c:3064
#41 g_main_context_dispatch (context=context at entry=0x650e50) at
/build/buildd/glib2.0-2.40.2/./glib/gmain.c:3663
#42 0x00007ffff6027048 in g_main_context_iterate (context=0x650e50,
block=block at entry=1, dispatch=dispatch at entry=1, self=<optimised out>)
    at /build/buildd/glib2.0-2.40.2/./glib/gmain.c:3734
#43 0x00007ffff602730a in g_main_loop_run (loop=0x25bc930) at
/build/buildd/glib2.0-2.40.2/./glib/gmain.c:3928
#44 0x00007ffff6411447 in IA__gtk_main () at
/build/gtk+2.0-KsZSEA/gtk+2.0-2.24.23/gtk/gtkmain.c:1271
#45 0x00007ffff789e589 in gnc_ui_start_event_loop () at
gnc-gnome-utils.c:620
#46 0x0000000000402cde in inner_main (closure=<optimised out>,
argc=<optimised out>, argv=<optimised out>) at gnucash-bin.c:623
#47 0x00007ffff69a442d in ?? () from /usr/lib/libguile-2.0.so.22
#48 0x00007ffff697e2ca in ?? () from /usr/lib/libguile-2.0.so.22
#49 0x00007ffff6a0fc00 in ?? () from /usr/lib/libguile-2.0.so.22
#50 0x00007ffff6987863 in scm_call_4 () from /usr/lib/libguile-2.0.so.22
#51 0x00007ffff697e9ff in ?? () from /usr/lib/libguile-2.0.so.22
#52 0x00007ffff697ea95 in scm_c_with_continuation_barrier () from
/usr/lib/libguile-2.0.so.22
#53 0x00007ffff69f778c in ?? () from /usr/lib/libguile-2.0.so.22
#54 0x00007ffff24bffe2 in GC_call_with_stack_base () from
/usr/lib/x86_64-linux-gnu/libgc.so.1
---Type <return> to continue, or q <return> to quit---
#55 0x00007ffff69f7b48 in scm_with_guile () from /usr/lib/libguile-2.0.so.22
#56 0x00007ffff69a45c5 in scm_boot_guile () from /usr/lib/libguile-2.0.so.22
#57 0x000000000040280a in main (argc=1, argv=0x7fffffffe138) at
gnucash-bin.c:778





---- Trace File ----

* 21:48:03  INFO <gnc.io> [gnc_account_dom_tree_create] lot list=(nil)
* 21:48:03  INFO <gnc.io> [gnc_account_dom_tree_create] lot list=(nil)
* 21:48:03  INFO <gnc.io> [gnc_account_dom_tree_create] lot list=(nil)
* 21:48:03  INFO <gnc.io> [gnc_account_dom_tree_create] lot list=(nil)
* 21:48:03  INFO <qof.engine> [qof_collection_foreach] Hash Table size of
Budget before is 0
* 21:48:03  INFO <qof.engine> [qof_collection_foreach] Hash Table size of
Budget after is 0
* 21:48:03  INFO <qof.object> [qof_object_foreach] type=gncBillTerm
* 21:48:03  INFO <qof.engine> [qof_collection_foreach] Hash Table size of
gncBillTerm before is 2
* 21:48:03  INFO <qof.engine> [qof_collection_foreach] Hash Table size of
gncBillTerm after is 2
* 21:48:03  INFO <qof.object> [qof_object_foreach] type=gncCustomer
* 21:48:03  INFO <qof.engine> [qof_collection_foreach] Hash Table size of
gncCustomer before is 4
* 21:48:03  INFO <qof.engine> [qof_collection_foreach] Hash Table size of
gncCustomer after is 4
* 21:48:03  INFO <qof.object> [qof_object_foreach] type=gncEmployee
* 21:48:03  INFO <qof.engine> [qof_collection_foreach] Hash Table size of
gncEmployee before is 0
* 21:48:03  INFO <qof.engine> [qof_collection_foreach] Hash Table size of
gncEmployee after is 0
* 21:48:03  INFO <qof.object> [qof_object_foreach] type=gncEntry
* 21:48:03  INFO <qof.engine> [qof_collection_foreach] Hash Table size of
gncEntry before is 17
* 21:48:03  INFO <qof.engine> [qof_collection_foreach] Hash Table size of
gncEntry after is 17


On Sat, 28 May 2016 at 21:15 John Ralls <jralls at ceridwen.us> wrote:

>
> > On May 28, 2016, at 11:32 AM, John David Ravenscroft <
> j.ravenscroft at gmail.com> wrote:
> >
> > Hi all,
> >
> > I'm having a seg fault crash while writing to file. Reproducible every
> > time. Version 2.6.12. Linux mint 17.2. Trace below.
> >
> > Any help greatfuly appreciated.
> >
>
>
> Ah, that's a much more useful stack trace. Looks like it's trying to check
> the type of a NULL ptr. Try running gnucash from the command line with the
> --debug option and then look at the end of the tracefile [1] to see what it
> was trying to save.
>
> Regards,
> John Ralls
>
> [1] http://wiki.gnucash.org/wiki/Tracefile
>
>


More information about the gnucash-user mailing list