[PATCH] Re: Crash in dialog_file_access.c (was Re: Trouble compiling)
Sebastian Held
sebastian.held at gmx.de
Sun Apr 5 12:56:53 EDT 2009
can s.o. apply this to trunk?
Index: dialog-file-access.c
===================================================================
--- dialog-file-access.c (revision 18016)
+++ dialog-file-access.c (working copy)
@@ -231,7 +231,8 @@
uri_type_container = glade_xml_get_widget( xml,
"vb_uri_type_container" );
faw->cb_uri_type = GTK_COMBO_BOX(gtk_combo_box_new_text());
gtk_container_add( GTK_CONTAINER(uri_type_container),
GTK_WIDGET(faw->cb_uri_type) );
- g_object_connect( G_OBJECT(faw->cb_uri_type), "signal::changed",
cb_uri_type_changed_cb, NULL );
+ g_object_connect( G_OBJECT(faw->cb_uri_type), "signal::changed",
cb_uri_type_changed_cb, NULL,
+ NULL );
/* Autoconnect signals */
glade_xml_signal_autoconnect_full( xml,
gnc_glade_autoconnect_full_func,
Sebastian
p.s. Binaries for Windows on http://tellico.dyndns.org/drupal/ are in
the process of being updated
Sebastian Held schrieb:
> got it.
>
> valgrind report for save as command:
> ==3984== Conditional jump or move depends on uninitialised value(s)
> ==3984== at 0x4CDA9D2: g_object_connect (gobject.c:1345)
> ==3984== by 0x422B67F: gnc_ui_file_access (dialog-file-access.c:234)
> ==3984== by 0x41469D7: gnc_main_window_cmd_file_save_as
> (gnc-plugin-basic-commands.c:389)
> ==3984== by 0x4CE52A3: g_cclosure_marshal_VOID__VOID (gmarshal.c:77)
> ==3984== by 0x4CD7B5A: g_closure_invoke (gclosure.c:490)
> ==3984== by 0x4CEB0AC: signal_emit_unlocked_R (gsignal.c:2440)
> ==3984== by 0x4CEC5DD: g_signal_emit_valist (gsignal.c:2199)
> ==3984== by 0x4CECA25: g_signal_emit (gsignal.c:2243)
> ==3984== by 0x4ED64B4: (within /usr/lib/libgtk-x11-2.0.so.0.1200.9)
> ==3984== by 0x4ED7473: gtk_action_activate
> (in /usr/lib/libgtk-x11-2.0.so.0.1200.9)
> ==3984== by 0x4CE52A3: g_cclosure_marshal_VOID__VOID (gmarshal.c:77)
> ==3984== by 0x4CD7B5A: g_closure_invoke (gclosure.c:490)
> ==3984== by 0x4CEB0AC: signal_emit_unlocked_R (gsignal.c:2440)
> ==3984== by 0x4CEC5DD: g_signal_emit_valist (gsignal.c:2199)
> ==3984== by 0x4CECA25: g_signal_emit (gsignal.c:2243)
> ==3984== by 0x50FD9D6: gtk_widget_activate
> (in /usr/lib/libgtk-x11-2.0.so.0.1200.9)
> ==3984== by 0x4FDD77F: gtk_menu_shell_activate_item
> (in /usr/lib/libgtk-x11-2.0.so.0.1200.9)
> ==3984== by 0x4FDF57C: (within /usr/lib/libgtk-x11-2.0.so.0.1200.9)
> ==3984== by 0x4FD615A: (within /usr/lib/libgtk-x11-2.0.so.0.1200.9)
> ==3984== by 0x4FCFDE5: (within /usr/lib/libgtk-x11-2.0.so.0.1200.9)
> ==3984== by 0x4CD62B8: g_type_class_meta_marshal (gclosure.c:567)
> ==3984== by 0x4CD7B5A: g_closure_invoke (gclosure.c:490)
> ==3984== by 0x4CEAD54: signal_emit_unlocked_R (gsignal.c:2478)
> ==3984== by 0x4CEC467: g_signal_emit_valist (gsignal.c:2209)
> ==3984== by 0x4CECA25: g_signal_emit (gsignal.c:2243)
> --3984-- Reading syms from /usr/lib/gtk-2.0/2.10.0/immodules/im-xim.so
> (0xc387000)
> --3984-- object doesn't have a symbol table
>
>
> gobject.c:
>
> gpointer
> g_object_connect (gpointer _object,
> const gchar *signal_spec,
> ...)
> {
> GObject *object = _object;
> va_list var_args;
>
> g_return_val_if_fail (G_IS_OBJECT (object), NULL);
> g_return_val_if_fail (object->ref_count > 0, object);
>
> va_start (var_args, signal_spec);
> 1345: --> while (signal_spec)
> {
>
>
>
> Any thoughts on this?
> Sebastian
>
>
> Am Sonntag, 5. April 2009 11:40:31 schrieb Sebastian Held:
>
>> Great - with dubbing symbols, the app does not crash anymore.
>> This certainly has to do with dangling pointers uninitialized vars, ...
>> valgrind will be your friend, but I cannot get gnucash to run under
>> supervision of valgrind. It aborts with SIGABRT in the startup phase.
>>
>> The save as function needs to be analyzed carefully.
>>
>> Sebastian
>>
>> Am Sonntag, 5. April 2009 10:46:33 schrieb Sebastian Held:
>>
>>> Finally I got my suse box to compile trunk, and voila:
>>> trunk (rev18013) crashes even on linux, but not the first time you open
>>> save as...
>>> Here is how to reproduce the crash:
>>> - trigger save as
>>> - press cancel
>>> - trigger save as again -> crashes
>>>
>>> I'm currently recompiling trunk with debuging symbols enabled to get a
>>> meaningful backtrace.
>>>
>>> Sebastian
>>>
>>> Am Sonntag, 5. April 2009 00:40:56 schrieb Phil Longstaff:
>>>
>>>> Because it's a variable on the stack so its value is undefined before
>>>> it is set.
>>>>
>>>> Phil
>>>>
>>>> On April 4, 2009 05:34:39 pm David Reiser wrote:
>>>>
>>>>> So even though I have 3 dbd files in the location specified in
>>>>> configure with --with-dbi-dbd-dir=, my list is still null because
>>>>> gnucash hasn't asked for the registered backends yet? If so, why
>>>>> would Sebastian's example show a non-null list with a breakpoint at
>>>>> the same location?
>>>>>
>>>>> Dave
>>>>>
>>>>> On Apr 4, 2009, at 4:38 PM, Phil Longstaff wrote:
>>>>>
>>>>>> List being null isn't the problem.
>>>>>>
>>>>>> "list" isn't used until after that point in the code (it asks qof
>>>>>> for the list of registered backends and doesn't add combobox
>>>>>> entries for "sqlite3", "mysql" or "pgsql" if there isn't a
>>>>>> registered backend, and the libdbi backend doesn't register a
>>>>>> backend if the dbd file isn't present).
>>>>>>
>>>>>>
>>>>>> ________________________________
>>>>>> From: David Reiser <dbreiser at earthlink.net>
>>>>>> To: Phil Longstaff <plongstaff at rogers.com>
>>>>>> Cc: Sebastian Held <sebastian.held at gmx.de>; Gnucash list
>>>>>> <gnucash-devel at lists.gnucash.org
>>>>>>
>>>>>> Sent: Saturday, April 4, 2009 4:18:49 PM
>>>>>> Subject: Re: Crash in dialog_file_access.c (was Re: Trouble
>>>>>> compiling)
>>>>>>
>>>>>>
>>>>>>
>>>>>> [...]________________________________
>>>>>>
>>>>>> From: Sebastian Held <sebastian.held at gmx.de>
>>>>>>
>>>>>> To: Phil Longstaff <plongstaff at rogers.com>
>>>>>>
>>>>>> Cc: David Reiser <dbreiser at earthlink.net>; Derek Atkins
>>>>>> <warlord at MIT.EDU
>>>>>>
>>>>>>
>>>>>>> ; Gnucash list <gnucash-devel at lists.gnucash.org>
>>>>>>>
>>>>>> Sent: Thursday, April 2, 2009 3:19:10 PM
>>>>>>
>>>>>> Subject: Re: Trouble compiling
>>>>>>
>>>>>>
>>>>>> Same (rev18012) here on windows:
>>>>>>
>>>>>>
>>>>>> 63A4A37E libgobject-2.0-0.dll:63A4A37E g_object_connect
>>>>>>
>>>>>> 64F0BAE3 libgncmod-gnome-utils.dll:64F0BAE3 gnc_ui_file_access
>>>>>>
>>>>>> dialog-file-access.c:234
>>>>>>
>>>>>> 64F0BC72 libgncmod-gnome-utils.dll:64F0BC72
>>>>>>
>>>>>> gnc_ui_file_access_for_save_as dialog-file-access.c:275
>>>>>>
>>>>>> 6E36706F libgnc-gnome-0.dll:6E36706F
>>>>>>
>>>>>> gnc_main_window_cmd_file_save_as gnc-plugin-basic-commands.c:393
>>>>>>
>>>>>>
>>>>>> (gdb) break dialog-file-access.c:234
>>>>>>
>>>>>> ...
>>>>>>
>>>>>> (gdb) list 234
>>>>>>
>>>>>> 234 g_object_connect( G_OBJECT(faw->cb_uri_type),
>>>>>>
>>>>>> "signal::changed", cb_uri_type_changed_cb, NULL );
>>>>>>
>>>>>> (gdb) info local
>>>>>>
>>>>>> faw = (FileAccessWindow *) 0x1e3a6c0
>>>>>>
>>>>>> xml = (GladeXML *) 0x16aae00
>>>>>>
>>>>>> box = (GtkWidget *) 0x65c41273
>>>>>>
>>>>>> ds_node = (GList *) 0x1296850
>>>>>>
>>>>>> op = (GtkButton *) 0x3eb4f60
>>>>>>
>>>>>> align = (GtkWidget *) 0x3eafd68
>>>>>>
>>>>>> fileChooser = (GtkFileChooserWidget *) 0x3ec4360
>>>>>>
>>>>>> fileChooserAction = GTK_FILE_CHOOSER_ACTION_SAVE
>>>>>>
>>>>>> list = (GList *) 0x1d5c7a0
>>>>>>
>>>>>> node = (GList *) 0x22f318
>>>>>>
>>>>>> uri_type_container = (GtkWidget *) 0x3e9f918
>>>>>>
>>>>>> __PRETTY_FUNCTION__ = "gnc_ui_file_access"
>>>>>>
>>>>>> (gdb) p *faw
>>>>>>
>>>>>> $2 = {type = 1, dialog = 0x3ec7008, frame_file = 0x3eafd00,
>>>>>>
>>>>>> frame_database = 0x3eafb60, fileChooser = 0x3ec4360,
>>>>>>
>>>>>> cb_uri_type = 0x3ed7010, tf_host = 0x3eaa0c0, tf_database =
>>>>>>
>>>>>> 0x3eaa170,
>>>>>>
>>>>>> tf_username = 0x3eaa220, tf_password = 0x3eaa2d0}
>>>>>>
>>>>>> (gdb) p cb_uri_type_changed_cb
>>>>>>
>>>>>> $3 = {void (GtkComboBox *)} 0x64f0b688 <cb_uri_type_changed_cb>
>>>>>>
>>>>>>
>>>>>> From gdb in my crash, I get:
>>>>>>
>>>>>> Breakpoint 1, gnc_ui_file_access (type=1) at
>>>>>> dialog-file-access.c:234 234g_object_connect(
>>>>>> G_OBJECT(faw->cb_uri_type), "signal::changed",
>>>>>> cb_uri_type_changed_cb, NULL );
>>>>>> (gdb) info local
>>>>>> faw = (FileAccessWindow *) 0x5077650
>>>>>> xml = (GladeXML *) 0x59d2c48
>>>>>> box = (GtkWidget *) 0x1b1f7d0
>>>>>> ds_node = (GList *) 0x1897e68
>>>>>> op = (GtkButton *) 0x5c09078
>>>>>> align = (GtkWidget *) 0x5c0a958
>>>>>> fileChooser = (GtkFileChooserWidget *) 0x29b4110
>>>>>> fileChooserAction = GTK_FILE_CHOOSER_ACTION_SAVE
>>>>>> list = (GList *) 0x0
>>>>>> node = (GList *) 0xbfffd800
>>>>>> uri_type_container = (GtkWidget *) 0x5c060d8
>>>>>> __PRETTY_FUNCTION__ = "gnc_ui_file_access"
>>>>>>
>>>>>>
>>>>>> list is NULL, so that's probably the cause of my crash. Any
>>>>>> suggestions on changes I can try to work on the lack of "list"?
>>>>>>
>>>>>> I have all three libdbi drivers installed, and configure reports
>>>>>> that gnucash is configured for the dbi backend.
>>>>>> Dave
>>>>>>
>>>>>> --
>>>>>> David Reiser
>>>>>> dbreiser at earthlink.net
>>>>>> _______________________________________________
>>>>>> gnucash-devel mailing list
>>>>>> gnucash-devel at gnucash.org
>>>>>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>>>>>>
>>>>> --
>>>>> David Reiser
>>>>> dbreiser at earthlink.net
>>>>>
>>>> _______________________________________________
>>>> gnucash-devel mailing list
>>>> gnucash-devel at gnucash.org
>>>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>>>>
>>> _______________________________________________
>>> gnucash-devel mailing list
>>> gnucash-devel at gnucash.org
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>>>
>> _______________________________________________
>> gnucash-devel mailing list
>> gnucash-devel at gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>>
>
>
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sebastian_held.vcf
Type: text/x-vcard
Size: 205 bytes
Desc: not available
URL: <http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20090405/a48f47f6/attachment.vcf>
More information about the gnucash-devel
mailing list