Page MenuHome

Blender crash when physics createConstraint
Closed, ResolvedPublic


System Information
Windows 8.1 intel 4200

Blender Version
Broken: 2.71

Short description of error
Blender crash when physics createConstraint

Exact steps for others to reproduce the error

Open this file and run game engine.
This line:
vehicle = PC.createConstraint(,0,11)
make crash.

Event Timeline

Marcin Nijaki (marcino15) raised the priority of this task from to 90.
Marcin Nijaki (marcino15) updated the task description. (Show Details)
Marcin Nijaki (marcino15) edited a custom field.

Can you try to test this with a recent buildbot build? I ask because I opened two files of my own making use of physics constraints on my machine (one making use of the vehicle template and the other being just generic constraint creation) and there were no crashes.

I have checked the example and 2.69, 2.71 and current master work OK. In 2.70 the vehicle had a weird behaviour. But in any case blender didn't crash.

Could you check the file in current master (2.72RC) to test if the file works right for you now?

I make several tests with Blender 2.72b:
Machine1: Windows 7 64 and Linux, Radeon 5670
Machine2: Windows 8.1 intel 4200

On machine1 evething is OK (both systems), but on machine2 Blender still crashing.

I get random crashes when adding and removing 6dof constraints,

I wish that blender crashing would show a debug screen.....

what object was processed when game crashed?

what step in the game loop?

Blender crashes on this line:
vehicle = PC.createConstraint(,0,11)

I can confirm that the file doesn't crash with Blender 2.72b on Windows 7 64-bit. So probably it's a Windows 8 issue.

Hi Thomas and Martijn,

As platform maintainers both of you have been added to the loop because we have several crashes in bullet related to windows 8.1. Could you check them, please?

Dalai Felinto (dfelinto) lowered the priority of this task from 90 to 50.Jan 19 2015, 1:52 PM

I get a crash on OSX as well (Blender 2.73).
The problem is an assert:

btAssert(wheel>=0 && wheel < getNumWheels());

And if I print out the variables I get wheel == 4, getNumWheels() == 4.
The back trace is the following:

#0  0x00000001017084e5 in btRaycastVehicle::applyEngineForce (this=0x11651a070, force=-0, wheel=4) at /Users/dfelinto/blender/git/blender/extern/bullet2/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp:384
#1  0x000000010133c669 in WrapperVehicle::ApplyEngineForce (this=0x1125738d0, force=-0, wheelIndex=4) at /Users/dfelinto/blender/git/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp:231
#2  0x000000010142e339 in KX_VehicleWrapper::PyApplyEngineForce (this=0x112530f40, args=0x110969108) at /Users/dfelinto/blender/git/blender/source/gameengine/Ketsji/KX_VehicleWrapper.cpp:160
#3  0x000000010142ed29 in KX_VehicleWrapper::sPyApplyEngineForce (self=0x1109c68a0, args=0x110969108) at KX_VehicleWrapper.h:41
#4  0x00000001019fcca2 in PyEval_EvalFrameEx (f=0x110b9d3e8, throwflag=<value temporarily unavailable, due to optimizations>) at Python/ceval.c:4227
#5  0x00000001019f7b74 in PyEval_EvalCodeEx (_co=<value temporarily unavailable, due to optimizations>, globals=<value temporarily unavailable, due to optimizations>, locals=<value temporarily unavailable, due to optimizations>, args=<value temporarily unavailable, due to optimizations>, argcount=<value temporarily unavailable, due to optimizations>, kws=<value temporarily unavailable, due to optimizations>, defs=<value temporarily unavailable, due to optimizations>, defcount=<value temporarily unavailable, due to optimizations>, closure=<value temporarily unavailable, due to optimizations>) at Python/ceval.c:3578
#6  0x00000001019718d5 in function_call (func=0x110977378, arg=<value temporarily unavailable, due to optimizations>, kw=<value temporarily unavailable, due to optimizations>) at Objects/funcobject.c:632
#7  0x000000010194f3e7 in PyObject_Call (func=0x110977378, arg=0x10ab0f048, kw=0x0) at Objects/abstract.c:2067
#8  0x00000001019ffced in PyEval_CallObjectWithKeywords (func=0x110977378, arg=<value temporarily unavailable, due to optimizations>, kw=0x0) at Python/ceval.c:4104
#9  0x000000010147080d in SCA_PythonController::Trigger (this=0x116518ca0, logicmgr=0x1049fbd10) at /Users/dfelinto/blender/git/blender/source/gameengine/GameLogic/SCA_PythonController.cpp:443
#10 0x0000000101467bb6 in SCA_LogicManager::BeginFrame (this=0x1049fbd10, curtime=0.1641945997873942, fixedtime=0.016666666666666666) at /Users/dfelinto/blender/git/blender/source/gameengine/GameLogic/SCA_LogicManager.cpp:200
#11 0x000000010140ff1a in KX_Scene::LogicBeginFrame (this=0x1058edc00, curtime=0.1641945997873942) at /Users/dfelinto/blender/git/blender/source/gameengine/Ketsji/KX_Scene.cpp:1575
#12 0x00000001013cbbf0 in KX_KetsjiEngine::NextFrame (this=0x1049fb470) at /Users/dfelinto/blender/git/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp:668
#13 0x00000001012997d6 in BL_KetsjiNextFrame (ketsjiengine=0x1049fb470, C=0x104805ec8, win=0x110dac1d8, scene=0x106bb8e08, ar=0x115b25948, keyboarddevice=0x1058eb400, mousedevice=0x1058ec800, draw_letterbox=0) at /Users/dfelinto/blender/git/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp:136
#14 0x0000000101298e4a in StartKetsjiShell (C=0x104805ec8, ar=0x115b25948, cam_frame=0x7fff5fbff2e0, always_use_expand_framing=1) at /Users/dfelinto/blender/git/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp:581
Dalai Felinto (dfelinto) raised the priority of this task from 50 to 90.Jan 19 2015, 1:57 PM

