swordlegend / recastnavigation

Automatically exported from code.google.com/p/recastnavigation
zlib License
0 stars 0 forks source link

no checking of dtNodeQueue::m_capacity #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
there was exception of wrong access to memory during searching for long 
paths. 
function: trickleDown (DetourNode.cpp:130),  default for m_capacity was 2048, 
but m_size in my case was > 4000. There is no checking of overflow. 
Temporary solved by increasing m_capacity to 2048*8

What version of the product are you using? On what operating system?
1.4 from svn, Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by YakovSum...@gmail.com on 4 Nov 2009 at 9:54

GoogleCodeExporter commented 9 years ago

Original comment by memono...@gmail.com on 4 Nov 2009 at 10:03

GoogleCodeExporter commented 9 years ago

Original comment by memono...@gmail.com on 9 Nov 2009 at 6:09

GoogleCodeExporter commented 9 years ago
I went through the code and in _theory_ that should not happen as long as the 
node
count for the node pool and node queue are that same. If the system runs out of
nodes, then it will return a path up to that point, which is desireble 
property. The
max node count is something each project may end up adjusting. It probably 
should be
there in the header file with explanation.

Do you have some case where this happens often enough that you can debug it a 
bit more?

Ideally I would like to know is if the node that is being pushed in the queue 
already
exists there, and then break on that and see why it gets added there. You can 
check
if a node is in the pool by doing following check:

for (int i = 0; i < m_size; ++i)
    if (m_heap[i] == node)
        break_point!

If that does not trigger and you still get the crash, I'm also very interested 
in
that case.

I think it is time to add some asserts and an extra sanity mode in the code.

Original comment by memono...@gmail.com on 9 Nov 2009 at 9:08

GoogleCodeExporter commented 9 years ago
I will be free next week and will 
debug all issues which i solved by
brute force. 

Original comment by YakovSum...@gmail.com on 10 Nov 2009 at 7:23

GoogleCodeExporter commented 9 years ago
I tried to debug, but havn't received same error. I've changed a lot from the 
time of 
issue (generating nav mesh from collision geometry, not level geometry, reduced 
ai 
distance etc ), so maybe the reason was my engine. I reduced m_capacity to 
previous 
value and will wait error ).

Original comment by YakovSum...@gmail.com on 30 Nov 2009 at 7:42

GoogleCodeExporter commented 9 years ago

Original comment by memono...@gmail.com on 7 Dec 2009 at 9:32