*glibc detected* double free? - Linux - pyogre 1.2.0

ice

07-07-2006 20:23:46

I'm having a problem running the pyogre demos using the dev-1.2.0 branch and OGRE 1.2.1.

When I run sudo python setup.py install I get:

ice@icebreaker:~/src/pyogre-1.2.0$ sudo python setup.py install
running install
running build
running build_ext
building 'pyogre._ogre' extension
swigging pyogre/ogre/ogre.i to pyogre/ogre/ogre_wrap.cxx
swig -python -c++ -modern -Ipyogre/ogre -I/usr/local/include -I/usr/local/include/OGRE -o pyogre/ogre/ogre_wrap.cxx -outd ir pyogre pyogre/ogre/ogre.i
/usr/local/include/OGRE/OgreCommon.h:268: Warning(362): operator= ignored
/usr/local/include/OGRE/OgreVertexIndexData.h:189: Warning(362): operator= ignored
/usr/local/include/OGRE/OgreFont.h:355: Warning(362): operator= ignored
/usr/local/include/OGRE/OgreRenderQueueSortingGrouping.h:47: Warning(314): pass is a python keyword, symbol will be renam ed as '_pass'
/usr/local/include/OGRE/OgreFileSystem.h:106: Warning(402): Base class 'ArchiveFactory' is incomplete.
/usr/local/include/OGRE/OgrePrerequisites.h:189: Warning(402): Only forward declaration 'ArchiveFactory' was found.
/usr/local/include/OGRE/OgreRibbonTrail.h:62: Warning(401): Nothing known about base class 'Node::Listener'. Ignored.
/usr/local/include/OGRE/OgreMath.h:62: Warning(509): Overloaded operator *(Ogre::Radian const &) const is shadowed by ope rator *(Ogre::Real) const at /usr/local/include/OGRE/OgreMath.h:61.
/usr/local/include/OGRE/OgreMath.h:86: Warning(509): Overloaded Ogre::Degree(Ogre::Radian const &) is shadowed by Ogre::D egree(Ogre::Real) at /usr/local/include/OGRE/OgreMath.h:85.
/usr/local/include/OGRE/OgreMath.h:216: Warning(509): Overloaded Ogre::Math::Abs(Ogre::Radian const &) is shadowed by Abs (Ogre::Real) at /usr/local/include/OGRE/OgreMath.h:214.
/usr/local/include/OGRE/OgreMath.h:242: Warning(509): Overloaded Ogre::Math::Cos(Ogre::Real) is shadowed by Cos(Ogre::Rad ian const &) at /usr/local/include/OGRE/OgreMath.h:232.
/usr/local/include/OGRE/OgreMath.h:232: Warning(509): Overloaded Cos(Ogre::Radian const &,bool) is shadowed by Cos(Ogre:: Real,bool) at /usr/local/include/OGRE/OgreMath.h:242.
/usr/local/include/OGRE/OgreMath.h:256: Warning(509): Overloaded Sign(Ogre::Radian const &) is shadowed by Sign(Ogre::Rea l) at /usr/local/include/OGRE/OgreMath.h:252.
/usr/local/include/OGRE/OgreMath.h:252: Warning(509): Overloaded Sign(Ogre::Real) is shadowed by Sign(Ogre::Radian const &) at /usr/local/include/OGRE/OgreMath.h:256.
/usr/local/include/OGRE/OgreMath.h:281: Warning(509): Overloaded Ogre::Math::Sin(Ogre::Real) is shadowed by Sin(Ogre::Rad ian const &) at /usr/local/include/OGRE/OgreMath.h:271.
/usr/local/include/OGRE/OgreMath.h:271: Warning(509): Overloaded Sin(Ogre::Radian const &,bool) is shadowed by Sin(Ogre:: Real,bool) at /usr/local/include/OGRE/OgreMath.h:281.
/usr/local/include/OGRE/OgreMath.h:287: Warning(509): Overloaded Sqrt(Ogre::Radian const &) is shadowed by Sqrt(Ogre::Rea l) at /usr/local/include/OGRE/OgreMath.h:285.
/usr/local/include/OGRE/OgreMath.h:285: Warning(509): Overloaded Sqrt(Ogre::Real) is shadowed by Sqrt(Ogre::Radian const &) at /usr/local/include/OGRE/OgreMath.h:287.
/usr/local/include/OGRE/OgreMath.h:321: Warning(509): Overloaded Ogre::Math::Tan(Ogre::Real) is shadowed by Tan(Ogre::Rad ian const &) at /usr/local/include/OGRE/OgreMath.h:311.
/usr/local/include/OGRE/OgreMath.h:311: Warning(509): Overloaded Tan(Ogre::Radian const &,bool) is shadowed by Tan(Ogre:: Real,bool) at /usr/local/include/OGRE/OgreMath.h:321.
pyogre/ogre/OgreSkeleton.i:24: Warning(509): Overloaded getAnimation(Ogre::String const &) const is shadowed by getAnimat ion(Ogre::String const &) const at /usr/local/include/OGRE/OgreSkeleton.h:210.
pyogre/ogre/OgreSkeletonInstance.i:15: Warning(509): Overloaded getAnimation(Ogre::String const &) const is shadowed by g etAnimation(Ogre::String const &) const at /usr/local/include/OGRE/OgreSkeletonInstance.h:71.
/usr/local/include/OGRE/OgrePositionTarget.h:57: Warning(473): Returning a pointer or reference in a director method is n ot recommended.
/usr/local/include/OGRE/OgrePositionTarget.h:57: Warning(473): Returning a pointer or reference in a director method is n ot recommended.
/usr/local/include/OGRE/OgreTargetManager.h:59: Warning(473): Returning a pointer or reference in a director method is no t recommended.
gcc -pthread -fno-strict-aliasing -DNDEBUG -O3 -march=i486 -mtune=i686 -march=athlon-xp -O3 -pipe -fPIC -Ipyogre/ogre -I/ usr/local/include -I/usr/local/include/OGRE -I/usr/include/python2.4 -c pyogre/ogre/ogre_wrap.cxx -o build/temp.linux-i68 6-2.4/pyogre/ogre/ogre_wrap.o
gcc: : No such file or directory
error: command 'gcc' failed with exit status 1

