You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It only seems to appear when (1) the tree is empty, and (2) the bounding box is either a triangle or has a 0 area.
I gave solving this a few attempts but without success.
Here are two failing tests reproducing the issue:
test"MerkleMap inserts a triangular bounding box without crash"doDynamicRtree.new(type: MerkleMap){:ok,t}=DynamicRtree.insert({1,[{9,9},{9,9.1}]})assertt==DynamicRtree.tree()root=t|>MerkleMap.get(:root){ch,_root_ptr,root_box}=t|>MerkleMap.get(root)assertt|>Enum.to_list()|>length==t|>Enum.uniq()|>lengthassertlength(ch)==1assertroot_box==[{9,9},{9,9.1}]endtest"MerkleMap inserts a zero area bounding box without crash"doDynamicRtree.new(type: MerkleMap){:ok,t}=DynamicRtree.insert({1,[{9,9},{9,9}]})assertt==DynamicRtree.tree()root=t|>MerkleMap.get(:root){ch,_root_ptr,root_box}=t|>MerkleMap.get(root)assertt|>Enum.to_list()|>length==t|>Enum.uniq()|>lengthassertlength(ch)==1assertroot_box==[{9,9},{9,9}]end
The text was updated successfully, but these errors were encountered:
vhf
changed the title
Crash when inserting bounding box with tiny area
Crash when inserting bounding box with triangular or zero area
Nov 29, 2020
I've been using this lib with great success but recently I've been hitting a bug with small bounding boxes crashing DDRT.
Isolating the issue from the stacktrace and getting to a minimal repro was pretty hard but after some debugging time I got there:
This is fine:
fine as well:
but this crashes (notice the bounding box is a really small triangle):
and this crashes as well (the bounding box has an area of 0):
The crash looks like this:
It only seems to appear when (1) the tree is empty, and (2) the bounding box is either a triangle or has a 0 area.
I gave solving this a few attempts but without success.
Here are two failing tests reproducing the issue:
The text was updated successfully, but these errors were encountered: