@aye58sk4:
yeah, removing the sine calculation code fixes the crash.
This was a tough one. Actually the code that was responsible for the crash was this line:
ccValue = Message.getControllerValue();
The debugger gave no clues (like always if you debug multithreading issues) and the sine calculation stuff just delayed the call to this API method. If multiple CCs come in in a short time the internal message was overriden and the API call was using a deprecated pointer to the older message.
Moving this line before the sine loop also fixed the problem. But I changed the handling of the internal message so the original script (and every other script that does heavy calculating in the deffered callbacks) won't crash anymore…