Hi,
i think this is directly for Erwin.
Previously i used version 2.56. Now i upgraded to version 2.62. This problem is there since i upgraded.
The defaultConfiguration doesn't register the BoxBox algo. So i do.
When now two boxes collide there is an assertion here:
------------------------------------------
// from btPoolAllocator.h, line 63
void free(void* ptr)
{
if (ptr) {
btAssert((unsigned char*)ptr >= m_pool && (unsigned char*)ptr < m_pool + m_maxElements * m_elemSize);
------------------------------------------
Attached is a modified "basicDemo.cpp". It uses two boxes and registers the BoxBox algo.
Thanks for your help.
BoxBox collision algo crash in 2.62
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
BoxBox collision algo crash in 2.62
You do not have the required permissions to view the files attached to this post.
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: BoxBox collision algo crash in 2.62
The problem seems to be identical to the problem described in post "Error in btPoolAllocator.h with alternative BoxBoxCollision"
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: BoxBox collision algo crash in 2.62
Can you try out release candidate Bullet 2.63-RC1, and see if this helps?
http://www.bulletphysics.com/Bullet/php ... =18&t=1567
Thanks,
Erwin
http://www.bulletphysics.com/Bullet/php ... =18&t=1567
Thanks,
Erwin
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: BoxBox collision algo crash in 2.62
Excellent. It works. Thanks alot!
When you currently prepare a new build then maybe you could look into the below issues aswell? They are only build depending and may be fixed very quickly:
-------------------------------
FILE:btAlignedAllocator.h
TODO:Line 24: Please add: "#include "stddef.h"
REASON:"size_t" is defined there. Some compilers will break if its not included.
-------------------------------
File: btQuickprof.h
TODO: Please add support for systems with no time routines
REASON: systems without <sys/time.h> will otherwise fail to build
-------------------------------
--REQUEST--
FILE: btAllignedAllocator.cpp
TODO: allow custom allocator instead of malloc/free
REASON: It would be very helpfull to set an own allocator and free routine. On console system often different memory pools have to be managed with different managers. The custom allocator could be initialy set to malloc/free to be backward compatible.
Thanks
When you currently prepare a new build then maybe you could look into the below issues aswell? They are only build depending and may be fixed very quickly:
-------------------------------
FILE:btAlignedAllocator.h
TODO:Line 24: Please add: "#include "stddef.h"
REASON:"size_t" is defined there. Some compilers will break if its not included.
-------------------------------
File: btQuickprof.h
TODO: Please add support for systems with no time routines
REASON: systems without <sys/time.h> will otherwise fail to build
-------------------------------
--REQUEST--
FILE: btAllignedAllocator.cpp
TODO: allow custom allocator instead of malloc/free
REASON: It would be very helpfull to set an own allocator and free routine. On console system often different memory pools have to be managed with different managers. The custom allocator could be initialy set to malloc/free to be backward compatible.
Thanks
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: BoxBox collision algo crash in 2.62
size_t indeed gives multi-platform issues, I might revert to int, just to avoid such hassle. Is stddef.h always available on every platform/compiler?pico wrote: -------------------------------
FILE:btAlignedAllocator.h
TODO:Line 24: Please add: "#include "stddef.h"
REASON:"size_t" is defined there. Some compilers will break if its not included.
Do you have a suggestion how to fix the compile error for btQuickprof.h? I think <sys/time.h> is not always available either. Can you provide a fix for the platform you are refering to? Note that this is just used for the demos, and for the optional timings (which are disabled by default).File: btQuickprof.h
TODO: Please add support for systems with no time routines
REASON: systems without <sys/time.h> will otherwise fail to build
Good idea, we can set a callback for the memory allocator, that the user can override. I rather leave the btAlignedAlloc/btAlignedFree as it is, and add a check for such custom allocator. One extra check shouldn't hurt performance, the allocator shouldn't be called very frequent (that is what the pool/stack/object array allocators are for).--REQUEST--
FILE: btAllignedAllocator.cpp
TODO: allow custom allocator instead of malloc/free
REASON: It would be very helpfull to set an own allocator and free routine. On console system often different memory pools have to be managed with different managers. The custom allocator could be initialy set to malloc/free to be backward compatible.
Can you assist with the time.h/size_t issue?
Erwin
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: BoxBox collision algo crash in 2.62
Hi Erwin,Erwin Coumans wrote:pico wrote: Can you assist with the time.h/size_t issue?
Erwin
"stddef.h" is part of the ANSI C standard library. So any ANSI conform compiler should know this include. I think its safe to include within the bullet source.
Regarding "time.h" i will dig into to find a solution that will work on any system, even if there is no time support from the used compiler.
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: BoxBox collision algo crash in 2.62
Hi Erwin,Erwin Coumans wrote:size_t indeed gives multi-platform issues, I might revert to int, just to avoid such hassle. Is stddef.h always available on every platform/compiler?pico wrote: -------------------------------
FILE:btAlignedAllocator.h
TODO:Line 24: Please add: "#include "stddef.h"
REASON:"size_t" is defined there. Some compilers will break if its not included.
Erwin
i've seen you included "stddef.h" in Bullet 2.66. Unfortunately it has been included in "btAlignedAllocator.cpp" instead of "btAlignedAllocator.h".
As size_t is used in the ".h" file it is needed there. Could you please move it?
Thanks
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: BoxBox collision algo crash in 2.62
Hi Erwin,pico wrote:Erwin Coumans wrote:pico wrote: Can you assist with the time.h/size_t issue?
Erwin
attached is a modified "btquickprof.h" that 'solves' the missing "time.h" issue.
Now when BT_NO_PROFILE is defined the missing time function/struct is defined. Also "time.h" is no more included. So for compilers without "time.h" people need then to define BT_NO_PROFILE.
regards
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: BoxBox collision algo crash in 2.62
If time.h is not available, can you try not to use btClock, and disable profiling?
In other words, please use the following defines in src/LinearMath/btQuickprof.h
#define BT_NO_PROFILE 1
//#define USE_BT_CLOCK 1
I just made some commits that fixes compilation, in case btClock is not used. So you need the latest SVN, or wait for Bullet 2.67 for those changes.
Thanks for the feedback, hope this helps,
Erwin
In other words, please use the following defines in src/LinearMath/btQuickprof.h
#define BT_NO_PROFILE 1
//#define USE_BT_CLOCK 1
I just made some commits that fixes compilation, in case btClock is not used. So you need the latest SVN, or wait for Bullet 2.67 for those changes.
Thanks for the feedback, hope this helps,
Erwin
-
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: BoxBox collision algo crash in 2.62
Thanks i will try. I guess you have oversight my other posting above.Erwin Coumans wrote:If time.h is not available, can you try not to use btClock, and disable profiling?
In other words, please use the following defines in src/LinearMath/btQuickprof.h
#define BT_NO_PROFILE 1
//#define USE_BT_CLOCK 1
I just made some commits that fixes compilation, in case btClock is not used. So you need the latest SVN, or wait for Bullet 2.67 for those changes.
Thanks for the feedback, hope this helps,
Erwin
repost:
Hi Erwin,
i've seen you included "stddef.h" in Bullet 2.66. Unfortunately it has been included in "btAlignedAllocator.cpp" instead of "btAlignedAllocator.h".
As size_t is used in the ".h" file it is needed there. Could you please move it?
Thanks