[pygtk] treview segfaults due to sorting

Brian dol-sen at telus.net
Thu Jan 5 16:43:17 WST 2006


Our app has several treeviews.  One of those has several models that are
switched out, 3 are flat lists, 1 currently has one expander and child
nodes.  If the expander is opened, when switching to any of the other
models, it gets an instant segfault from the model.clear().  If I
comment out the clear() it segfaults still, just a little different.
The only thing I've been able to do so far to prevent the segfault is to
force a re-sort by clicking on one of the other column headers.
Normally the sort is on the first column (0).  All models share the same
treestore model.  The checkbox is hidden for all but one view.
def PackageModel():
    """Common model for a package Treestore"""
    store = gtk.TreeStore(
        gobject.TYPE_STRING,        # 0: package name
        gobject.TYPE_BOOLEAN,       # 1: checkbox value in upgrade view
        gobject.TYPE_PYOBJECT,      # 2: package object
        gtk.gdk.Pixbuf,             # 3: room for various icons
        gobject.TYPE_BOOLEAN,       # 4: true if package is in 'world'
file
        gobject.TYPE_STRING,        # 5: foreground text colour
        gobject.TYPE_STRING,        # 6: size
        gobject.TYPE_STRING,        # 7: installed version
        gobject.TYPE_STRING,        # 8: portage recommended version
        gobject.TYPE_STRING,        # 9: description
    )
    store.set_sort_func(6, size_sort_func)
    store.set_sort_func(8, latest_sort_func)
    store.set_sort_func(7, installed_sort_func)
    return store



I do not know if this is a gtk bug yet or something we are doing wrong.
Googling showed that Johan was the main contributor of that section of
code, so I thought this list might be the best place to ask for any
insights as to what to look for, etc., besides it is a pygtk app :).

I've been far too busy lately to create a simple test app to duplicate
the problem.  Mostly what I am looking for now is any insight from
others that may have experienced similar problems and solved them.

I am attaching a file which is an accumulation of several gdb backtraces
for those that might be able to discern some valuable info from it.

Any help is very much appreciated...  Brian.
-- 
Brian <dol-sen at telus.net>
-------------- next part --------------
(gdb) continue
Continuing.
[New Thread 32770 (LWP 28631)]
[Thread 32770 (LWP 28631) exited]
[New Thread 49154 (LWP 28636)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 28625)]
0xb783a4be in gtk_tree_view_expand_all () from /usr/lib/libgtk-x11-2.0.so.0
(gdb) bt
#0  0xb783a4be in gtk_tree_view_expand_all () from /usr/lib/libgtk-x11-2.0.so.0
#1  0xb7834597 in gtk_tree_view_get_fixed_height_mode () from /usr/lib/libgtk-x11-2.0.so.0
#2  0xb7834692 in gtk_tree_view_get_fixed_height_mode () from /usr/lib/libgtk-x11-2.0.so.0
#3  0xb774dcc0 in gtk_marshal_VOID__UINT_STRING () from /usr/lib/libgtk-x11-2.0.so.0
#4  0xb7b3e146 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#5  0xb7b4f485 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#6  0xb7b4e537 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#7  0xb7b4e7c6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#8  0xb7814ad3 in gtk_tree_model_rows_reordered () from /usr/lib/libgtk-x11-2.0.so.0
#9  0xb782540f in gtk_tree_store_move_after () from /usr/lib/libgtk-x11-2.0.so.0
#10 0xb7825500 in gtk_tree_store_move_after () from /usr/lib/libgtk-x11-2.0.so.0
#11 0xb7820b4b in gtk_tree_sortable_set_sort_column_id () from /usr/lib/libgtk-x11-2.0.so.0
#12 0xb7a3f997 in init_gtk () from /usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so
#13 0xb7f20089 in PyCFunction_Call () from /usr/lib/libpython2.4.so.1.0



