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 JoeJ » Wed May 08, 2013 2:18 pm

For me both the sandbox exes from the download (32 + 64) crash.
If i compile with vc2008 all is ok, and with vc2012 it's not.
Julio is also on Win7 x64.

It simply looks that something writes to memory wehre it should not.
That can work for a long time on one system, but crashes on another.
It reminds me to the alignement problems i once had - i accidently created a simd vector in a function call,
and there was no guaranty it's aligned properly doing so.
That worked mostly, but sometimes it crashed - also without a hint for the true reason... hard to find stuff.
For Newton you can exclude that case by trying the 64 bit build (i did not) - them anything should be aligned.
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 3:12 pm

not I do no thonk this is a windoes, or wxWdget or visual stutio or Newton core
it all seems to point to a memory overrun or uninitilized variable on the dScene deserialization library.
maybe a memory tracker can detected.
Joe seems to reproduce faithfully with VS 2012, I will download it tonight and se if I can reproduce it too.
I bet that when I build the Linux, this can be detected by Valgreen memory.

anyway the picture of what seem to be happening seems to be getting more clear now.
Until tonight.
Julio
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Enclave » Wed May 08, 2013 3:22 pm

Julio
JoeJ

I am revert back to rev.28, because trace it more simple.

Why "sizeof (dgVertexAtribute)" is zero? This is ok?
How it works?????

Here is a links about "sizeof"
http://stackoverflow.com/questions/4993650/what-is-sizeofsomething-0
http://stackoverflow.com/questions/2632021/can-sizeof-return-0-zero

In disassembler mode everything is ok. :?:

Code: Select all
      memcpy (attibArray, m_attrib, m_atribCount * sizeof(dgVertexAtribute));
007B5E55  mov         edx,dword ptr [this]
007B5E58  mov         eax,dword ptr [edx+2Ch]
007B5E5B  imul        eax,eax,60h
007B5E5E  push        eax 
007B5E5F  mov         ecx,dword ptr [this]
007B5E62  mov         edx,dword ptr [ecx+4038h]
007B5E68  push        edx 
007B5E69  mov         eax,dword ptr [attibArray]
007B5E6C  push        eax 
007B5E6D  call        @ILT+37975(_memcpy) (6E245Ch)
007B5E72  add         esp,0Ch
      GetAllocator()->FreeLow(m_attrib);
Attachments
error8.png
error8.png (65.25 KiB) Viewed 3334 times
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 4:26 pm

I think that is a Vidual studion debug error, it does no show sizeof properlly, if yo ulook at teh disaably
you will see that eh sized is 96 = 0x60;
and it is in thsi intruction
007B5E75 imul eax,eax,60h
so no it is no zero, it sow as zero in the debug


007B5E6F mov edx,dword ptr [this]
007B5E72 mov eax,dword ptr [edx+2Ch]
007B5E75 imul eax,eax,60h
007B5E78 push eax
007B5E79 mov ecx,dword ptr [this]
007B5E7C mov edx,dword ptr [ecx+38h]
007B5E7F push edx
007B5E80 mov eax,dword ptr [attibArray]
007B5E83 push eax
007B5E84 call @ILT+37995(_memcpy) (6E2470h)
007B5E89 add esp,0Ch

let me test this with Visual studio 2012 wha I get home.
I have test on three machine and I do no see the error happening, but tow are using the same win7 64
with VS 2010 proffetional. the third is a 32 bit with window xp proffetional and VS express 2010
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 5:21 pm

Urray afte installin VS 2012 express I got the error
Run-Time Check Failure #2 - Stack around the variable 'pureRotation' was corrupted.

I can not debug now, but I am guessing this will also happen at home.
so we know that teh solution on on the way.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 8:17 pm

Ok Joe, teh good new is that I figured out.
The bad new is that your bug maybe bo be teh same bug that
I figure out Joe Enclave is having.

you bug is actually a Visual studio bug.

I do no know if you remebr by few year ago, I have a fight with Microsof abput how buggy Vidal studio was.
The reply top me with, "Tough luck if you that what you get and we are not going to fix it"
well it is Visual studio 2012 and they still have not fixed any of those it.
what they did is that the took out the bach build funtionality all together and they added brand new bugs to the configuration settings.

Basically the problems that is that If yo uimport a Project form Visual studion 2010 into 2012 all teh buidl setting are scrupup an dteh debugget get confise with stuff that are not really error.

The debug buidl has lots of setting that are for relase build, but teh debuger still creast teh same variable.

for exmapel on teh finmtion that decompse teh matrix, it call Jacobu diagionalization.
bo teh code inline Jacoby diagionalization, wich has local variables.
so what happen is taht jacobi diagnalization write it values to tehsi local varibbel by teh caller intepre that as a stack over run.
I quickly when over teh debug settings, and teh bug when away.

I will check a new forder with visual stidion 2012 project and solution, I am sure that will fix the error your are haviong
I am no sure if these are teh same erros that Enclave is having.
unless he too is using visual studion 2012 and importing teh 2010 projects.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Wed May 08, 2013 10:54 pm

