Page MenuHome

MouseLook actuator raises an Assert error
Closed, ResolvedPublic

Description

System Information
OSX 10.9

Blender Version
Broken: (example: 2.7.3.8 de4dcda5)

Short description of error

Exact steps for others to reproduce the error
Open

, start the game (P) and mouse the mouse.

I get a crash with the following backtrace:

ASSERT /Users/dfelinto/blender/git/blender/source/gameengine/Ketsji/KX_MouseActuator.cpp:319: !m_mouse failed.

Program received signal SIGTRAP, Trace/breakpoint trap.
#0  0x00007fff84686866 in __pthread_kill ()
#1  0x00007fff8392e35c in pthread_kill ()
#2  0x00000001015e019d in KX_MouseActuator::getMousePosition (this=0x109c4f900, pos=0x7fff5fbfd770) at /Users/dfelinto/blender/git/blender/source/gameengine/Ketsji/KX_MouseActuator.cpp:319
#3  0x00000001015df4f4 in KX_MouseActuator::Update (this=0x109c4f900) at /Users/dfelinto/blender/git/blender/source/gameengine/Ketsji/KX_MouseActuator.cpp:131
#4  0x0000000101660c4b in SCA_IActuator::Update (this=0x109c4f900, curtime=0.47045370737711584, frame=true) at /Users/dfelinto/blender/git/blender/source/gameengine/GameLogic/SCA_IActuator.cpp:51
#5  0x000000010166ef56 in SCA_LogicManager::UpdateFrame (this=0x109c3d510, curtime=0.47045370737711584, frame=true) at /Users/dfelinto/blender/git/blender/source/gameengine/GameLogic/SCA_LogicManager.cpp:225
#6  0x00000001016169a6 in KX_Scene::LogicUpdateFrame (this=0x10a101200, curtime=0.47045370737711584, frame=true) at /Users/dfelinto/blender/git/blender/source/gameengine/Ketsji/KX_Scene.cpp:1667
#7  0x00000001015d228c in KX_KetsjiEngine::NextFrame (this=0x117a60560) at /Users/dfelinto/blender/git/blender/source/gameengine/Ketsji/KX_KetsjiEngine.cpp:681
#8  0x000000010149f626 in BL_KetsjiNextFrame (ketsjiengine=0x117a60560, C=0x109e182d8, win=0x117a9f768, scene=0x10a1ff208, ar=0x117abbb88, keyboarddevice=0x10a149000, mousedevice=0x10a055e00, draw_letterbox=0) at /Users/dfelinto/blender/git/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp:136
#9  0x000000010149ec9e in StartKetsjiShell (C=0x109e182d8, ar=0x117abbb88, cam_frame=0x7fff5fbff2f0, always_use_expand_framing=1) at /Users/dfelinto/blender/git/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp:574
#10 0x00000001002d2507 in game_engine_exec (C=0x109e182d8, op=0x117a4f768) at /Users/dfelinto/blender/git/blender/source/blender/editors/space_view3d/view3d_view.c:1648
#11 0x000000010013422e in wm_operator_invoke (C=0x109e182d8, ot=0x10f21c408, event=0x109c3f688, properties=0x1179539b8, reports=0x0, poll_only=false) at /Users/dfelinto/blender/git/blender/source/blender/windowmanager/intern/wm_event_system.c:1046
#12 0x00000001001337d4 in wm_handler_operator_call (C=0x109e182d8, handlers=0x117abbcd0, handler=0x117938568, event=0x109c3f688, properties=0x1179539b8) at /Users/dfelinto/blender/git/blender/source/blender/windowmanager/intern/wm_event_system.c:1637
#13 0x0000000100132a93 in wm_handlers_do_intern (C=0x109e182d8, event=0x109c3f688, handlers=0x117abbcd0) at /Users/dfelinto/blender/git/blender/source/blender/windowmanager/intern/wm_event_system.c:1897
#14 0x000000010012e8d5 in wm_handlers_do (C=0x109e182d8, event=0x109c3f688, handlers=0x117abbcd0) at /Users/dfelinto/blender/git/blender/source/blender/windowmanager/intern/wm_event_system.c:2006
#15 0x000000010012e292 in wm_event_do_handlers (C=0x109e182d8) at /Users/dfelinto/blender/git/blender/source/blender/windowmanager/intern/wm_event_system.c:2345
#16 0x00000001001238ae in WM_main (C=0x109e182d8) at /Users/dfelinto/blender/git/blender/source/blender/windowmanager/intern/wm.c:487
#17 0x000000010011f1b7 in main (argc=1, argv=0x7fff5fbff780) at /Users/dfelinto/blender/git/blender/source/creator/creator.c:1765

To create the file from scratch all you need is a Mouse Actuator with Look mode linked to a Mouse Sensor with Movement mode.
Note: This only happens in debug mode + crash on asserts. It should be investigated nonetheless.

Event Timeline

Sybren A. Stüvel (sybren) lowered the priority of this task from 90 to 50.Feb 21 2015, 1:55 AM

The assertion seems to be inverted by mistake:

MT_assert(!m_mouse);
const SCA_InputEvent & xevent = m_mouse->GetEventValue(SCA_IInputDevice::KX_MOUSEX);
const SCA_InputEvent & yevent = m_mouse->GetEventValue(SCA_IInputDevice::KX_MOUSEY);

Why would you otherwise assert !m_mouse and still use it in the next lines?

I'll remove the ! and commit.