Kinematic and dynamic body: interaction?

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: Kinematic and dynamic body: interaction?

Postby Enclave » Tue May 07, 2013 6:26 pm

are you sure you have the latest code.


when you sync to SNV you soudl make a backup of your order copy and delete the forder and check out a new copy form SVN.
maybe there is a corrupted file


Yes, yes, it is the latest. I delete old folder, make a new folder and sync to.

The only difference is that I am using VS proffesional and you are using express.
when I run in debug it run fine in my system in debug, release 32 and 64 bit.


An error happens also with your demoSandbox.exe, which you have compiled on your system.

It hit again in a revision 27 at the same position..strange.

Here:

void dgMeshEffect::ApplyTransform (const dgMatrix& matrix)
{
matrix.TransformTriplex(&m_points[0].m_x, sizeof (dgBigVector), &m_points[0].m_x, sizeof (dgBigVector), m_pointCount);
matrix.TransformTriplex(&m_attrib[0].m_vertex.m_x, sizeof (dgVertexAtribute), &m_attrib[0].m_vertex.m_x, sizeof (dgVertexAtribute), m_atribCount);

dgMatrix rotation ((matrix.Inverse4x4()).Transpose4X4());
for (dgInt32 i = 0; i < m_atribCount; i ++) {
dgVector n (dgFloat32 (m_attrib[i].m_normal_x), dgFloat32 (m_attrib[i].m_normal_y), dgFloat32 (m_attrib[i].m_normal_z), dgFloat32 (0.0f));
n = rotation.RotateVector(n);
dgAssert ((n % n) > dgFloat32 (0.0f));
n = n.Scale (dgRsqrt (n % n));
m_attrib[i].m_normal_x = n.m_x;
m_attrib[i].m_normal_y = n.m_y;
m_attrib[i].m_normal_z = n.m_z;
}
}



Have you seen a pictures?
There are division by zero, when scaling the "n" vector, it becomes null on step 13 in for:next cycle. Look to debug data.

I have to check the error on another computer, at my work. :idea: At home it's a Win7x32 (laptop), at work it's WinXP, tomorrow a will check about an error.
I have to go sleep, because a deep night now). :roll:
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Tue May 07, 2013 8:16 pm

yes I look at teh local and this is what I get at the exact same line
bug.png
bug.png (174.48 KiB) Viewed 3745 times

as you can see the normal values there is [0, 0, 1]

please after you try on a different PC, if teh bug is still there I can add so trace code so see where that norrmal become 0, 0, 0
Julio Jerez
Moderator
Moderator
 
Posts: 12484
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Enclave » Wed May 08, 2013 2:43 am

Julio,
i have check how it runs on another computer, it works ok.

I think this is a system dependent error or, something wrong with my system. But i don't now what.

One month ago i already got very similar error. When i tryed to run my project on my laptop, i got an error, but on other computers it works fine. I debug it and i find that an error was in the STD:string template library when i make a full path to resources of my project (textures, scripts and other). The internal string buffer in the template library become corrupt with unknown reason. I have not solved that problem, i just rewrite initialisation function to not use the STD:string.

But, currently we have a little different case. The previous version, (3.04) that i have, works ok without errors and asserts.
And last version is not works.

Do you have any ideas, why this happens and how to fix? May be you change something in a somewhere project, while working on mac project, linux etc?
The SVN revisions history is reset now, so i cannot load the previous versions to check, when this error occurs. I think it was after 3.05 build to last, i have not sync SVN to yesterday.

And about the theme topic!))
You made a very nice option! The kinematic bodies are collidable now, i check it, it works ok. Currently, it works as I wanted and how it should be.
But, we have some unexpected behavior of player.

Here are issues:

1) The Player perform an unexpected large jump when it on the Hanging bridge.
2) The same jump occurs when it try to stand on some primitives (for example cube) and then move.
3) When the player is standing on the vibrating hanging bridge, a player does not move with the bridge.

It looks like as if the dynamic body adds impulse to the player.
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Kinematic and dynamic body: interaction?

Postby JoeJ » Wed May 08, 2013 5:45 am

A while ago i've had a similar issue: I tried to compile sandbox with VS Express 2012.
A similar bug happened during initialization of the default demo, somewhere at camera setup.
I tried to track it down a little and got the impression that some other thread corrupted a value in the camera class.
Then i switched to VC2008 and the issue was gone.