Ok guys I fox the VS 2008 and 2010 projects. I do not think it is even necessary to make the VS2012.

I suggest that you delete you newton folders or make a backup and checkout a new copy form SVN.
if you do no want to do that you will need to delete all VS 2012 project and reopen the VS 2010 solution so that It crate new copies with eth proper compile settings.

This is actually a bug with Visual studio not with Newton, but I am glad we found that out.
Let us hope that this is in fact the problem.


on a side note I noticed that VS 2012 now do generate SSE code for 32 bit projects, so maybe that a good reason to get a copy.
that combined with all the other optimizations like auto vectorization and lamda functions, make it a very good case.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Enclave » Thu May 09, 2013 3:44 am

Julio

Nothing has changed for me and the error remains. Line 569, file dMatrix.cpp
It happens on the two different computers, on my laptop and on the desktop, which contains the windows 7 x32 and x64.

Can you add some debugging code in the initialization function and load where the error occurs? The code should validate loaded data may then be possible to determine when the data is destroyed.

I can not keep track of loading the data, as code is too complicated for me, a lot of mathematical functions.
You can start with the function LoadFerryBridge (scene, triggerManager, sceneCollision, "platformBridge.ngd", slideMatrix, playGroundBody);
I not sure that we have a correct loading of some structures, like vertexIndex.

I don't now what to do else.

EDIT: add debug pictures

Look to the pictures, Julio.
The first one picture show the data from Windows XP
You can see step 13 and values is the same as in you picture at page 2.

The second one picture show the same on Windows 7.

You can see that normal values completely different!!!
I say more, the whole structure m_attrib does not contain a right data!

So, we need a some debug code, that will control the correct loading of data.
Attachments
noerror1_XP.png
Windows XP values
noerror1_XP.png (50.86 KiB) Viewed 3310 times
error9.png
Windows 7
error9.png (47.57 KiB) Viewed 3310 times
Last edited by Enclave on Thu May 09, 2013 5:02 am, edited 2 times in total.
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Kinematic and dynamic body: interaction?

Postby JoeJ » Thu May 09, 2013 4:58 am

Seems Julio forgot to remove the assert from dMatrix?
However, the false stack corruption alerts are gone, but other asserts happen now.
F. ex. if i set friction demo as default, i get node zero pointer assert in
DemoMesh::DemoMesh(const dScene* const scene, dScene::dTreeNode* const meshNode)

It seems the bug is still there, but it gives more meaningfull errors now.
Also downloaded exes still crash for me.

Enclave, you could change start up demo by modifying define in NewtonDemos.cpp if you wanna try if another demo works.
I'll create a simple demo to see if works without loading an ngd file...

EDIT: The Box stacks demo runs fine. So it seems bug is somewhere in scene loading stuff.
User avatar
JoeJ
 
Posts: 1489
Joined: Tue Dec 21, 2010 6:18 pm

Re: Kinematic and dynamic body: interaction?

Postby Enclave » Thu May 09, 2013 5:10 am

Enclave, you could change start up demo by modifying define in NewtonDemos.cpp if you wanna try if another demo works.
I'll create a simple demo to see if works without loading an ngd file...


Yes, i know, but is the Advanced player demo is enought for test.

If we disable loading ngd file, everything works ok.

Please look to the pictures in my previous post.
Perhaps, the loading of ngd file is not correct.
I don't know from where we gets the values for m_attrib structure, but you can see that is not match on different computers.

EDIT: Julio, i just run the sandbox on another computer. It is a laptop with Windows Vista x32.

I get the error again! Program crash at the same reason, assert at line 569 in a file dMatrix.cpp

For this moment, we have a 3 completely different PC's, that cannot run the sandbox demo.
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Thu May 09, 2013 7:14 am

I am not getting any of these error, in any of the machines I had try this: here or at work.

to by all on the same page I check in the code with the demo friction set to the default

I am downloading now VS 2012 to see if I can get the error loading the friction demo.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Thu May 09, 2013 8:07 am

I no do no undernand this because I just installed visual studio 2012 express and all the demos after changing the .rc file all the demos run with any problem.
I will create a new set of VS 2012 solutions so that we work on that.
Fractile are you using VS 2012 express?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Enclave » Thu May 09, 2013 8:42 am

The revision r37 is not build anymore on VS2008 Express - missing some projects..
Enclave
 
Posts: 81
Joined: Wed May 01, 2013 6:00 am

Re: Kinematic and dynamic body: interaction?

Postby Julio Jerez » Thu May 09, 2013 9:06 am

try again.

what I do no get is why it si that this does no work for you since you are using VS 2008,
the problem you are seem is a Visual studio 2012 Bug, the debugger is point to a different variable because it thinks that the function was inlined, but it was not.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Kinematic and dynamic body: interaction?

Postby Enclave » Thu May 09, 2013 9:12 am

OpenAL project is missing. Add it please)

Must i download and install VS2012 ? I don't like it..VS2008 is enough for me at this moment.
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 1 guest