Bullet samples segfault

Using my own build from CVS, the Bullet hello world sample segfaults at launch. Everything else seems fine though. No build errors.

Using the snapshot build from Buildbot (1.8.0+cvs20120719~precise39) the Bullet samples work fine.

I have bullet-2.80-rev2531 installed. Are there any other tricks to compiling with Bullet support?

Here’s the stack trace…

(gdb) run 01_Basics.py 
Starting program: /usr/bin/python 01_Basics.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
DirectStart: Starting the game.
Known pipe types:
(all display modules loaded.)
[New Thread 0x7fffdd0ba700 (LWP 11523)]
[Thread 0x7fffdd0ba700 (LWP 11523) exited]
[New Thread 0x7fffdd0ba700 (LWP 11524)]
[New Thread 0x7fffd88b8700 (LWP 11525)]

Program received signal SIGSEGV, Segmentation fault.                                                                                                                                                       
0x00000000000f1976 in ?? ()                                                                                                                                                                                
(gdb) bt                                                                                                                                                                                                   
#0  0x00000000000f1976 in ?? ()                                                                                                                                                                            
#1  0x00007fffd3d37583 in BuildInstants (module=0x1f14e18) at built/tmp/libpandabullet_igate.cxx:50426                                                                                                     
#2  0x00007ffff57b2dce in Dtool_PyModuleInitHelper (defs=0x7fffffffb060, modulename=0x7fffd3d44807 "libpandabullet") at dtool/src/interrogatedb/py_panda.cxx:468                                           
#3  0x00007fffd3c5dd52 in initlibpandabullet () at built/tmp/libpandabullet_module.cxx:18                                                                                                                  
#4  0x000000000047af44 in _PyImport_LoadDynamicModule ()                                                                                                                                                   
#5  0x000000000053d7db in ?? ()                                                                                                                                                                            
#6  0x00000000004fc1a3 in ?? ()                                                                                                                                                                            
#7  0x000000000053e0a4 in ?? ()                                                                                                                                                                            
#8  0x00000000004c2e6b in ?? ()                                                                                                                                                                            
#9  0x0000000000497ea4 in PyEval_EvalFrameEx ()                                                                                                                                                            
#10 0x0000000000498602 in PyEval_EvalFrameEx ()                                                                                                                                                            
#11 0x000000000049f1c0 in PyEval_EvalCodeEx ()                                                                                                                                                             
#12 0x00000000004a8960 in ?? ()                                                                                                                                                                            
#13 0x00000000004e9f36 in PyObject_Call ()                                                                                                                                                                 
#14 0x00000000004ec11a in ?? ()                                                                                                                                                                            
#15 0x00000000004e9f36 in PyObject_Call ()                                                                                                                                                                 
#16 0x00000000004eaa2b in PyObject_CallFunctionObjArgs ()                                                                                                                                                  
#17 0x000000000047e6aa in ?? ()                                                                                                                                                                            
#18 0x000000000049a55a in PyEval_EvalFrameEx ()
#19 0x000000000049f1c0 in PyEval_EvalCodeEx ()
#20 0x00000000004a9081 in PyRun_FileExFlags ()
#21 0x00000000004a9311 in PyRun_SimpleFileExFlags ()
#22 0x00000000004aa8bd in Py_Main ()
#23 0x00007ffff68e576d in __libc_start_main (main=0x41b980 <main>, argc=2, ubp_av=0x7fffffffdfc8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffdfb8)
    at libc-start.c:226
#24 0x000000000041b9b1 in _start 

(gdb) up
#1  0x00007fffd3d37583 in BuildInstants (module=0x1f14e18) at built/tmp/libpandabullet_igate.cxx:50426
50426      PyModule_AddIntConstant(module,"X_up",0);


Looks like a build conflict, as if some of your Panda libraries are compiled against a different version of Python or so.

yup, that was it.

But now I have the same problem with Windows x64. I compiled bullet 2.80-rev2541 using VS2008, as a 64-bit release. Copied the libs and headers into panda’s thirdparty directory and did makepanda.

I can import the bullet modules, e.g.

from panda3d.bullet import BulletWorld

but when I do


it crashes. I just get an error message that “Python has stopped working”, and then Windows tries helplessly to find a solution to the problem for a while. I figure I’ll have to learn how to do debugging on Windows, but first I just thought I’d ask if there are any particular compile options when building Bullet? I just used the defaults in the VS project.

I just had a look at the Bulletworld constructor, and I have to admit that there is very bad support for finding errors. For example I do not assert creation of internal objects, and there is no feedback on the spam channel. I can add these later today. Might help finding out what is going on.