Invalid TypeHandle index 209! Is memory corrupt?

hi,
i’m trying to install panda3d 1.9 on ubuntu 12.10 ,
i’ve installed the sdk through :

sudo apt-get install panda3d1.9

then i tried running a sample :

$: python Tut-Asteroids.py

but i got this :

DirectStart: Starting the game.
Traceback (most recent call last):
  File "Tut-Boxing-Robots.py", line 7, in <module>
    import direct.directbase.DirectStart
  File "/usr/share/panda3d/direct/directbase/DirectStart.py", line 3, in <module>
    from direct.showbase import ShowBase
  File "/usr/share/panda3d/direct/showbase/ShowBase.py", line 10, in <module>
    from pandac.PandaModules import *
  File "/usr/share/panda3d/pandac/PandaModules.py", line 50, in <module>
    from libpandaodeModules import *
  File "/usr/share/panda3d/pandac/libpandaodeModules.py", line 2, in <module>
    Dtool_PreloadDLL("libpandaode")
  File "/usr/share/panda3d/pandac/extension_native_helpers.py", line 79, in Dtool_PreloadDLL
    imp.load_dynamic(module, pathname)
ImportError: libCg.so: cannot open shared object file: No such file or directory

so looked it up in the forums and i fixed it with :

sudo apt-get install nvidia-cg-toolkit

but now when i try to run a sample i get :

DirectStart: Starting the game.
Invalid TypeHandle index 209!  Is memory corrupt?
Segmentation fault (core dumped)

what could seem to be the problem ???

This is strange, I’ve never seen something like this before. Can you tell us more about your system setup? ie. which architecture you’re running, which build you have installed, and which Python build?

python --version 
Python 2.7.3

this is strange

RELEASE 1.8.1 

this is what’s written in usr/share/panda3d/releaseNotes
although i used

sudo apt-get install panda3d1.9 panda3d-runtime

to install

i have ubuntu 12.10 32bit
on dell latitude with
Intel® Core™2 Duo CPU T7250 @ 2.00GHz × 2
Mobile Intel® GM45 Express Chipset x86/MMX/SSE2
2GB RAM

this is what i get from gdb :

#0  0xb793c8d0 in TypeRegistry::register_type(TypeHandle&, std::string const&) () from /usr/lib/panda3d/libp3dtool.so.1.9
#1  0xb14913d3 in register_type () from /usr/lib/panda3d/libpanda.so.1.9
#2  0xb1497aaf in StaticInitializer_config_chan::StaticInitializer_config_chan() () from /usr/lib/panda3d/libpanda.so.1.9
#3  0xb108a33d in _GLOBAL__sub_I_p3chan_composite2.cxx () from /usr/lib/panda3d/libpanda.so.1.9
#4  0xb7fece9b in call_init (env=0xbffff240, argv=0xbffff234, argc=2, l=<optimized out>) at dl-init.c:85
#5  call_init (l=<optimized out>, argc=2, argv=0xbffff234, env=0xbffff240) at dl-init.c:35
#6  0xb7fecf84 in _dl_init (main_map=<optimized out>, argc=2, argv=0xbffff234, env=0xbffff240) at dl-init.c:134
#7  0xb7ff0f96 in dl_open_worker (a=0xbfffd710) at dl-open.c:549
#8  0xb7feccbf in _dl_catch_error (objname=0xbfffd734, errstring=0xbfffd738, mallocedp=0xbfffd73f, operate=0xb7ff0c30 <dl_open_worker>, args=0xbfffd710) at dl-error.c:178
#9  0xb7ff07e4 in _dl_open (file=0x8b87dc4 "/usr/lib/panda3d/libpandaode.so", mode=-2147483646, caller_dlopen=0x8145ebe <_PyImport_GetDynLoadFunc+414>, nsid=-2, argc=2, 
    argv=0xbffff234, env=0xbffff240) at dl-open.c:639
#10 0xb7f9dbe9 in dlopen_doit (a=0xbfffd8e0) at dlopen.c:67
#11 0xb7feccbf in _dl_catch_error (objname=0x838dfec, errstring=0x838dff0, mallocedp=0x838dfe8, operate=0xb7f9db50 <dlopen_doit>, args=0xbfffd8e0) at dl-error.c:178
#12 0xb7f9e33a in _dlerror_run (operate=0xb7f9db50 <dlopen_doit>, args=0xbfffd8e0) at dlerror.c:164
#13 0xb7f9dc97 in __dlopen (file=0x8b87dc4 "/usr/lib/panda3d/libpandaode.so", mode=2) at dlopen.c:88
#14 0x08145ebe in _PyImport_GetDynLoadFunc ()
#15 0x0809526f in _PyImport_LoadDynamicModule ()
#16 0x08060215 in ?? ()
#17 0x080a034b in PyEval_EvalFrameEx ()
#18 0x080a08f8 in PyEval_EvalFrameEx ()
#19 0x080a6c99 in PyEval_EvalCodeEx ()
#20 0x0810d717 in PyEval_EvalCode ()
#21 0x0814d9a4 in PyImport_ExecCodeModuleEx ()
#22 0x0813dead in ?? ()
#23 0x080d3cd8 in ?? ()
#24 0x080fe49f in ?? ()
#25 0x080d3fe0 in ?? ()
#26 0x080e1286 in ?? ()
#27 0x080dd625 in PyEval_CallObjectWithKeywords ()
#28 0x080a24df in PyEval_EvalFrameEx ()
#29 0x080a6c99 in PyEval_EvalCodeEx ()
#30 0x0810d717 in PyEval_EvalCode ()
#31 0x0814d9a4 in PyImport_ExecCodeModuleEx ()
#32 0x0813dead in ?? ()
#33 0x080d3cd8 in ?? ()
#34 0x080fe49f in ?? ()
#35 0x080d42c2 in ?? ()
#36 0x080e1286 in ?? ()
#37 0x080dd625 in PyEval_CallObjectWithKeywords ()
#38 0x080a24df in PyEval_EvalFrameEx ()
#39 0x080a6c99 in PyEval_EvalCodeEx ()
#40 0x0810d717 in PyEval_EvalCode ()
#41 0x0814d9a4 in PyImport_ExecCodeModuleEx ()
#42 0x0813dead in ?? ()
#43 0x080d3cd8 in ?? ()
#44 0x0813e502 in ?? ()
#45 0x080d4107 in ?? ()
#46 0x080e1286 in ?? ()
#47 0x080dd625 in PyEval_CallObjectWithKeywords ()
#48 0x080a24df in PyEval_EvalFrameEx ()

Thank you, that is extremely helpful. Hmm, this seems to be a static init ordering issue, and I have a clue where it’s coming from. I’ve seen something similar a while back.

I’ll get back to you on this.