Re: Unstable VFS in CS2.0
"Joshua Tan Tang Sheng (IHPC)" <[email protected]>
| Newsgroups | gmane.comp.graphics.crystalspace.devel |
|---|---|
| Message-ID | <D81C67A49AC916479413B4751FB0871E10150931CD@S3-EXCHMB03.shared-svc.local> |
Hi, Thanks Jorrit and Weltall for your replies. @Jorrit: We experienced several strange problems with using the plugin. We're trying to make a model of a vehicle (a box balanced on three wheels). The box was connected to the wheels via joints (the default 6DOF provided in the plugin implementation), and we were trying to make the vehicle move by applying forces to two of the wheels (the left wheel and the right wheel). What happened was: 1) If the vehicle came to a complete stop, it could not move again 2) Repeated calls to joint->setdesired velocity to change the speed of the vehicle eventually resulted in the wheels becoming misaligned. For example, the wheels would start moving into the box, or they would start jiggling about all over the place. We managed to come up with a workaround (when changing the velocity of the vehicle, remove the joints, realign the wheels and the body, reattach the joints with the new velocity), but remain unsatisfied with what we think is a hack. After all, it would seem to be intuitively true that we can simply change the velocity of the joints without all these unwanted side effects occurring. In addition, we want to explore using collision groups, which are not implemented in CS2.0. They are beginning to be implemented in CS2.1, but simply copying the code over is not easy because the entire physics system seems to have undergone a major revamp in 2.1. Hence, we decided that direct access to the bullet engine would help us 1) More accurately pinpoint bug sources - we couldn't tell whether the problems we were facing were due to the plugin, or due to the fact that the plugin only supports the 6DOF and that another joint should have been used, etc 2) We want to access bullet features that are not currently supported by the plugin, without the constraints the plugin places us in, and without having to learn how the bullet plugin in cs is structured in addition to having to learn how bullet itself works. What's more, given that active redevelopment of the physics system in 2.1 is underway, we're also not sure of the enduring value of modifying the bullet plugin based on the architecture of cs2.0 3) It is easier for us to find tutorials and examples covering the use of bullet (since it is used in many other 3d engines) than those covering how to use bullet through the plugin system in crystalspace. -----Original Message----- From: [email protected] [mailto:[email protected]] Sent: Friday, August 10, 2012 3:13 PM To: [email protected] Subject: Crystal-develop Digest, Vol 75, Issue 4 Send Crystal-develop mailing list submissions to [email protected] To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/crystal-develop or, via email, send a message with subject or body 'help' to [email protected] You can reach the person managing the list at [email protected] When replying, please edit your Subject line so it is more specific than "Re: Contents of Crystal-develop digest..." Today's Topics: 1. Re: Unstable VFS in CS2.0 (Jorrit Tyberghein) 2. Re: Unstable VFS in CS2.0 (Weltall) 3. Static build of viewmesh works but crashes (Jorrit Tyberghein) ---------------------------------------------------------------------- Message: 1 Date: Wed, 8 Aug 2012 11:25:54 +0200 From: Jorrit Tyberghein <[email protected]> Subject: Re: [Crystal-develop] Unstable VFS in CS2.0 To: [email protected] Message-ID: <CAA49VVKGyk=cbfYEotrKFWzpy1t6H6wwQBm_taW07P+Q0N4=ww@mail.gmail.com> Content-Type: text/plain; charset="windows-1252" That's indeed weird. To me it sounds like memory is being corrupted/overwritten. Are you on linux? Then you could use valgrind to test for this. On windows there might be equivalent memory checking tools. Other then that I have no idea. One question though. Why are you using bullet directly? Why not use the CS bullet plugin? Greetings, On Wed, Aug 8, 2012 at 11:01 AM, Joshua Tan Tang Sheng (IHPC) < [email protected]> wrote: > Hi,**** > > ** ** > > I have a perplexing problem with what appears to be an incorrectly > functioning vfs on runtime. But first off, here?re the links to my > code:** > ** > > ** ** > > Header file http://pastebin.ca/2178376**** > > Cpp file http://pastebin.ca/2178377**** > > ** ** > > This is simply a modified appsimple1 where I try to use the bullet > engine directly. It works fine until I introduce a pointer to an int > on line 90 of the header file. Note that I never actually use it; I > just declare it. Once it is introduced, the system is somehow unable > to load textures from the > VFS: it claims that it can't find the files in the VFS. > canvas.openglcommon also claims it can't open the driver database > file, and the engine can't load the shaders. They all print error > messages stating that they can't find or can't open the files, or that > the files are not available.**** > > ** ** > > It doesn't matter which pointer type I use, int*, float*, etc all > produce the same error. What's even more interesting is this:**** > > You will see that on line 60 of the header file i have declared a > csRef<iVFS>; if I uncomment that, i.e. both declarations of > csRef<iVFS> and > float* are in effect, then I don't get this problem. But, if I only > have one of the declarations in effect, then the problem arises.**** > > ** ** > > I initially thought it was some low level memory problem. However, I > tried compiling and running the code on a different machine and > experienced a different problem. This time, I am unable to reproduce > the bug > consistently: sometimes the code works with just the single int*, > sometimes it doesn?t work even with both the csRef and int* enabled. > Sometimes, the code will refuse to work, and if I quit and restart, it > works fine. (Note that when I say ?refuse to work? I?m referring to > the abovementioned VFS > problem.) This seems to indicate some sort of threading problem.**** > > ** ** > > Does anyone have any ideas on what is going on?**** > > IHPC Values :: Impact :: Honesty :: Performance :: Co-operation This > email is confidential and may be privileged. If you are not the > intended recipient, please delete it and notify us immediately. Please > do not copy or use it for any purpose, or disclose its contents to any > other person. Thank you. > > > ---------------------------------------------------------------------- > -------- > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. > Discussions will include endpoint security, mobile security and the > latest in malware threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Crystal-develop mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/crystal-develop > > -- Project Manager of Crystal Space (http://www.crystalspace3d.org) and CEL (http://cel.crystalspace3d.org) Support Crystal Space. Donate at https://sourceforge.net/donate/index.php?group_id=649 Personal page: http://users.telenet.be/jorritTyberghein/ -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ Message: 2 Date: Wed, 8 Aug 2012 15:07:53 +0200 From: Weltall <[email protected]> Subject: Re: [Crystal-develop] Unstable VFS in CS2.0 To: [email protected] Message-ID: <CAAR4zyTYYcq4MntGvW=2qu3wUhWvW42zzxA=StDE4s=dANGVEQ@mail.gmail.com> Content-Type: text/plain; charset=windows-1252 Eunsoo (touko), is currently working on vfs and has noticed some issues with memory management so memory overwriting is well possible. Weird things seems to happen also in other platforms like arm regarding threads. So yes what you are experiencing is well possible. You could try running a debugger/valgrind to try to figure out helpful elements. 2012/8/8 Jorrit Tyberghein <[email protected]>: > That's indeed weird. To me it sounds like memory is being > corrupted/overwritten. Are you on linux? Then you could use valgrind > to test for this. On windows there might be equivalent memory checking > tools. > > Other then that I have no idea. > > One question though. Why are you using bullet directly? Why not use > the CS bullet plugin? > > Greetings, > > On Wed, Aug 8, 2012 at 11:01 AM, Joshua Tan Tang Sheng (IHPC) > <[email protected]> wrote: >> >> Hi, >> >> >> >> I have a perplexing problem with what appears to be an incorrectly >> functioning vfs on runtime. But first off, here?re the links to my code: >> >> >> >> Header file http://pastebin.ca/2178376 >> >> Cpp file http://pastebin.ca/2178377 >> >> >> >> This is simply a modified appsimple1 where I try to use the bullet >> engine directly. It works fine until I introduce a pointer to an int >> on line 90 of the header file. Note that I never actually use it; I >> just declare it. Once it is introduced, the system is somehow unable >> to load textures from the >> VFS: it claims that it can't find the files in the VFS. >> canvas.openglcommon also claims it can't open the driver database >> file, and the engine can't load the shaders. They all print error >> messages stating that they can't find or can't open the files, or that the files are not available. >> >> >> >> It doesn't matter which pointer type I use, int*, float*, etc all >> produce the same error. What's even more interesting is this: >> >> You will see that on line 60 of the header file i have declared a >> csRef<iVFS>; if I uncomment that, i.e. both declarations of >> csRef<iVFS> and >> float* are in effect, then I don't get this problem. But, if I only >> have one of the declarations in effect, then the problem arises. >> >> >> >> I initially thought it was some low level memory problem. However, I >> tried compiling and running the code on a different machine and >> experienced a different problem. This time, I am unable to reproduce the bug consistently: >> sometimes the code works with just the single int*, sometimes it >> doesn?t work even with both the csRef and int* enabled. Sometimes, >> the code will refuse to work, and if I quit and restart, it works >> fine. (Note that when I say ?refuse to work? I?m referring to the >> abovementioned VFS problem.) This seems to indicate some sort of threading problem. >> >> >> >> Does anyone have any ideas on what is going on? >> >> >> IHPC Values :: Impact :: Honesty :: Performance :: Co-operation This >> email is confidential and may be privileged. If you are not the >> intended recipient, please delete it and notify us immediately. >> Please do not copy or use it for any purpose, or disclose its >> contents to any other person. Thank you. >> >> >> --------------------------------------------------------------------- >> --------- >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. >> Discussions will include endpoint security, mobile security and the >> latest in malware threats. >> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Crystal-develop mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/crystal-develop >> > > > > -- > Project Manager of Crystal Space (http://www.crystalspace3d.org) and > CEL (http://cel.crystalspace3d.org) Support Crystal Space. Donate at > https://sourceforge.net/donate/index.php?group_id=649 > Personal page: http://users.telenet.be/jorritTyberghein/ > > ---------------------------------------------------------------------- > -------- > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. > Discussions will include endpoint security, mobile security and the > latest in malware threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Crystal-develop mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/crystal-develop > ------------------------------ Message: 3 Date: Fri, 10 Aug 2012 09:12:32 +0200 From: Jorrit Tyberghein <[email protected]> Subject: [Crystal-develop] Static build of viewmesh works but crashes To: res <[email protected]> Cc: CS Dev <[email protected]> Message-ID: <CAA49VVLmkZebRPhE3OpFmxiEBSKAgO+4n0rk5BiukgMnxt-xpg@mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" Hi Frank, just trying a static build of viewmesh. walktest_static works fine but viewmesh_static gives the following: Apparently the weakref for the glsl plugin is null for some reason. Any ideas? Greetings, Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 6900.0x1aa0] CS::Threading::Implementation::MutexBase::Lock (this=0x4) at ./include/csutil/threading/win32_mutex.h:67 67 if (AtomicOperations::Increment (&activeFlag) != 1) (gdb) where #0 CS::Threading::Implementation::MutexBase::Lock (this=0x4) at ./include/csutil/threading/win32_mutex.h:67 #1 0x00d4a2d2 in Lock (this=0x4) at ./include/csutil/threading/mutex.h:82 #2 ScopedLock (lockObj=..., this=<synthetic pointer>) at ./include/csutil/threading/mutex.h:169 #3 csWeakRef<iComponent>::Get<csRef<iComponent> > (this=0x0, ref=...) at ./include/csutil/weakref.h:313 #4 0x0053750b in csPluginManager::LoadPluginInstance (this=0x12d8d38, classID=0x31f5540 "crystalspace.graphics3d.shader.combiner.glsl", flags=13) at c:/System9/proj/cs/CS_static/libs/csutil/plugmgr.cpp:258 #5 0x00449f3b in csLoadPlugin<CS::PluginCommon::ShaderWeaver::iCombinerLoader> (returnLoadedInstance=true, report=false, ClassID=0x31f5540 "crystalspace.graphics3d.shader.combiner.glsl", mgr=0x12d8d44) at ./include/iutil/plugin.h:263 #6 csLoadPluginCheck<CS::PluginCommon::ShaderWeaver::iCombinerLoader> (mgr=0x12d8d44, ClassID=0x31f5540 "crystalspace.graphics3d.shader.combiner.glsl", report=false) at ./include/iutil/plugin.h:297 #7 0x0090bee4 in csLoadPluginCheck<CS::PluginCommon::ShaderWeaver::iCombinerLoader> ( ClassID=0x31f5540 "crystalspace.graphics3d.shader.combiner.glsl", object_reg=<optimized out>, report=<optimized out>) at ./include/iutil/plugin.h:322 #8 CS::Plugin::ShaderWeaver::Synthesizer::SynthesizeTechnique::operator() (this=0x837e350, shaderVarNodes=..., errorNode=0xa42635c, snippet=0xa425988, techGraph=...) at c:/System9/proj/cs/CS_static/plugins/video/render3d/shader/shadercompiler/weaver/synth.cpp:401 #9 0x0090a7b1 in CS::Plugin::ShaderWeaver::Synthesizer::SynthesizeTechnique::Run (this=0x837e350) at c:/System9/proj/cs/CS_static/plugins/video/render3d/shader/shadercompiler/weaver/synth.h:210 #10 0x00bd0e12 in CS::Threading::ThreadedJobQueue::QueueRunnable::Run (this=0x31ff0f8) at c:/System9/proj/cs/CS_static/libs/csutil/threadjobqueue.cpp:321 #11 0x00bcc076 in CS::Threading::Implementation::ThreadBase::proxyFunc (param=0x28e9b0) at c:/System9/proj/cs/CS_static/libs/csutil/threading/win32_thread.cpp:148 #12 0x75a41287 in msvcrt!_itow_s () from C:\Windows\syswow64\msvcrt.dll #13 0x75a41328 in msvcrt!_endthreadex () from C:\Windows\syswow64\msvcrt.dll #14 0x7717339a in KERNEL32!BaseCleanupAppcompatCacheSupport () from C:\Windows\syswow64\kernel32.dll #15 0x031ffff0 in ?? () #16 0x77a59ef2 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll #17 0x031ffff0 in ?? () #18 0x77a59ec5 in ntdll!RtlpNtSetValueKey () from C:\Windows\system32\ntdll.dll -- Project Manager of Crystal Space (http://www.crystalspace3d.org) and CEL (http://cel.crystalspace3d.org) Support Crystal Space. Donate at https://sourceforge.net/donate/index.php?group_id=649 Personal page: http://users.telenet.be/jorritTyberghein/ -------------- next part -------------- An HTML attachment was scrubbed... ------------------------------ ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ------------------------------ _______________________________________________ Crystal-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/crystal-develop End of Crystal-develop Digest, Vol 75, Issue 4 ********************************************** IHPC Values :: Impact :: Honesty :: Performance :: Co-operation This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/