Subscribe to MultiColumnList Events

32 views
Skip to first unread message

Mike Handverger

unread,
Feb 4, 2007, 12:21:33 PM2/4/07
to Python Ogre Developers
Hi guys,

Things are working very well over here. I noticed that there is no
custom event subscription code for MultiColumnList in CEGUI. Here's a
patch that provides it (tested on Linux):

http://dev.mv3d.com/~mike/mv3d/python-ogre/cegui-MultiColumnList.patch

Thanks,

Mike

Mike Handverger

unread,
Feb 4, 2007, 8:26:31 PM2/4/07
to Python Ogre Developers
I seem to be having one more CEGUI problem. I can't remove items from
a Listbox, Combobox or MultiColumnList without a crash. I get a crash
in Windows as well, but here's what happens in Linux when trying
either Listbox.resetList or Listbox.removeItem:

*** glibc detected *** /usr/bin/python: free(): invalid pointer:
0x0b65d590 ***

This code worked fine under PyOgre.

If resetList is called and the Listbox is empty, there is no crash.
This happens whether I let go of my reference to the Listbox items or
not.

Any ideas?

Thanks,

Mike

On Feb 4, 12:21 pm, "Mike Handverger" <mike.handver...@gmail.com>
wrote:

Andy Miller

unread,
Feb 4, 2007, 8:47:59 PM2/4/07
to python-ogre...@googlegroups.com
Can you send through a test python program that shows the problem and I'll track it down.
 
Cheers
 
Andy

 

Andy Miller

unread,
Feb 4, 2007, 9:02:44 PM2/4/07
to python-ogre...@googlegroups.com
You could also look to use the setAutoDelete function on the list items - perhaps set this to False which will stop the list from trying to delete the item and instead rely on the user code to do so.
 
Cheers
 
 
Andy

 
On 05/02/07, Mike Handverger <mike.ha...@gmail.com> wrote:

Mike Handverger

unread,
Feb 4, 2007, 9:32:31 PM2/4/07
to Python Ogre Developers
I did try setAutoDelete (both False and True) it didn't seem to make a
difference unfortunately. I have a test program based on demos/CEGUI/
blank_app.py:

http://dev.mv3d.com/~mike/mv3d/python-ogre/ListTest.py

If you comment/uncomment line 118, you should see the crash. I haven't
tested the program in Windows, but I was definitely seeing the same
crash there. I put everything in the init code for simplicity, but the
same error occurs when resetList is called later.

Uncommenting that line, when I quit the app, I get a stack trace from
somewhere. It could be that the Python reference to the ListBoxItem is
being freed, and then the CEGUI C++ pointer gets freed later as well--
though I'd expect a 'double free' type error from glibc instead of
invalid pointer free in that case.

Reset List after Add... Ok
*** glibc detected *** python: free(): invalid pointer: 0x0a9b2f20 ***
======= Backtrace: =========
/lib/libc.so.6[0xa7e5a082]
/lib/libc.so.6(__libc_free+0x84)[0xa7e5b704]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xa29b83b1]
/usr/lib/python2.4/site-packages/CEGUI/
_cegui_.so(_ZN23ListboxTextItem_wrapperD0
Ev+0x2c)[0xa1af97fe]
/usr/local/lib/libCEGUIBase.so.1(_ZN5CEGUI7Listbox14resetList_implEv
+0x54)[0xa2b
05d28]
/usr/local/lib/libCEGUIBase.so.1(_ZN5CEGUI7ListboxD0Ev+0x32)
[0xa2b0688a]
/usr/local/lib/libCEGUIBase.so.
1(_ZN5CEGUI14ListboxFactory13destroyWindowEPNS_6W
indowE+0x15)[0xa2ae91f5]
/usr/local/lib/libCEGUIBase.so.
1(_ZN5CEGUI13WindowManager13cleanDeadPoolEv+0x64)
[0xa2ad6d30]
/usr/local/lib/libCEGUIBase.so.1(_ZN5CEGUI6SystemD1Ev+0x279)
[0xa2abbd41]
/usr/lib/python2.4/site-packages/CEGUI/
_cegui_.so(_ZN5boost6python7objects12valu
e_holderIN5CEGUI6SystemEED1Ev+0x28)[0xa1c7e116]
/usr/local/lib/libboost_python-gcc40-1_34.so.1.34.0[0xa2d01a2e]
python[0x808b9f3]
python(PyDict_DelItem+0xc9)[0x807ba99]
python(PyObject_GenericSetAttr+0x2a1)[0x807f161]
python(PyObject_SetAttr+0xaa)[0x807e2ba]
python(PyEval_EvalFrame+0x2911)[0x80b7371]
python(PyEval_EvalCodeEx+0x835)[0x80ba745]
python[0x8100b59]
python(PyObject_Call+0x27)[0x80589d7]
python[0x805e28e]
python(PyObject_Call+0x27)[0x80589d7]
python(PyEval_CallObjectWithKeywords+0x6d)[0x80b3d2d]
python[0x80942a9]
python[0x808b859]
python[0x807a599]
python(PyDict_SetItem+0x65)[0x807bfc5]
python(_PyModule_Clear+0x164)[0x8102384]
python(PyImport_Cleanup+0x15d)[0x80d203d]
python(Py_Finalize+0xae)[0x80dc60e]
python(Py_Main+0x6e4)[0x8055824]
python(main+0x22)[0x8055032]
/lib/libc.so.6(__libc_start_main+0xdc)[0xa7e0c8cc]
python[0x8054f81]


