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 138685 - segfault when "fixed-height-mode" property in treeview is set on.
segfault when "fixed-height-mode" property in treeview is set on.
Status: RESOLVED DUPLICATE of bug 138082
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.3.x
Other Linux
: High critical
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2004-03-31 21:33 UTC by Riccardo Attilio Galli
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
crash.py (486 bytes, text/plain)
2004-04-01 15:14 UTC, Scott Tsai
Details
minimal_crash.py (255 bytes, application/octet-stream)
2004-04-01 16:16 UTC, Scott Tsai
Details
crash.c (434 bytes, text/plain)
2004-04-01 16:19 UTC, Scott Tsai
Details

Description Riccardo Attilio Galli 2004-03-31 21:33:47 UTC
'''
When the app is started, there are a treeview and two buttons.
Button 'modify model' simply modify the text in tree's rows.
If you click, it works.
After 'fixed-height-mode' is set by clicking on the second button,
clicking on button 'modify model' will now generate a segmentation fault
'''

import gtk

class MyTree(gtk.TreeView):
    def __init__(self,*args):
        super(MyTree,self).__init__(*args)
        
        renderer=gtk.CellRendererText()
        col=gtk.TreeViewColumn('readme',renderer)
        col.add_attribute(renderer, 'text', 1)
        col.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
        self.append_column(col)
        
        self.model = gtk.TreeStore(gobject.TYPE_PYOBJECT,str)
        self.set_model(self.model)
        
        self.text='second text'
        self.refreshModel()
    
    def refreshModel(self):
        print 'inside refreshModel'
        self.model.clear()
        if self.text=='first text':
            self.text='second text'
        else:
            self.text='first text'
        
        for i in range(4):
            iter=self.model.insert_before(None,None)
            self.model.set_value(iter,1,self.text)
        print 'exiting refreshModel'


def main():
    window = gtk.Window()
    window.connect('destroy', lambda win: gtk.main_quit())
    window.set_size_request(300,200)
    
    vbox=gtk.VBox()
    
    tree=MyTree()
    vbox.pack_start(tree,1,1,0)
    
    hbox=gtk.HBox()
    btn1=gtk.Button('modify model')
    btn1.connect('clicked',lambda *x:tree.refreshModel())
    
    btn2=gtk.Button('set fixed-height-mode on')
    btn2.connect('clicked',lambda *x: tree.set_property('fixed-height-mode',1))
    hbox.pack_start(btn1,1,1,0)
    hbox.pack_start(btn2,1,1,0)
    
    vbox.pack_start(hbox,0,1,0)
    
    window.add(vbox)
    window.show_all()
    
    gtk.main()

if __name__ == '__main__':
    main()
Comment 1 Johan (not receiving bugmail) Dahlin 2004-03-31 22:03:19 UTC
I can not reproduce on my machine.

Can you attach a backtrace from gdb?
Comment 2 Graham Ashton 2004-03-31 22:42:15 UTC
This is from pygtk 2.2.0.

(gdb) run bug.py
Starting program: /usr/bin/python bug.py
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...inside refreshModel
exiting refreshModel
inside refreshModel
 
Program received signal SIGSEGV, Segmentation fault.
0x407ded1b in _gtk_rbtree_node_set_height () from /usr/lib/libgtk-x11-2.0.so.0
(gdb) backtrace
  • #0 _gtk_rbtree_node_set_height
    from /usr/lib/libgtk-x11-2.0.so.0
  • #1 _gtk_tree_view_child_move_resize
    from /usr/lib/libgtk-x11-2.0.so.0
  • #2 _gtk_marshal_VOID__BOXED_BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #3 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #4 g_signal_emit_by_name
    from /usr/lib/libgobject-2.0.so.0
  • #5 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0

Comment 3 Riccardo Attilio Galli 2004-03-31 23:52:54 UTC
this is from pygtk-2.3.90

(gdb) run bug.py
Starting program: /usr/bin/python bug.py
(no debugging symbols found)...(no debugging symbols found)...[Thread debugging
using libthread_db enabled]
[New Thread 16384 (LWP 28020)]

(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...inside refreshModel
exiting refreshModel
inside refreshModel

Program received signal SIGSEGV, Segmentation fault.

Thread 16384 (LWP 28020)

  • #0 _gtk_rbtree_node_set_height
    from /usr/lib/libgtk-x11-2.0.so.0
  • #1 _gtk_tree_view_child_move_resize
    from /usr/lib/libgtk-x11-2.0.so.0

Comment 4 Scott Tsai 2004-04-01 15:13:42 UTC
I can reproduce this, necessary elements:
    view.set_property('fixed-height-mode',1)
    model.clear()
    model.append(None)

attached minimal crash inducing python code, crash.py
complete stack trace:
  • #0 _gtk_rbtree_node_set_height
    at gtkrbtree.c line 724
  • #0 _gtk_rbtree_node_set_height
    at gtkrbtree.c line 724
  • #1 gtk_tree_view_row_inserted
    at gtktreeview.c line 6744
  • #2 _gtk_marshal_VOID__BOXED_BOXED
    at gtkmarshalers.c line 1028
  • #3 g_closure_invoke
    at gclosure.c line 437
  • #4 signal_emit_unlocked_R
    at gsignal.c line 2436
  • #5 g_signal_emit_valist
  • #6 g_signal_emit
    at gsignal.c line 2239
  • #7 gtk_tree_model_row_inserted
    at gtktreemodel.c line 1374
  • #8 gtk_tree_store_append
    at gtktreestore.c line 1400
  • #9 _wrap_gtk_tree_store_append
    at gtktreeview.override line 1765
  • #10 PyCFunction_Call
    at Objects/methodobject.c line 108
  • #11 call_function
    at Python/ceval.c line 3454
  • #12 eval_frame
    at Python/ceval.c line 2124
  • #13 PyEval_EvalCodeEx
    at Python/ceval.c line 2678
  • #14 PyEval_EvalCode
    at Python/ceval.c line 564
  • #15 run_node
    at Python/pythonrun.c line 1253
  • #16 PyRun_SimpleFileExFlags
    at Python/pythonrun.c line 850
  • #17 Py_Main
    at Modules/main.c line 413
  • #18 main
    at Modules/python.c line 23

Comment 5 Scott Tsai 2004-04-01 15:14:52 UTC
Created attachment 26212 [details]
crash.py
Comment 6 Jon Trowbridge 2004-04-01 15:44:36 UTC
I think this is a gtk+ bug.
Comment 7 Scott Tsai 2004-04-01 16:16:58 UTC
Created attachment 26213 [details]
minimal_crash.py

reduce the crash inducing code further
Comment 8 Scott Tsai 2004-04-01 16:19:05 UTC
Created attachment 26214 [details]
crash.c

The equavelent C code also segfaults.
This is either a bug in gtk or a usage that should be catched in pygtk.
I'll search the gtk bugzilla for this ..
Comment 9 Scott Tsai 2004-04-01 16:23:32 UTC
This is bug #138082 on GtkTreeView in gtk.
There is an attached patch that at least prevents the segfault there.
Comment 10 Johan (not receiving bugmail) Dahlin 2004-04-01 16:27:52 UTC
Product -> gtk+
Comment 11 Johan (not receiving bugmail) Dahlin 2004-04-01 16:29:27 UTC

*** This bug has been marked as a duplicate of 138082 ***