I try that again now, using 2010 Express Project in 2012, having this thing to change:

error RC2102: string literal too long C:\dev\newton-dynamics-read-only\packages\thirdParty\glew\build\VS_2010\glew.rc
... changed glew license string to be shorter

EDIT (got project working following Birds adwise)

There's division by zero...

> demosSandbox_d.exe!dMatrix::PolarDecomposition(dMatrix & transformMatrix, dVector & scale, dMatrix & stretchAxis, const dMatrix & initialStretchAxis) Line 601 C++
demosSandbox_d.exe!dScene::FreezeScale() Line 657 C++
demosSandbox_d.exe!DemoEntityManager::LoadScene(const char * const fileName) Line 462 C++

here in:

void dMatrix::PolarDecomposition (dMatrix& transformMatrix, dVector& scale, dMatrix& stretchAxis, const dMatrix& initialStretchAxis) const

if (dAbs (det - 1.0f) < 1.e-5f) {
// this is a pure scale * rotation * translation
det = dSqrt (det2);
(det is zero)


But i think the problem is deeper down, because VC is telling me this when killing exe:

Run-Time Check Failure #2 - Stack around the variable 'LL' was corrupted.

So the issue is still there and there's good chance that it is also causing other issues from this post.
Julio, maybe you can download 2012 and try that too. For me the older VC2008 still works after installing 2012.
User avatar
JoeJ
 
Posts: 1494
Joined: Tue Dec 21, 2010 6:18 pm

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 6:37 am

wheel three things had changed.
1- I made the assert cross platform by turning in a macro. in windows resolve to _ASSERTE on anything else resolve to assert
2- I added that option for kinematic body collision

I do no thing those are the move of the bug.
The biggest change was the move to wxWidget. I suspect that where the error is.
three year ago I had to abandom wxWidget because all of the bugs in it and how hard was to track anything.

now I switched to latest version an I believe it is no playing nice.

last night when adding the VS express project, I have a random crash in a place I never had it for over 5 or 6 years now. in the Memory manage in newton.
I went to sleep and now it is no happing.


Joe are you builing in Linux, I have noi being able to because I intalled Linux using wubi and on the mode some of the tools like scripts get permission denied.
there a mode to set then to "run as executable" but this is ridicules because some scrript call other script and it is a while goose chase.
wxWidget call ton of script, therefore I need to install Linux on a legitimate partition to build wxwidget.

Maybe wxWdget 2.9.4 is not ready for prime time. Let us give some more time many the bug show up more clear.

the part that is also estrange to me is that the crash happens on visual studio express.
Julio Jerez
Moderator
Moderator
 
Posts: 12484
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 6:41 am

Ok I will install Vs studio express on the old laptop see if I can get the error to happens.
Julio Jerez
Moderator
Moderator
 
Posts: 12484
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 7:08 am

Ok I am installing service pack3 first, or I can no go to the microsoft download center
I have to do manually, appears Microsoft discontinue service on windows xp.

anyway after I download that I will install VS express 2008, 2010 and 2012 and try it out.


also on the misbehavior of the player, yes I am aware of that, I need to deal with the case of how to handle the iteration of the player with moving dynamics bodies.
like I said on the first post this is a two part problem.
1- adding the option for kinematic body to behave like static bodies.
2- make the player controller aware of these kinematic bodies

I only did the first part, I will do the secund over the weekend.
Julio Jerez
Moderator
Moderator
 
Posts: 12484
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Enclave » Wed May 08, 2013 7:23 am

like I said on the first post this is a two part problem.
1- adding the option for kinematic body to behave like static bodies.
2- make the player controller aware of these kinematic bodies

I only did the first part, I will do the secund over the weekend.


Ok, it's clear now! I will wait the second part)

How wxWidgets can cause an error? Maybe is a stack corruption or the memory variables? And how can you debug it.
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Kinematic and dynamic body: interaction?

Postby JoeJ » Wed May 08, 2013 7:49 am

If i remember right, i tracked the bug down until i noticed that a variable was changed outside the scope of the current function.
Thus my assumption about some other thread that writes beyond array bounds or something like that...
That was while reporting CCD bugs, so it was before the change to wxWidgets.

No Linux for me yet.
At the moment i sit on a Mac, but tried the VC2012 stuff inside VirtualBox-Windows 7.
That's seriously useable to do developement if you don't need fast gfx.
OpenGL is software and no extensions beyond 1.2 (I've had to disable something like WglSwapBuffersEXT).
Hardware OpenGL did not work for me - but it might on Windows host.
My Ragdoll app runs at 10-20 fps.
Virtual Machine could be a nice testing enviroment for multiplatform developement.
User avatar
JoeJ
 
Posts: 1494
Joined: Tue Dec 21, 2010 6:18 pm

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 8:09 am

well I cannot run any of the windows updates. xp is too old and nothing seems to work on this PC.

I think it is because the bios is all screw up, I remember I had dual boot on that system and some how I runing it and format the drive. ever since I was never able to use it.
Even when I try to install lnux as natove it fail. The system is too old.

any was about the problem you think this was happen before? I never new about that.

the engine can run in a single thread,
if you open file c:\Users\Julio\Desktop\newton-dynamics\coreLibrary_300\source\core\dgThread.h

and you place this line:

#define DG_USE_THREAD_EMULATION

then the engine will run on the caller thread, if something is corrupting data then we should see where it is happing.
try that see if the crash happens.
mean time I see if I can install VS express on this system.


what I am afraid is that I install VS express and the bug does no happen because I already have VS professional and the installer will not override some of the libraries.
Julio Jerez
Moderator
Moderator
 
Posts: 12484
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby JoeJ » Wed May 08, 2013 8:36 am

#define DG_USE_THREAD_EMULATION did not change much, only that this time stack around another variable in the same functiuon is corrupted.
I don't think it's something wrong in the engine - we would have been noticed that most probably. 99% sure it's only DemoSandbox issue.
Are there other things multithreaded, like loading assets, generating UI stuff...?
Also i would not wonder if it has to do with OpenGL.
Maybe it has nothing to do with threading at all. I was thinking maybe it's that aligning simd stuff does not work in VC2012 as expected here,
because i've had similar results from that with my own stuff.
User avatar
JoeJ
 
Posts: 1494
Joined: Tue Dec 21, 2010 6:18 pm

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 8:56 am

The sandbox demos must works, because this is how people interface and try what engine can do.

when you define DG_USE_THREAD_EMULATION then nothing in the engine is multithreaded.
if after doing that the crash is still happening this had to be wxWidget or VS express related.
In my old lop top afte installing exploerer 8 now the windows update is working.
I am downloading the engine form SNV and I already have VS 2010 express there


to repacap can you please tell me what steps are you doing.
is this crash happing after you download and build or do you have to do something else?

maybe I can determone why this is happining in this laptop.
this is a HP pavilion with an AMD 1.2 ghz not hardwre acceleration NO gpu, it runs opengl mesa.

if this is relater to opengl, then I may even no see the bug because of software emulation of openGL in this laptop.
Julio Jerez
Moderator
Moderator
 
Posts: 12484
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby StabInTheDarkSoft » Wed May 08, 2013 9:09 am

The 32bit "demosSandbox.exe" was crashing until I rebuilt it.
I was able to rebuild the debug and release of the "demosSandbox" with VS 2010.
I think making the player Collidable is having some strange effects.
Player interacts ok with added primitives but not with the bridge.
In the 32 bit version Bridge is acting like a trampoline and pushing player straight up extremely high.
The 64bit builds okay. In the 64 bit version the bridge becomes quite distorted after interaction with player.


I am running Windows 7 64bit, VS 2010 professional edition.
StabInTheDarkSoft
 
Posts: 2
Joined: Mon Apr 08, 2013 9:17 am

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 9:15 am

but the exe was build using he same code. it should not crash.
are you also using VS express?

let us not worry about the player thing, and find out what is causing these crashes.
I do no want to make any change until I test this in a 32 bit system with VS express 2010.

I am in the process of trying in it, but my laptop is down a bunch of updates. loot is windows updates, and Norton updates.
this could take some time.
Julio Jerez
Moderator
Moderator
 
Posts: 12484
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Enclave » Wed May 08, 2013 9:25 am

I tried the "#define DG_USE_THREAD_EMULATION"
It is no effect, the error happens again at the same place.

I think this error happens only in Windows 7 32 bit and this is cannot be VS2008 Express issue, because i have run demoSandbox.exe compiled by you, it also crashes.

Julio, do you have Windows 7 32bit to test this bug?


let us not worry about the player thing, and find out what is causing these crashes.


Yes, is better to fix the crash first.
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests