[Bug 617924] New: python-yui crashes with segfault when using TreeItem widget
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c0 Summary: python-yui crashes with segfault when using TreeItem widget Classification: openSUSE Product: openSUSE 11.0 Version: Final Platform: i586 OS/Version: SLES 11 Status: NEW Severity: Normal Priority: P5 - None Component: YaST2 AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: pirhoalpha@gmail.com QAContact: jsrain@novell.com Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009012700 SUSE/3.0.6-1.14 Firefox/3.0.6 When I create TreeItems, the program runs fine until the end, where is crashes with a segfault. I am using python 2.6. The yast development team thought this was most likely a dangling pointer issue. Even this simple code crashes: import sys sys.path.insert(0, '/usr/src/packages/BUILD/libyui-bindings-0.1.0/build/swig/python/') import yui item = yui.YTreeItem("root") item2 = yui.YTreeItem(item, "Desktop") Every other widget that I tried worked though. Reproducible: Always Steps to Reproduce: 1. Run following python code (change sys.path to where python bindings are): import sys sys.path.insert(0, '/usr/src/packages/BUILD/libyui-bindings-0.1.0/build/swig/python/') import yui item = yui.YTreeItem("root") item2 = yui.YTreeItem(item, "Desktop") Actual Results: segmentation fault Expected Results: error free exit Yast developers said this is probably a dangling pointer issue or at least deals with memory ownership issues. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c yang xiaoyu <xyyang@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xyyang@novell.com AssignedTo|bnc-team-screening@forge.pr |kkaempf@novell.com |ovo.novell.com | -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c1 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO CC| |kmachalkova@novell.com InfoProvider| |kmachalkova@novell.com --- Comment #1 from Klaus Kämpf <kkaempf@novell.com> 2010-06-29 08:32:34 UTC --- The problem is that you cannot create TreeItems stand-alone. They need to be embedded into a dialog and a vbox/hbox: factory = yui.YUI.widgetFactory() dialog = factory.createPopupDialog() vbox = factory.createVBox( dialog ) item = factory.createTree(vbox, "root") event = dialog.waitForEvent() dialog.destroy() This examples runs without crash. My knowledge about libyui trees is too limited to complete the example :-( Bubli, any hints how to properly add items to the tree ? -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c2 Katarina Machalkova <kmachalkova@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|kmachalkova@novell.com | --- Comment #2 from Katarina Machalkova <kmachalkova@novell.com> 2010-06-29 08:46:31 UTC --- The following code creates a tree with 2 items (top- and 1st level) factory = yui.YUI.widgetFactory() dialog = factory.createPopupDialog() item1 = yui.YTreeItem("hello") item2 = yui.YTreeItem( item1, "world") vbox = factory.createVBox( dialog ) tree = factory.createTree( vbox, "Hello, World!" ) // add top level item only, its children will be added automatically tree.addItem(item1) factory.createPushButton( vbox, "&OK" ) event = dialog.waitForEvent() dialog.destroy() For some reason, the tree items are visible only in ncurses (GUI shows an empty box). Nevertheless, segfault on dialog close occurs in both cases -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c3 --- Comment #3 from Katarina Machalkova <kmachalkova@novell.com> 2010-06-29 09:43:55 UTC --- Hm, tried to obtain some backtrace, but this is all I managed to get :( #0 0x00000031 in ?? () #1 0xc381fffd in ?? () Backtrace stopped: previous frame inner to this frame (corrupt stack?) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c4 --- Comment #4 from Klaus Kämpf <kkaempf@novell.com> 2010-06-29 10:55:56 UTC --- See https://bugzilla.novell.com/show_bug.cgi?id=427372#c16 Its a double-free. The addItem call transfers the 'memory ownership' to 'tree' but swig thinks it still needs to de-allocated the created item. This probably needs fixing in libyui -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c5 --- Comment #5 from Klaus Kämpf <kkaempf@novell.com> 2010-06-29 11:13:46 UTC --- Uhm, no, fixing in libyui (adding _disown to function declarations) doesn't help :-( -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c6 --- Comment #6 from Klaus Kämpf <kkaempf@novell.com> 2010-06-29 11:25:31 UTC --- I fear the problem is the usage of the YTreeItem constructor. When using it with a parent, "The parent assumes ownership of this item" (citation from YTreeItem.h). -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c7 --- Comment #7 from Klaus Kämpf <kkaempf@novell.com> 2010-06-29 11:39:47 UTC --- I was wrong in comment #5. Adding the _disown does the trick but must be done with the correct parameter name. This fixes the crash: --- YTreeItem.h (revision 62165) +++ YTreeItem.h (working copy) @@ -117,7 +117,7 @@ * automatically add themselves to their parent, so applications will * normally not have to call this function. **/ - virtual void addChild( YItem * child ); + virtual void addChild( YItem * item_disown ); -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c8 --- Comment #8 from Klaus Kämpf <kkaempf@novell.com> 2010-06-29 11:41:07 UTC --- Committed to svn as rev 62170 -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c9 --- Comment #9 from Klaus Kämpf <kkaempf@novell.com> 2010-06-29 11:43:11 UTC --- Note that this only prevents the crash. It does not fix Qt to properly display the tree. The example works fine in Ncurses though. -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c10 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO InfoProvider| |kmachalkova@novell.com --- Comment #10 from Klaus Kämpf <kkaempf@novell.com> 2010-06-29 11:44:06 UTC --- Want to push an update out ? ;-) -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c11 Katarina Machalkova <kmachalkova@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|kmachalkova@novell.com | --- Comment #11 from Katarina Machalkova <kmachalkova@novell.com> 2010-06-29 14:42:57 UTC --- For 11.3/Factory - sure For SLE11[-SP1] - we'd have to ask maintenance team for approval then -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=617924 http://bugzilla.novell.com/show_bug.cgi?id=617924#c12 Klaus Kämpf <kkaempf@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED Target Milestone|--- |Future/Later --- Comment #12 from Klaus Kämpf <kkaempf@novell.com> 2010-06-29 15:41:31 UTC --- python-yui is on the SLE11 SDK and thus not maintained. Closed as fixed for 11.3 -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com