Opened 5 years ago

Closed 5 years ago

#12035 closed defect (fixed)

wxDataViewCtrl crashes when selecting item

Reported by: elentirmo Owned by:
Priority: critical Milestone:
Component: wxGTK Version: stable-latest
Keywords: wxDataViewCtrl Cc:
Blocked By: Blocking:
Patch: no

Description

The dataview sample crashes when you change the selection in a wxDataViewCtrl. This happens on every tab of the sample.

To reproduce:

  • Run the dataview sample
  • Select Ninth symphony
  • Select German Requiem

Tested on wxGTK, SVN trunk revision 64285.

Stack trace:

Program received signal SIGSEGV, Segmentation fault.0x00225512 in wxgtk_tree_model_iter_children (tree_model=0x80b0560, iter=0xbfffef60, parent=0x0)
    at ../src/gtk/dataview.cpp:626
626        g_return_val_if_fail (wxtree_model->stamp == parent->stamp, FALSE);

Change History (6)

comment:1 in reply to: ↑ description Changed 5 years ago by vadz

  • Priority changed from normal to critical
  • Status changed from new to infoneeded_new

Replying to elentirmo:

The dataview sample crashes when you change the selection in a wxDataViewCtrl. This happens on every tab of the sample.

To reproduce:

  • Run the dataview sample
  • Select Ninth symphony
  • Select German Requiem

Tested on wxGTK, SVN trunk revision 64285.

This works perfectly fine for me with the current trunk (64294, but there have been no related changes since 64285) so there is something else coming into play here. Which version of GTK+ do you use?

Stack trace:

Program received signal SIGSEGV, Segmentation fault.0x00225512 in wxgtk_tree_model_iter_children (tree_model=0x80b0560, iter=0xbfffef60, parent=0x0)
    at ../src/gtk/dataview.cpp:626
626        g_return_val_if_fail (wxtree_model->stamp == parent->stamp, FALSE);

Sorry, this is not a stack trace. Please type "bt" at gdb prompt to get the real stack trace. Also please look at the variable values as it's not clear why does it crash: is wxtree_model invalid? Or parent? Please try doing e.g. p *parent to try to check it.

Thanks!

comment:2 Changed 5 years ago by elentirmo

  • Status changed from infoneeded_new to new

Thanks for your attention.

Which version of GTK+ do you use?

This GTK+ 2.18.3. Ubuntu Karmic 32-bit.

Sorry, this is not a stack trace.

I did think it was a bit short :-) The bt output follows:

#0  0x00225512 in wxgtk_tree_model_iter_children (tree_model=0x80b0530, iter=0xbfffede0, 
    parent=0x0) at ../src/gtk/dataview.cpp:626
#1  0x00b81eeb in IA__gtk_tree_model_iter_children (tree_model=0x80b0530, iter=0xbfffede0, 
    parent=0x0) at /build/buildd/gtk+2.0-2.18.3/gtk/gtktreemodel.c:1202
#2  0x0189e86b in count_rows (model=0x80b0530, iter=<value optimized out>, end_path=0x85265d0, 
    count=0xbfffee3c, level=0, depth=3)
    at /build/buildd/gtk+2.0-2.18.3/modules/other/gail/gailtreeview.c:4414
#3  0x0189eacb in get_index (tree_view=0x818d088, path=<value optimized out>, actual_column=0)
    at /build/buildd/gtk+2.0-2.18.3/modules/other/gail/gailtreeview.c:4370
#4  0x018a3feb in get_focus_index (tree_view=0x818d088)
    at /build/buildd/gtk+2.0-2.18.3/modules/other/gail/gailtreeview.c:715
#5  0x018a4024 in gail_tree_view_ref_focus_cell (tree_view=0x818d088)
    at /build/buildd/gtk+2.0-2.18.3/modules/other/gail/gailtreeview.c:738
#6  0x018a415a in idle_cursor_changed (data=0x854e8d0)
    at /build/buildd/gtk+2.0-2.18.3/modules/other/gail/gailtreeview.c:2632
#7  0x00d3df78 in gdk_threads_dispatch (data=0x855c470)
    at /build/buildd/gtk+2.0-2.18.3/gdk/gdk.c:506
#8  0x01030101 in ?? () from /lib/libglib-2.0.so.0
#9  0x01031e88 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#10 0x01035730 in ?? () from /lib/libglib-2.0.so.0
#11 0x01035b9f in g_main_loop_run () from /lib/libglib-2.0.so.0
#12 0x00a9e419 in IA__gtk_main () at /build/buildd/gtk+2.0-2.18.3/gtk/gtkmain.c:1218
#13 0x003f2cd1 in wxGUIEventLoop::Run (this=0x8550e50) at ../src/gtk/evtloop.cpp:60
#14 0x0078fa12 in wxAppConsoleBase::MainLoop (this=0x80a1d18) at ../src/common/appbase.cpp:318
#15 0x0078f826 in wxAppConsoleBase::OnRun (this=0x80a1d18) at ../src/common/appbase.cpp:259
#16 0x004946de in wxAppBase::OnRun (this=0x80a1d18) at ../src/common/appcmn.cpp:285
#17 0x007fe482 in wxEntry (argc=@0x96384c, argv=0x8087528) at ../src/common/init.cpp:473
#18 0x007fe54b in wxEntry (argc=@0xbffff260, argv=0xbffff304) at ../src/common/init.cpp:485
#19 0x08054c70 in main (argc=1, argv=0xbffff304) at ../../../samples/dataview/dataview.cpp:224

Also please look at the variable values as it's not clear why does it crash: is wxtree_model invalid? Or parent?

It seems parent is 0: "p *parent" reports "Cannot access memory at address 0x0". "p *wxtree_model" reports

parent = {g_type_instance = {g_class = 0x8188b00}, ref_count = 6, qdata = 0x852c590}, 
  stamp = -678468961, internal = 0x818ba48}

comment:3 Changed 5 years ago by vadz

This is really strange, I don't have 2.18 here but I tested with 2.20 and it doesn't crash for me there neither.

AFAICS this function (iter_children callback) should never be called with NULL parent and I have no idea what could cause this to happen. Can anyone else reproduce this?

comment:4 Changed 5 years ago by roebling

Are you using some special GAIL version or some accessibility feature? I don't think anyone here ever does that and I noticed the occurrence of gail in the backtrace.

comment:5 Changed 5 years ago by roebling

I just checked and according to

http://library.gnome.org/devel/gtk/stable/GtkTreeModel.html#gtk-tree-model-iter-children

it is valid to call the method with parent being NULL so I'll try to get that right.

comment:6 Changed 5 years ago by elentirmo

  • Resolution set to fixed
  • Status changed from new to closed

Are you using some special GAIL version or some accessibility feature?

Yes, I do have assistive technologies enabled. I haven't modified GAIL in any way.

The crash doesn't happen when I disable AT; after updating to r64332 the crash is gone even when AT are enabled. So r64316 is spot on :-)

(I don't really use AT, they were required for some automation software I was testing)

Note: See TracTickets for help on using tickets.