There was a bug in some of the older sensor versions where the Context Buffer was not being populated correctly by the sensor. This caused problems for both smid and sapd on the management systems. I believe the issue was fixed in one of the 3.1 Service Packs.
Verify that you are running the latest software versions on your sensor to ensure you have the latest sensor software fixes.
Alarms from older sensors may have this problem, and you would need to remove the Context Buffer from these older alarms.
If, however, alarms from a sensor running the latest version are causing this sapd error then please contact the TAC and have ready the output of nrvers and an example log entry with this problem. If it is happening with the latest code then it is likely a new bug that we were not aware of. The TAC can create a bug for it, and get engineering working on a fix.