(gdb) continue
Continuing.
[New Thread 32770 (LWP 31588)]
[Thread 32770 (LWP 31588) exited]
[New Thread 49154 (LWP 31589)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 31315)]
0xb78344f8 in gtk_tree_view_get_fixed_height_mode () from /usr/lib/libgtk-x11-2.0.so.0
(gdb) bt
#0  0xb78344f8 in gtk_tree_view_get_fixed_height_mode () from /usr/lib/libgtk-x11-2.0.so.0
#1  0xb7b50233 in g_cclosure_marshal_VOID__BOXED () from /usr/lib/libgobject-2.0.so.0
#2  0xb7b3e146 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#3  0xb7b4f485 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#4  0xb7b4e537 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#5  0xb7b4e7c6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#6  0xb7814a25 in gtk_tree_model_row_deleted () from /usr/lib/libgtk-x11-2.0.so.0
#7  0xb7822ca5 in gtk_tree_store_remove () from /usr/lib/libgtk-x11-2.0.so.0
#8  0xb7823a15 in gtk_tree_store_iter_depth () from /usr/lib/libgtk-x11-2.0.so.0
#9  0xb78239d8 in gtk_tree_store_iter_depth () from /usr/lib/libgtk-x11-2.0.so.0
#10 0xb7823a8c in gtk_tree_store_clear () from /usr/lib/libgtk-x11-2.0.so.0
#11 0xb7a2a413 in init_gtk () from /usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so
#12 0xb7f558f4 in PyEval_GetFuncDesc () from /usr/lib/libpython2.4.so.1.0


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 4275)]
0xb783a4be in gtk_tree_view_expand_all () from /usr/lib/libgtk-x11-2.0.so.0
(gdb) bt
#0  0xb783a4be in gtk_tree_view_expand_all () from /usr/lib/libgtk-x11-2.0.so.0
#1  0xb7834597 in gtk_tree_view_get_fixed_height_mode () from /usr/lib/libgtk-x11-2.0.so.0
#2  0xb7834692 in gtk_tree_view_get_fixed_height_mode () from /usr/lib/libgtk-x11-2.0.so.0
#3  0xb774dcc0 in gtk_marshal_VOID__UINT_STRING () from /usr/lib/libgtk-x11-2.0.so.0
#4  0xb7b3e146 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#5  0xb7b4f485 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#6  0xb7b4e537 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#7  0xb7b4e7c6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#8  0xb7814ad3 in gtk_tree_model_rows_reordered () from /usr/lib/libgtk-x11-2.0.so.0
#9  0xb782540f in gtk_tree_store_move_after () from /usr/lib/libgtk-x11-2.0.so.0
#10 0xb7825500 in gtk_tree_store_move_after () from /usr/lib/libgtk-x11-2.0.so.0
#11 0xb7820b4b in gtk_tree_sortable_set_sort_column_id () from /usr/lib/libgtk-x11-2.0.so.0
#12 0xb7a3f997 in init_gtk () from /usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so
#13 0xb7f20089 in PyCFunction_Call () from /usr/lib/libpython2.4.so.1.0


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 4302)]
0xb78344f8 in gtk_tree_view_get_fixed_height_mode () from /usr/lib/libgtk-x11-2.0.so.0
(gdb) bt
#0  0xb78344f8 in gtk_tree_view_get_fixed_height_mode () from /usr/lib/libgtk-x11-2.0.so.0
#1  0xb7b50233 in g_cclosure_marshal_VOID__BOXED () from /usr/lib/libgobject-2.0.so.0
#2  0xb7b3e146 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#3  0xb7b4f485 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#4  0xb7b4e537 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#5  0xb7b4e7c6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#6  0xb7814a25 in gtk_tree_model_row_deleted () from /usr/lib/libgtk-x11-2.0.so.0
#7  0xb7822ca5 in gtk_tree_store_remove () from /usr/lib/libgtk-x11-2.0.so.0
#8  0xb7823a15 in gtk_tree_store_iter_depth () from /usr/lib/libgtk-x11-2.0.so.0
#9  0xb78239d8 in gtk_tree_store_iter_depth () from /usr/lib/libgtk-x11-2.0.so.0
#10 0xb7823a8c in gtk_tree_store_clear () from /usr/lib/libgtk-x11-2.0.so.0
#11 0xb7a2a413 in init_gtk () from /usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so
#12 0xb7f558f4 in PyEval_GetFuncDesc () from /usr/lib/libpython2.4.so.1.0
#13 0xb7f537ec in PyEval_EvalFrame () from /usr/lib/libpython2.4.so.1.0
#14 0xb7f55d35 in PyEval_GetFuncDesc () from /usr/lib/libpython2.4.so.1.0
#15 0xb7f55842 in PyEval_GetFuncDesc () from /usr/lib/libpython2.4.so.1.0
#16 0xb7f537ec in PyEval_EvalFrame () from /usr/lib/libpython2.4.so.1.0
#17 0xb7f542b2 in PyEval_EvalCodeEx () from /usr/lib/libpython2.4.so.1.0
#18 0xb7f10e2c in PyFunction_SetClosure () from /usr/lib/libpython2.4.so.1.0
#19 0xb7efc6a7 in PyObject_Call () from /usr/lib/libpython2.4.so.1.0
#20 0xb7f03c43 in PyMethod_New () from /usr/lib/libpython2.4.so.1.0
#21 0xb7efc6a7 in PyObject_Call () from /usr/lib/libpython2.4.so.1.0
#22 0xb7f5557a in PyEval_CallObjectWithKeywords () from /usr/lib/libpython2.4.so.1.0
#23 0xb7efc65e in PyObject_CallObject () from /usr/lib/libpython2.4.so.1.0
#24 0xb7b9d6c1 in initgobject () from /usr/lib/python2.4/site-packages/gtk-2.0/gobject.so
#25 0xb7b3e146 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#26 0xb7b4f485 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#27 0xb7b4e537 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#28 0xb7b4e7c6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#29 0xb77733b7 in gtk_option_menu_get_history () from /usr/lib/libgtk-x11-2.0.so.0
#30 0xb7773687 in gtk_option_menu_get_history () from /usr/lib/libgtk-x11-2.0.so.0
#31 0xb7b4f976 in g_cclosure_marshal_VOID__VOID () from /usr/lib/libgobject-2.0.so.0
#32 0xb7b3e146 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#33 0xb7b4f317 in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#34 0xb7b4e537 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#35 0xb7b4e7c6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#36 0xb775f1c2 in gtk_menu_shell_activate_item () from /usr/lib/libgtk-x11-2.0.so.0
#37 0xb775e4f7 in gtk_menu_shell_deactivate () from /usr/lib/libgtk-x11-2.0.so.0
#38 0xb775502f in gtk_menu_reorder_child () from /usr/lib/libgtk-x11-2.0.so.0
#39 0xb774c3df in gtk_marshal_VOID__UINT_STRING () from /usr/lib/libgtk-x11-2.0.so.0
#40 0xb7b3e409 in g_cclosure_new_swap () from /usr/lib/libgobject-2.0.so.0
#41 0xb7b3e146 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#42 0xb7b4eefb in g_signal_emit_by_name () from /usr/lib/libgobject-2.0.so.0
#43 0xb7b4e335 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#44 0xb7b4e7c6 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#45 0xb7857314 in gtk_widget_send_expose () from /usr/lib/libgtk-x11-2.0.so.0
#46 0xb774a911 in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
#47 0xb77495e8 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
#48 0xb75cb8a1 in gdk_x11_register_standard_event_type () from /usr/lib/libgdk-x11-2.0.so.0
#49 0xb7ad531f in g_main_depth () from /usr/lib/libglib-2.0.so.0
#50 0xb7ad6312 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#51 0xb7ad664b in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#52 0xb7ad6bc1 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#53 0xb7748ed3 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#54 0xb7a43e2d in init_gtk () from /usr/lib/python2.4/site-packages/gtk-2.0/gtk/_gtk.so
#55 0xb7f558f4 in PyEval_GetFuncDesc () from /usr/lib/libpython2.4.so.1.0
#56 0xb7f537ec in PyEval_EvalFrame () from /usr/lib/libpython2.4.so.1.0
#57 0xb7f542b2 in PyEval_EvalCodeEx () from /usr/lib/libpython2.4.so.1.0
#58 0xb7f51575 in PyEval_EvalCode () from /usr/lib/libpython2.4.so.1.0
#59 0xb7f745c9 in PyRun_FileExFlags () from /usr/lib/libpython2.4.so.1.0
#60 0xb7f73533 in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.4.so.1.0
#61 0xb7f72e28 in PyRun_AnyFileExFlags () from /usr/lib/libpython2.4.so.1.0
#62 0xb7f7a503 in Py_Main () from /usr/lib/libpython2.4.so.1.0
#63 0x080486b9 in main ()
(gdb)


More information about the pygtk mailing list