Assertion error on Linux

Hi everybody,

I’m currently working on a bender game and I’m encountering a bug that I can’t get rid of.

The game works perfectly on windows blender but it frequently makes blender crash on Linux or Mac platform.

The crash occurs just after displaying the following message in the console:

ASSERT intern/moto/include/MT_Vector3.inl:42: !MT_fuzzyZero(s) failed.
I saw in the blender source file KX_BlenderRenderTools.cpp

that it is an issue known by blender dev team because the assert message is reproduced in the comment of function KX_BlenderRenderTools::applyTransform.

By debugging, I managed to identify the python script that cause the crash.
Here’s its content:

cont=GameLogic.getCurrentController()
own=cont.getOwner()

if hasattr (GameLogic, "bzViewMode") == False:
    GameLogic.bzViewMode = 1

# compute objId from objet name
objId = int(own.getName().split('.')[1])

if hasattr(GameLogic,'bzClient') == True:
    #print "nbClients = ", GameLogic.bzClient.GetNbClients()
    if (objId < GameLogic.bzClient.GetNbClients()) and (objId != GameLogic.bzClient.GetId()):
        actu = GameLogic.getCurrentController().getActuator("TrackCam")

        if GameLogic.bzViewMode == 0: # 0=First Person View, 1 = Third Person View
            actu.setObject("FpvCamera")
        else:
            actu.setObject("TpvCamera")

        GameLogic.addActiveActuator(actu, True)

This script is bound to an allways sensor.
When I remove it from my game, it seems to work … even on Linux platform.

This bug really drives me mad because:

  • It does not systematically happens (sometimes it works, sometimes it crashs)
  • It only happens on Linux but not on Windows

I would be very very very thankful if someone could help me either to get round the assert or to explain me how to modify my script to avoid the crash.

Thank you very much.