yoshinoToylogic / bulletsharp

Automatically exported from code.google.com/p/bulletsharp
MIT License
0 stars 0 forks source link

stepSimulation -> AccessViolationException #40

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Compile Bullet + BulletSharp and use the BulletSharp.dll

What is the expected output? What do you see instead?

It always crashes in the DynamicsWorld::StepSimulation function with a 
AccessViolationException. But only if timeStep is higher than 0.
(see ExceptionInfos.txt)

What version of the product are you using? On what operating system?

Windows 7 Pro 64bit
Visual Studio 2010 C++/C# Express
Everything with latest updates and german language

This happens with Bullet/BulletSharp 2.80 sp1 and also with the latest trunk 
versions. I'm using Bullet with cmake and default compile options. It happens 
with debug and release builds.

Please provide any additional information below.

The precompiled dll from the BulletSharp downloads runs without any problems.

Original issue reported on code.google.com by Hagn99@gmail.com on 29 Jun 2012 at 8:17

Attachments:

GoogleCodeExporter commented 8 years ago
Forgot to say that the Bullet demos works fine too.

Original comment by Hagn99@gmail.com on 29 Jun 2012 at 8:46

GoogleCodeExporter commented 8 years ago
The AccessViolationException usually means that some objects that the 
DynamicsWorld uses during the simulation are disposed too soon. This can happen 
if you don't keep references to objects that you pass to the world (so they go 
out of scope and get disposed). Try taking things out of the world until the 
error goes away. These can be collision objects, collision shapes, constraints, 
etc.

I can't reproduce this bug in trunk/demos/XNA4/BasicDemo. Are you using the 
demo code from SVN trunk too? And also Bullet code from trunk?

Original comment by andres.traks on 29 Jun 2012 at 8:52

GoogleCodeExporter commented 8 years ago
Yes I'm using the latest XNA4/BasicDemo. It also happens with my own project. I 
can give you a copy of my Bullet/BulletSharp environment if you want.

Original comment by Hagn99@gmail.com on 29 Jun 2012 at 8:54

GoogleCodeExporter commented 8 years ago
Ah, I think I see what's going on. Try passing a constraint solver explicitly 
to DynamicsWorld like so:
World = new DiscreteDynamicsWorld(Dispatcher, Broadphase, new 
SequentialImpulseConstraintSolver(), collisionConf);

If you pass null, then Bullet is supposed to create a default solver, but 
there's a bug in Bullet where that doesn't work. I sent a patch, but it was 
forgotten or something:
http://code.google.com/p/bullet/issues/detail?id=573&can=1&colspec=Modified%20ID
%20Type%20Stars%20Status%20Owner%20Summary&start=100

I'll see if I can contact Erwin about it.

Original comment by andres.traks on 29 Jun 2012 at 9:12

GoogleCodeExporter commented 8 years ago
Ah great. That worked. Thank you very much.

Original comment by Hagn99@gmail.com on 29 Jun 2012 at 9:16

GoogleCodeExporter commented 8 years ago
The patch was applied to Bullet, so null can be used again. 
http://code.google.com/p/bullet/source/detail?r=2541

Thanks for reporting!

Original comment by andres.traks on 29 Jun 2012 at 10:44