Run the attached (compile first) program, after a
(random) while it results in a crash in ODE, usually
with the following stack:
ERROR - BrumeTest: Brume error :
System.AccessViolationException: Attempted to read or
write protected memory. This is often an indication
that other memory is corrupt.
at dJointGroupEmpty(dxJointGroup* )
at Ode.JointGroup.Empty()
at Brume.Brume.MoveScene(Single fElapsedTime)
at BrumeTest.BrumeTest.MoveScene(Single fElapsedTime)
in C:\Documents and Settings\Bart\Mijn
documenten\Visual Studio 2005
\Projects\BrumeTest\Form1.cs:line 64
at Brume.Brume.OnApplicationIdle(Object sender,
EventArgs e)
at
System.Windows.Forms.Application.ThreadContext.System.
Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdl
e(Int32 grfidlef)
at
System.Windows.Forms.Application.ComponentManager.Syst
em.Windows.Forms.UnsafeNativeMethods.IMsoComponentMana
ger.FPushMessageLoop(Int32 dwComponentID, Int32
reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMess
ageLoopInner(Int32 reason, ApplicationContext
context)
at
System.Windows.Forms.Application.ThreadContext.RunMess
ageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form
mainForm)
at Brume.Brume.Play()
Logged In: YES
user_id=1217268
Can you give me a more precise definition of 'a (random)
while' ?
I ran the sample multiple times, the last one was about 15
minutes without crash.
I tried many times without success.
But...I am sure the problem is there. I am sure of it
because we encoutered same problems six months ago (maybe
more now).
ODE was very unstable under Visual Studio Express. All
problems disapeared the day we moved to Visual Studio 2005.
So my question is : are you using Visual Studio Express ?
I join the same sample but compiled under Visual Studio 2005
so that you can test it on your config (I made it
standalone) and a screenshot as proof of my honesty ;o)
screenshot after 10 minutes
Logged In: YES
user_id=1217268
Ok the file is too big. Here is a link :
http://chrisk.free.fr/brume_files/contribs/Ode%20Bug.zip
Logged In: YES
user_id=1573578
The answer to your question is yes, I'm using Express. But
how could it differ? The compiler should produce same
output. And ODE.DLL is also the same. First I thought it
maybe had to do with the VC#-Hosting process, so I turned
that option off buit it still happens, even if I run the
exe outside the dev environment.
With respect to the randomness, it's usually within like 2
minutes. I'll try to find out something more about the
randomness later.
Logged In: YES
user_id=1573578
Something else came to my mind, both machines I tested it
on are dual core machines, (maybe it's a subtle
mutlithreading thing with the garbage collector and
unpinned unmanaged objects that only happens if threads
run really simultaneously). Guess ODE is Managed C++
wrapper ??
Logged In: YES
user_id=1217268
Dual core may be a reason and ODE Wrapper is Managed C++.
But first I want to be sure that you experience the problem
with my sample. I rebuilt this one in 'release' like other
Brume samples. It should work now
http://chrisk.free.fr/brume_files/contribs/Ode%20Bug.zip
By the way I am now using MDX August SDK. Can you check that
your test machine has Direct3DX.dll version 1.0.2911.0 ?
If not you can get the redist here :
http://www.microsoft.com/downloads/details.aspx?FamilyID=A1788990-5E11-4AE2-B5E7-CC576822AED4&displaylang=en
Thanks Bart.
Logged In: YES
user_id=1573578
Hi Chris
Sorry I was able to reproduce it with your latest code:
6-10-2006 21:52:23 ERROR - BrumeTest: Brume error :
System.AccessViolationException: Attempted to read or
write protected memory. This is often an indication that
other memory is corrupt.
at dJointGroupEmpty(dxJointGroup* )
at Ode.JointGroup.Empty()
at Brume.Brume.MoveScene(Single fElapsedTime)
at BrumeTest.BrumeTest.MoveScene(Single fElapsedTime)
at Brume.Brume.OnApplicationIdle(Object sender,
EventArgs e)
at
System.Windows.Forms.Application.ThreadContext.System.Windo
ws.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32
grfidlef)
at
System.Windows.Forms.Application.ComponentManager.System.Wi
ndows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushM
essageLoop(Int32 dwComponentID, Int32 reason, Int32
pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLo
opInner(Int32 reason, ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLo
op(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Brume.Brume.Play()
Sometimes it takes a long time; it's really a touch one, I
tried to force the bug by calling the GC and introducing
lots of new blocks per second but the frequency of the
crash doesn't increase... I have no clue what the triggers
are yet...
by the way I think there's a memory leak in ODE.Mass
(BoundsChecker reports it). It has unmanaged ptr to dMass
(alocated in Init()) which is nowhere deleted.
Regards,
Bart
Logged In: YES
user_id=1217268
Hi Bart !
Thanks for the test. I tried the sample on sevral machines
with success but I have no dual cores.
Are you able to find another machine with single code CPU
and check if you reproduce the problem ?
If not I will have to buy a dual core CPU ;o) (or change ODE
version....will be better no ?)
Or maybe someone else has reproduced the problem on single
core CPU ?
Logged In: YES
user_id=1573578
I have a single core as well at home, so I will give it a
try. By the way another option is to share the ODE
sourcecode so I can maybe run it instrumented with
BoundsChecker and/or Purify.
ps found another free cool physiscs engine but it has no
wrapper yet and I guess you know it already
http://www.tokamakphysics.com/index.htm
ps did you find/agree to the memory leak I reported?? Or
should i make a test program..
Regards,
Bart
Logged In: NO
Hi Bart !
I am sure the bug you reported exists ! All I want is to
reproduce it on my system or to find a workaround (new ODE
version ? maybe another engine...but it's a lot of work)
So I made two tests :
- first I tried the ODE0.7.NET2.0 wrapper
(http://www.pepperboy.net/ode.asp). I encoutered many
problems with it : major differences with the original
wrapper, XNA references, no source code ;o)
So I rolledback my source code.
- then I tried to update my wrapper to ODE 0.7 myself but in
a different manner. I imported the ODE project and compiled
the lib, then I imported the .NET wrapper project (CPP .NET)
and compiled it into a dll (linked with the ODE 0.7 lib)
Before I used to get the ODE libs without compiling them.
Hope it will change something (v0.7 + new compilation scenario)
I ran a test during a very long time and all I got was a
StackOverflow in the ODE step method (was due to the HUGE
amount of objects)
Can you check this new version of your sample :
http://chrisk.free.fr/brume_files/contribs/Ode%20Bug.zip
Regards,
Silmaryls
Logged In: YES
user_id=1573578
Hi Silmaryls
Just ran the test, ODE.dll is now 652 Kb.
It still crashes on the dual core machine. Same stack.
Strange thing; if I run it under BoundsChecker it's 10
times slower and doesn't seem to crash... timimng seems to
be critical as well as usual with these type of problems :-
)
Bart
Logged In: YES
user_id=1217268
I put the ode 0.7 and ode.NET Wrapper projects here
http://chrisk.free.fr/brume_files/contribs/ODEWrapper.zip
Not sure that it would help but tell me if you find something.
By the way...how many FPS do you have running the sample
without BoundsChecker ?
Silmaryls
Logged In: YES
user_id=1573578
Hi Silmaryls
Thanks for the zip. It has ODE 0.7 but I don't see the
managed wrapper which is probably where the problem is.
Which one do you actually use, the one from
http://www.thejamesrainenetwork.co.uk/ode/ode.html ??
The app runs at 110-130 FPS.
I tried to turn off concurrent GC and use of server GC but
it did not make any difference.
Bart
Logged In: YES
user_id=1217268
Hi
In fact the wrapper is in
ODEWrapper.zip\ODE\ode\ode\odeNET.vcproj
Sorry I didn't rename the directory. The source code is not
from www.thejamesrainenetwork.co.uk but from
http://homepage.ntlworld.com/david.walker530/ode/ but as I
said it is no longer alive.
The source code is really easy to upgrato to new ODE
versions (I started with v0.39 and now 0.7)