After further investigating I have no problems with the file once I comment out the following lines in the Python script:

138    vehicle.applyEngineForce(["force"],4)
139    vehicle.applyEngineForce(["force"],5)

So all that is left is the Windows 8 related bug.

Can I expect fix this bug in near future?

I think HG1 already committed a fix, in 2.73 but it made constraints break, but there is already a fix for that in 2.73a

I am not sure if it only fixed crashes from rigid body joints, or if vehicle constraints were effected as well.

Vehicle constraints in 2.73a still not working.

Hello! I had the same issue (with Blender 64 bits on windows 8.1 64 bits). Building Blender with Mingw with default options solved the problem. When I build with visual studio 2013, it still doesn't work.

I confirm Dalai's debugging. The problem is that you are accessing wheels 4 and 5 with the applyEngineForce, while you only have wheels 0 to 3.
That is why it is crashing, though it shouldn't. I am changing to print an error message instead.

The test file also mentioned wheel wiggling but I could not reproduce, so @Marcin Nijaki (marcino15) please confirm closing.
(the change should be on the next daily build: )

I deleted lines with accessing wheels 4 and 5, but still crashing on line: vehicle = PC.createConstraint(,0,11)

@Inês Almeida (brita_) did you test it on Windows 8.1?

Inês Almeida (brita_) changed the task status from Resolved to Unknown Status.Feb 10 2015, 12:02 PM

I do not have a windows machine. I get no crash on Linux 64bit.
I need the windows maintainers to test me this, then..

Inês Almeida (brita_) lowered the priority of this task from 90 to Normal.Feb 10 2015, 12:03 PM

Hello! I don't know if it can helps, but here is a topic I made about the bug on BA:

This .blend:

crashes Blender too. And many others. I don't know if it's a bug with KX_VehicleWrapper.cpp. I don't think so because it works on windows 7 and it works with 32 bits versions of Blender. So it's a bug which concerns only Blender 64 bits on windows 8.1 64 bits.

I tested on 2 windows 8.1 machines:

First: GTX660 intel core2quad q9550 windows 8.1 pro 64 bits Blender 64 bits
Second: Intel HD 4000 intel core i5 3230m windows 8.1 pro 64 bits Blender 64 bits

On the 2 machines I have python 3.4.2 64 bits installed and Visual studio 2013. On the 2 machines, the .blend I mentionned crashes. Same with the Marcino .blend. Compile blender with mingw solve the problem (But other issues appeared...). So I'm wondering if the bug is related to a missing library in 64 bits sources (I'm a noob so I can't affirm anything), or a conflicting built dll (visual studio: vcomp120.dll, msvcr120.dll, msvcp120.dll... or python dll...). I don't know (just noob ideas).

To recap:

  • Concerns only 64 bits versions of Blender on Windows 8.1 64 bits
  • Tested on 2 machines, same crash (and several people mentionned this bug in BA forum)
  • Happens with bge.constraints (but again, only with 64 bits versions of Blender on windows 8.1 64 bits)

Hope this could help! And thank you very much for trying to resolve the bug!

  • The bug occured for the first time when updated from 2.70a to 2.71

I am also having this error on blender 2.73a on windows 8.1 64.

it's crashing on the part where I create the vehicle constraint - just like everyone else.

  1. create the constraint vehicle_Constraint = constraints.createConstraint(chassisId, 0, 11)

Works for me! Thank you very much! And Congrats!