Thanks,

Mike

On Feb 4, 9:02 pm, "Andy Miller" <nzmill...@gmail.com> wrote:
> You could also look to use the *setAutoDelete* function on the list items -


> perhaps set this to False which will stop the list from trying to delete the
> item and instead rely on the user code to do so.
>
> Cheers
>
> Andy
>

Lakin Wecker

unread,
Feb 4, 2007, 9:39:30 PM2/4/07
to python-ogre...@googlegroups.com
*** glibc detected *** python: free(): invalid pointer: 0x0a9b2f20 ***

The two or three times that I've ever seen this error, it has been caused by incorrect linking to libraries.  I don't remember the exact situation, but I had an older version of a library around that was being linked to at some stage.

Lakin

Andy Miller

unread,
Feb 4, 2007, 10:17:02 PM2/4/07
to python-ogre...@googlegroups.com
Happy to say it works for me under windows (no crash)..
 
I'm using Python-Ogre 0.8 as well :)
 
Cheers
 
Andy

 

Mike Handverger

unread,
Feb 4, 2007, 10:57:52 PM2/4/07
to Python Ogre Developers
Odd! It works fine for me in Windows with 0.7 now too. I initially had
this problem in Windows with 0.6 or so. At that time, I commented out
all the resetLists in my code. I'll check into Lakin's suggestion. I
just recompiled CEGUI, but also recompiled the Python wrapper as well.
I'll do some more checking to make sure there aren't any old .so's
around.

Thanks,

Mike

On Feb 4, 10:17 pm, "Andy Miller" <nzmill...@gmail.com> wrote:
> Happy to say it works for me under windows (no crash)..
>
> I'm using Python-Ogre 0.8 as well :)
>
> Cheers
>
> Andy
>

> On 05/02/07, Lakin Wecker <lakin.wec...@gmail.com> wrote:
>
>
>
> > *** glibc detected *** python: free(): invalid pointer: 0x0a9b2f20 ***
>
> > The two or three times that I've ever seen this error, it has been caused
> > by incorrect linking to libraries. I don't remember the exact situation,
> > but I had an older version of a library around that was being linked to at
> > some stage.
>
> > Lakin
>

Mike Handverger

unread,
Feb 5, 2007, 2:13:44 PM2/5/07
to Python Ogre Developers
I just relinked and reinstalled CEGUI and Ogre and then completely
rebuilt the CEGUI wrapper with no change. If someone who is running on
Linux could try the test app and let me know if it works or not, that
would be very helpful. That way we can determine if it is or is not
something related to my own setup.

Thanks,

Mike

On Feb 4, 10:57 pm, "Mike Handverger" <mike.handver...@gmail.com>

Game_Ender

unread,
Feb 5, 2007, 4:29:08 PM2/5/07
to Python Ogre Developers
On Feb 5, 2:13 pm, "Mike Handverger" <mike.handver...@gmail.com>
wrote:

> If someone who is running on
> Linux could try the test app and let me know if it works or not, that
> would be very helpful. That way we can determine if it is or is not
> something related to my own setup.

That would be me. I will give the app a try on my current setup which
is between 0.7 and 0.8. Then I will update to latest revision and
give another try.

dermont

unread,
Feb 6, 2007, 12:20:15 PM2/6/07
to Python Ogre Developers
Don't think is related to your build, I've encountered this problem
before with python-ogre 0.7.1. The glibc error reported above is
pretty common, looks like it may be a typo in your code:

#item.setAutoDeleted=False, should be either:
item.AutoDeleted=False
item.setAutoDeleted(False)
OR set in ctor:
item=cegui.ListboxTextItem(t,l.itemCount+1,None,False,False)

On Feb 6, 3:13 am, "Mike Handverger" <mike.handver...@gmail.com>

Mike Handverger

unread,
Feb 6, 2007, 3:30:40 PM2/6/07
to Python Ogre Developers
Good eye. I guess I couldn't decide if I wanted setAutoDeleted(False)
or AutoDeleted=False. :)

Thank you very much, that was it.

Reply all
Reply to author
Forward
0 new messages