Dunno why this happened.. so I run it again:

ice@icebreaker:~/src/pyogre-1.2.0$ sudo python setup.py install
running install
running build
running build_ext
building 'pyogre._ogre' extension
skipping pyogre/ogre/ogre.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -O3 -march=i486 -mtune=i686 -march=athlon-xp -O3 -pipe -fPIC -Ipyogre/ogre -I/ usr/local/include -I/usr/local/include/OGRE -I/usr/include/python2.4 -c pyogre/ogre/VertexBufferProxy.cxx -o build/temp.l inux-i686-2.4/pyogre/ogre/VertexBufferProxy.o
gcc: : No such file or directory
In file included from /usr/include/python2.4/Python.h:8,
from pyogre/ogre/VertexBufferProxy.h:8,
from pyogre/ogre/VertexBufferProxy.cxx:1:
/usr/include/python2.4/pyconfig.h:835:1: warning: "_POSIX_C_SOURCE" redefined
In file included from /usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/i486-slackware-linux/bits/os_ defines.h:39,
from /usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/i486-slackware-linux/bits/c++ config.h:35,
from /usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_algobase.h:64,
from /usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/vector:67,
from pyogre/ogre/VertexBufferProxy.h:4,
from pyogre/ogre/VertexBufferProxy.cxx:1:
/usr/include/features.h:150:1: warning: this is the location of the previous definition
pyogre/ogre/VertexBufferProxy.cxx: In member function `void VertexBufferProxy::setByte(Ogre::uint32, Ogre::uint32, const Ogre::Vector4&)':
pyogre/ogre/VertexBufferProxy.cxx:153: warning: converting to `unsigned char' from `const Ogre::Real'
pyogre/ogre/VertexBufferProxy.cxx:154: warning: converting to `unsigned char' from `const Ogre::Real'
pyogre/ogre/VertexBufferProxy.cxx:155: warning: converting to `unsigned char' from `const Ogre::Real'
pyogre/ogre/VertexBufferProxy.cxx:156: warning: converting to `unsigned char' from `const Ogre::Real'
error: command 'gcc' failed with exit status 1

And again:

