crash when creating actor based on nxs shape Linux

toglia

29-04-2010 07:06:06

Finally I got to build NxOgre (0.9) on Linux, it wasn't that difficult, basically I'll I did was in this 2007 post viewtopic.php?p=29441, lol :D.

But when using my newly created dynamic library my program was crashing every time I tried to use any previously created nxs shape. All my shapes we're precooked in windows with flour at some point, and my program works perfectly on windows.

The world starts ok and I can even create actors with basic shaped like cube, spheres, etc. So, I was just wondering if anybody have seen this before?

I can't give much more information cause for some reason every time I hit a breakpoint the computer freezes... NxOgre log won't show either.

Maybe its something about the filesystem?

betajaen

29-04-2010 09:35:50

Sounds like it. Perhaps it's using windows paths.

toglia

30-04-2010 04:04:35

Ok, I have double checked, that version used to expect my nxs files in the execution folder at the same level of the exe. Now in Linux I have the same thing. Could it be the different line ending or something?

Has anybody ever used a windows precooked nxs files in Linux?

toglia

03-05-2010 03:10:31

Finally I could debug the application and see where it was crashing.

mShapeDescription.meshData = actor->getNxScene()->getPhysicsSDK().createConvexMesh(rbuf);

I could also see that rbuf was not null, so the file was found at least.
UserStream rbuf(meshname.c_str(), true);

But, after giving a close look at the "FILE" instance I'm suspecting its not reading it properly. I thought It might be the line ending so I tried using the dos2unix program but it didn't fix the problem, so now I'm out of clues. I know it has to do with the nxs file...

betajaen

03-05-2010 22:01:59

I can't remember anything of 0.9, but does it write to a file or to memory when cooking?

toglia

03-05-2010 23:15:51

Well the thing is that my shapes were precooked in windows with flour. So, for what I know I think I'm not cooking at all. I could send you the call stack in a couple hours. I still think it has to do with the UserStream file reading, it finds it, but doesn't read anything.

betajaen

04-05-2010 00:23:15

Perhaps the NXS file formats between Linux and Windows are different to each other?

toglia

04-05-2010 14:50:52

I've been like crazy and tried a lot of nxs files, old ones (a couple years old), new ones, and all of them give the same crash when trying to create the convex mesh:
UserStream rbuf(meshname.c_str(), true);
mShapeDescription.meshData = actor->getNxScene()->getPhysicsSDK().createConvexMesh(rbuf);


The old ones where created by nxogre 0.9 itself, the new ones with flour. And I'm pretty sure I'm using good files.

betajaen

04-05-2010 16:10:47

Then it must be the process of writing and reading to those files, rather than the files themselves.

I don't have 0.9 source on hand, UserStream writes to memory or files? Looks like files based on the arguments.

toglia

04-05-2010 16:48:16

To memory, I just uploaded the files...

http://www.toglia.com.ve/nxogre/NxOgreUserStreamH.txt
http://www.toglia.com.ve/nxogre/NxOgreUserStreamCPP.txt

I really don't see anything wrong with it. I'm sure "fp" isn't null after:
fp = fopen(filename, load ? "rb" : "wb");

betajaen

04-05-2010 17:48:42

UserStream is files.
MemoryWrite/ReadStream is memory (obviously).

All I can think of is, permission errors (due to Linux), the path being in correct, or Linux hates PhysX. The UserStream is PhysX code it was borrowed from one of the PhysX tutorials. You could try replacing UserStream with MemoryWriteBuffer/MemoryReadBuffer.


I know your still using 0.9 for a reason; but Detritus handles files and memory far more elegantly than 0.9 will ever do.

toglia

05-05-2010 02:28:34

I think PhysX just hates Linux! :evil: I have granted all the permissions with "chmod 777" to my nxs files, still crash. I know the path is ok cause "fopen" returns not null.

Well I would love to use Detritus, but I have a lot of code done in 0.9 and that version is the closest working NxOgre on Linux I got (which is priority now).