Maniphest T31430

(iTaSC) Assertion failure in jntarray.cpp on Linux
Closed, Resolved

Assigned To
Sergey Sharybin (sergey)
Authored By
Felix Nawothnig (fnawothnig)
May 12 2012, 8:46 PM
Tags
  • Animation & Rigging
  • BF Blender
Subscribers
Benoit Bolsee (ben2610)
Brecht Van Lommel (brecht)
Felix Nawothnig (fnawothnig)
Sergey Sharybin (sergey)

Description

Still present in blender-2.63a-linux-glibc27-i686.

The attached file causes an immediate assertion failure when the IK solver is switched to iTaSC on Linux. The model works fine on Windows.

Due to the fact that I am currently working with the code in question and I would probably not try to reduce the testcase to track this bug I didn't bother to do it for this submission...

I am currently working on Windows but I'll try to debug this if I have some time (I have to look how to set up a blender development environment on Linux first).

Event Timeline

Felix Nawothnig (fnawothnig) edited a custom field.May 12 2012, 8:46 PM
Felix Nawothnig (fnawothnig) attached 1 file(s): F19214: UniHuman.blend.

Ah, I forgot the actual assertion failure:

blender: intern/itasc/kdl/jntarray.cpp:83: double& KDL::JntArray::operator()(unsigned int, unsigned int): Assertion `i<size&&j==0' failed.
Aborted

Felix Nawothnig (fnawothnig) attached 1 file(s): F19216: SimpleTestcase.blend.May 12 2012, 10:54 PM
Felix Nawothnig (fnawothnig) attached 1 file(s): F19218: fix_empty_jointArray_access.diff.

I attached a reduced testcase which triggers another (similar) assertion failure - I attached a patch which fixes that bug so that the reduced test case again seems to trigger the original issue.

Felix Nawothnig (fnawothnig) added a comment.May 12 2012, 11:08 PM

Oh, and it should be noted that although the (patched) bug is a non-issue if the assertion is removed (as in the windows builds) the real one actually causes invalid memory access.

Brecht Van Lommel (brecht) added a comment.May 18 2012, 4:52 PM

Committed your patch. Still these assertions should be disabled in official builds.

Sergey, it seems that at least in the linux buildbot configuration -DNDEBUG was left out, and this report seems to indicate the same was done for the official release. Could we add that back? It can make quite a performance difference too in some of the code.

Brecht Van Lommel (brecht) changed the task status from Unknown Status to Resolved.May 18 2012, 4:52 PM
Felix Nawothnig (fnawothnig) added a comment.May 18 2012, 5:42 PM

Sorry, but it is still open - my patch fixes assertions which got triggered by my reduced TC (which are trivial, with NDEBUG there would be no problem) - so that you can actually use the TC to debug the bug in question.

The true one is caused by (I believe) a mismatch between what blender thinks how many DoFs exist and what iTaSC thinks... (IIRC, can't look it up this second) I will continue this when I'm not sitting in a train. :) But it's still there, and it can potentially crash the app with NDEBUG.

Benoit Bolsee (ben2610) added a comment.Jun 7 2012, 11:18 AM

Indeed the UniHuman blend is still crashing, this time because one of the end effector (the bone with the IK constraint) is a fixed bone with no joint. That is causing access to invalid index in the joint array when evaluating the pose of the end effector. I've fixed this by changing the API to return a pointer instead of a reference, this way NULL pointer can be returned instead of crashing when the index is wrong. The fix in in revision 47561.

Benoit Bolsee (ben2610) added a comment.Jun 7 2012, 11:21 AM

by the way, thanks for sharing this impressive human armature. It allows to demonstrate the advantages of iTaSC: much faster in simulation mode, better mixing of constraints, natural movements (no flipping).

Felix Nawothnig (fnawothnig) added a comment.Jun 8 2012, 1:15 AM

Well, credit for the model itself goes to someone else: http://unihuman.yolasite.com/

We just restructured the bones, added IK targets, added IK constraints (which are obviously not done in your version) ... and yes - it demonstrates all of the points you mentioned... which are exactly the reasons why we went the Blender + iTaSC approach for what we wanted to do.

In case you are curious - this is a preliminary result ... realtime (IK) animation from optical motion capture:

http://flexo.sipsik.net/recording_hampelman.mp4