ice@icebreaker:~/src/pyogre-1.2.0$ sudo python setup.py install
running install
running build
running build_ext
building 'pyogre._ogre' extension
skipping pyogre/ogre/ogre.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -O3 -march=i486 -mtune=i686 -march=athlon-xp -O3 -pipe -fPIC -Ipyogre/ogre -I/ usr/local/include -I/usr/local/include/OGRE -I/usr/include/python2.4 -c pyogre/ogre/IndexBufferProxy.cxx -o build/temp.li nux-i686-2.4/pyogre/ogre/IndexBufferProxy.o
gcc: : No such file or directory
error: command 'gcc' failed with exit status 1

... And again:

ice@icebreaker:~/src/pyogre-1.2.0$ sudo python setup.py install
running install
running build
running build_ext
building 'pyogre._ogre' extension
skipping pyogre/ogre/ogre.i
gcc -pthread -fno-strict-aliasing -DNDEBUG -O3 -march=i486 -mtune=i686 -march=athlon-xp -O3 -pipe -fPIC -Ipyogre/ogre -I/ usr/local/include -I/usr/local/include/OGRE -I/usr/include/python2.4 -c pyogre/ogre/EventSystem.cxx -o build/temp.linux-i 686-2.4/pyogre/ogre/EventSystem.o
gcc: : No such file or directory
error: command 'gcc' failed with exit status 1

And finally:

ice@icebreaker:~/src/pyogre-1.2.0$ sudo python setup.py install
running install
running build
running build_ext
building 'pyogre._ogre' extension
skipping pyogre/ogre/ogre.i
c++ -pthread -shared -march=athlon-xp -O3 -pipe build/temp.linux-i686-2.4/pyogre/ogre/ogre_wrap.o build/temp.linux-i686-2 .4/pyogre/ogre/VertexBufferProxy.o build/temp.linux-i686-2.4/pyogre/ogre/IndexBufferProxy.o build/temp.linux-i686-2.4/pyo gre/ogre/EventSystem.o -o build/lib.linux-i686-2.4/pyogre/_ogre.so -L/usr/local/lib -lOgreMain
building 'pyogre._cegui' extension
swigging pyogre/cegui/cegui.i to pyogre/cegui/cegui_wrap.cxx
swig -python -c++ -modern -Ipyogre/cegui -I/usr/local/include/CEGUI -I/usr/local/include/OGRE -I/usr/local/include -Ipyog re/ogre -o pyogre/cegui/cegui_wrap.cxx -outdir pyogre pyogre/cegui/cegui.i
/usr/local/include/OGRE/OgreSceneManager.h:2409: Warning(401): Nothing known about base class 'IntersectionSceneQuery'. I gnored.
/usr/local/include/OGRE/OgreSceneManager.h:2420: Warning(401): Nothing known about base class 'RaySceneQuery'. Ignored.
/usr/local/include/OGRE/OgreSceneManager.h:2430: Warning(401): Nothing known about base class 'SphereSceneQuery'. Ignored .
/usr/local/include/OGRE/OgreSceneManager.h:2440: Warning(401): Nothing known about base class 'PlaneBoundedVolumeListScen eQuery'. Ignored.
/usr/local/include/OGRE/OgreSceneManager.h:2450: Warning(401): Nothing known about base class 'AxisAlignedBoxSceneQuery'. Ignored.
/usr/local/include/CEGUI/CEGUIcolour.h:257: Warning(503): Can't wrap 'operator CEGUI::argb_t' unless renamed to a valid i dentifier.
gcc -pthread -fno-strict-aliasing -DNDEBUG -O3 -march=i486 -mtune=i686 -march=athlon-xp -O3 -pipe -fPIC -I/usr/local/incl ude/CEGUI -I/usr/local/include/OGRE -I/usr/local/include -I/usr/include/python2.4 -c pyogre/cegui/cegui_wrap.cxx -o build /temp.linux-i686-2.4/pyogre/cegui/cegui_wrap.o -DEXT_HASH
pyogre/cegui/cegui_wrap.cxx: In function `const CEGUI::String& CEGUI_Window_tooltipType_get(CEGUI::Window*)':
pyogre/cegui/cegui_wrap.cxx:4088: warning: returning reference to temporary
pyogre/cegui/cegui_wrap.cxx: In function `const CEGUI::UVector2& CEGUI_Window_windowSize_get(CEGUI::Window*)':
pyogre/cegui/cegui_wrap.cxx:4098: warning: returning reference to temporary
c++ -pthread -shared -march=athlon-xp -O3 -pipe build/temp.linux-i686-2.4/pyogre/cegui/cegui_wrap.o -o build/lib.linux-i6 86-2.4/pyogre/_cegui.so -L/usr/local/lib -L/usr/localÃ/lib -lCEGUIOpenGLRenderer -lCEGUIOgreRenderer -lOgreMain -lCEGUIBa se -lCEGUIFalagardBase
running build_py
copying pyogre/ogre.py -> build/lib.linux-i686-2.4/pyogre
copying pyogre/__init__.py -> build/lib.linux-i686-2.4/pyogre
copying pyogre/cegui.py -> build/lib.linux-i686-2.4/pyogre
running install_lib
copying build/lib.linux-i686-2.4/pyogre/_ogre.so -> /usr/lib/python2.4/site-packages/pyogre
copying build/lib.linux-i686-2.4/pyogre/_cegui.so -> /usr/lib/python2.4/site-packages/pyogre
copying build/lib.linux-i686-2.4/pyogre/ogre.py -> /usr/lib/python2.4/site-packages/pyogre
copying build/lib.linux-i686-2.4/pyogre/cegui.py -> /usr/lib/python2.4/site-packages/pyogre
byte-compiling /usr/lib/python2.4/site-packages/pyogre/ogre.py to ogre.pyc
byte-compiling /usr/lib/python2.4/site-packages/pyogre/cegui.py to cegui.pyc

