ApplyExtenalForces and ESP Error

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

ApplyExtenalForces and ESP Error

Postby vamman » Thu Aug 04, 2011 5:02 pm

Hello,

Thank you for making newton open source. I have been experiencing a strange bug that I hope there is a fix for. Currently VS2010 debugger throws the following error when in debug mode:

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.


Now usually this error is caused by the wrong calling conventions, as the message states, but sometimes it is caused by sending the wrong pointer or not sending one as well. I've isolated exactly where the compiled crashes and that is when *this is sent. Does anyone have any ideas? Surely someone else has experienced this. Whenever I run NewtonUpdate(NWorld_, StepTime); this happens! I know I am sending all of the right parameters.

Code: Select all
inline void dgBody::ApplyExtenalForces (dgFloat32 timestep, dgInt32 threadIndex)
{
   m_accel = dgVector (dgFloat32 (0.0f), dgFloat32 (0.0f), dgFloat32 (0.0f), dgFloat32 (0.0f));
   m_alpha = dgVector (dgFloat32 (0.0f), dgFloat32 (0.0f), dgFloat32 (0.0f), dgFloat32 (0.0f));
   if (m_applyExtForces) {
      m_applyExtForces([b]*this[/b], timestep, threadIndex);
   }
}
vamman
 
Posts: 1
Joined: Thu Aug 04, 2011 4:55 pm

Re: ApplyExtenalForces and ESP Error

Postby Julio Jerez » Thu Aug 04, 2011 9:27 pm

my guess is that you funtion pointer m_applyExtForces is the wrong prototye.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 7 guests

cron