Crash in Octree::grow_to_accomodate

Bug #531832 reported by Kristoffer Sjöö
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
peekabot
Fix Committed
Undecided
Staffan Gimåker

Bug Description

I'm getting crashes in Peekabot 0.7.2 after I added the following esoteric code to my program:

   peekabot::CylinderProxy normp;
   normp.add(m_onnessTester, "Normal", peekabot::REPLACE_ON_CONFLICT);
   normp.set_color(0,0,1);
   normp.set_scale(0.005, 0.005, 0.1);
   normp.translate(0.05,0,0);
   normp.set_orientation(witness.normal.x, witness.normal.y, witness.normal.z);
   normp.rotate(M_PI/2, 0, 1, 0);
   normp.translate(witness.point1.x, witness.point1.y, witness.point1.z,
       peekabot::PARENT_COORDINATES);

The error I get is

peekabot: renderer/Octree.cc:245: peekabot::renderer::Octree::OctreeNode* peekabot::renderer::Octree::grow_to_accomodate(const peekabot::renderer::CullableEntity*): Assertion `index != -1' failed.

The values sent to set_orientation above are (-1,0,0) when the crash happens. The translate arguments evaluate to (-0.115, 0.04499999999998, 1.2599999713897705). I have copied the above code to the beginning of my execution and replaced the arguments by constants as above; the same result occurs so it's not dependent on the state of the system or Peekabot.
Taking out the set_orientation line averts the crash.

Related branches

Revision history for this message
Kristoffer Sjöö (krsj) wrote :
Changed in peekabot:
status: New → Confirmed
assignee: nobody → Staffan Gimåker (gimaker)
Revision history for this message
Staffan Gimåker (gimaker) wrote :

Fixed in the 0.7.x branch.

Note that setting the orientation in this particular case (when the original orientation is parallel to the desired orientation) is ambiguous. I added some documentation stating how this ambiguity is resolved; we choose to always rotate about the object's Z axis in case of ambiguity. E.g. calling set_orientation(-1, 0, 0) on an object with the axes x=(1,0,0), y=(0,1,0) and z=(0,0,1) will yield x'=(-1,0,0), y'=(0,-1,0) and z'=(0,0,1).

Changed in peekabot:
milestone: none → 0.7.3
status: Confirmed → Fix Committed
Revision history for this message
Kristoffer Sjöö (krsj) wrote :

I wasn't too concerned about the exact outcome, given the object in question :) But disambiguation is always good.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.