Weird that I got those No such file or directory errors, but seems to have worked ok let's try the demos...

ice@icebreaker:~/src/pyogre-1.2.0/demos/ogre$ python SkyPlaneDemo.py
*** glibc detected *** double free or corruption (!prev): 0x0819c270 ***
Aborted

I have copied the plugins.cfg file to that dir, and changed it to use /usr/local/lib/OGRE as PluginsFolder

Running gdb, I see the following backtrace:

(gdb) r SkyPlaneDemo.py
Starting program: /usr/local/bin/python SkyPlaneDemo.py
[Thread debugging using libthread_db enabled]
[New Thread -1211337024 (LWP 12575)]
*** glibc detected *** double free or corruption (out): 0x0819a000 ***

Program received signal SIGABRT, Aborted.
[Switching to Thread -1211337024 (LWP 12575)]
0xb7cf1847 in raise () from /lib/tls/libc.so.6
(gdb) bt
#0 0xb7cf1847 in raise () from /lib/tls/libc.so.6
#1 0xb7cf30d9 in abort () from /lib/tls/libc.so.6
#2 0xb7d25616 in __libc_message () from /lib/tls/libc.so.6
#3 0xb7d2bd4f in _int_free () from /lib/tls/libc.so.6
#4 0xb7d2c0ea in free () from /lib/tls/libc.so.6
#5 0xb6c4d721 in operator delete () from /usr/lib/libstdc++.so.6
#6 0xb6c2e657 in std::string::_Rep::_M_destroy () from /usr/lib/libstdc++.so.6
#7 0xb6c2e8ff in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string ()
from /usr/lib/libstdc++.so.6
#8 0xb6ee4656 in Root (this=0x8189578, pluginFileName=@0x81cdcd0, configFileName=@0xbff32700, logFileName=@0xbff32720)
at basic_string.h:2044
#9 0xb74171a8 in _wrap_new_Root () from /usr/lib/python2.4/site-packages/pyogre/_ogre.so
#10 0x08108868 in PyCFunction_Call (func=0xb66e126c, arg=0xb7a800cc, kw=0x6) at Objects/methodobject.c:108
#11 0x0805c69e in PyObject_Call (func=0x311f, arg=0xb7a800cc, kw=0x0) at Objects/abstract.c:1756
#12 0x080b0228 in ext_do_call (func=0xb66e126c, pp_stack=0x0, flags=-1213726516, na=0, nk=0) at Python/ceval.c:3835
#13 0x080ae2b6 in PyEval_EvalFrame (f=0x821fc74) at Python/ceval.c:2203
#14 0x080ae9c3 in PyEval_EvalCodeEx (co=0xb7a7a8e0, globals=0x819a000, locals=0x6, args=0x821fc74, argcount=2, kws=0x0,
kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2736
#15 0x08108394 in function_call (func=0xb6633bc4, arg=0xb7a8f70c, kw=0x0) at Objects/funcobject.c:548
#16 0x0805c69e in PyObject_Call (func=0x311f, arg=0xb7a8f70c, kw=0x0) at Objects/abstract.c:1756
#17 0x080632d4 in instancemethod_call (func=0xb6633bc4, arg=0xb7a8f70c, kw=0x0) at Objects/classobject.c:2447
#18 0x0805c69e in PyObject_Call (func=0x311f, arg=0xb7b593ac, kw=0x0) at Objects/abstract.c:1756
#19 0x080918e1 in slot_tp_init (self=0x0, args=0xb7b593ac, kwds=0x0) at Objects/typeobject.c:4762
#20 0x0808c065 in type_call (type=0x0, args=0xb7b593ac, kwds=0x0) at Objects/typeobject.c:443
#21 0x0805c69e in PyObject_Call (func=0x311f, arg=0xb7b593ac, kw=0x0) at Objects/abstract.c:1756
#22 0x080affb1 in do_call (func=0x8217bf4, pp_stack=0xb7b593ac, na=1, nk=135897088) at Python/ceval.c:3766
#23 0x080afa00 in call_function (pp_stack=0xbff32d8c, oparg=135897088) at Python/ceval.c:3581
#24 0x080adef0 in PyEval_EvalFrame (f=0x816ae9c) at Python/ceval.c:2163
#25 0x080afed4 in fast_function (func=0x6, pp_stack=0xbff32ecc, n=1, na=1, nk=-1235384148) at Python/ceval.c:3640
#26 0x080afa81 in call_function (pp_stack=0xbff32ecc, oparg=135897088) at Python/ceval.c:3579
#27 0x080adef0 in PyEval_EvalFrame (f=0x8188a04) at Python/ceval.c:2163
#28 0x080afed4 in fast_function (func=0x6, pp_stack=0xbff3300c, n=1, na=1, nk=-1235384148) at Python/ceval.c:3640
#29 0x080afa81 in call_function (pp_stack=0xbff3300c, oparg=135897088) at Python/ceval.c:3579
#30 0x080adef0 in PyEval_EvalFrame (f=0x81596bc) at Python/ceval.c:2163
#31 0x080ae9c3 in PyEval_EvalCodeEx (co=0xb7c4bc60, globals=0x819a000, locals=0x6, args=0x81596bc, argcount=0, kws=0x0,
kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2736
#32 0x080b1825 in PyEval_EvalCode (co=0xb7c4bc60, globals=0xb7c9e824, locals=0xb7c9e824) at Python/ceval.c:484
#33 0x080e03d9 in run_node (n=0xb7c9e824, filename=0xbff35224 "SkyPlaneDemo.py", globals=0xb7c9e824, locals=0xb7c9e824,
flags=0xbff33184) at Python/pythonrun.c:1265
#34 0x080dfb5a in PyRun_SimpleFileExFlags (fp=0x814c008, filename=0xbff35224 "SkyPlaneDemo.py", closeit=1,
flags=0xbff33184) at Python/pythonrun.c:860
#35 0x0805553f in Py_Main (argc=135577608, argv=0xbff33244) at Modules/main.c:484
#36 0x08054fc9 in main (argc=2, argv=0xbff33244) at Modules/python.c:23
(gdb) frame 8
#8 0xb6ee4656 in Root (this=0x8189578, pluginFileName=@0x81cdcd0, configFileName=@0xbff32700, logFileName=@0xbff32720)
at basic_string.h:2044
2044 return __str;
Current language: auto; currently c++
(gdb) list
2039 operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
2040 const _CharT* __rhs)
2041 {
2042 basic_string<_CharT, _Traits, _Alloc> __str(__lhs);
2043 __str.append(__rhs);
2044 return __str;
2045 }
2046
2047 /**
2048 * @brief Concatenate string and character.


Which leads me to believe that something is going wrong in Ogre::Root constructor. Looking in there for operator+ I see:

mVersion = StringConverter::toString(OGRE_VERSION_MAJOR) + "." +
StringConverter::toString(OGRE_VERSION_MINOR) + "." +
StringConverter::toString(OGRE_VERSION_PATCH) + " " +
"(" + OGRE_VERSION_NAME + ")";

I have no idea why this would cause a double free or corruption.

Maybe the reason for all of this has something to do with the problems I was having running setup.py?

Perhaps someone can shed some light on this. Thanks in advance!