charm icon indicating copy to clipboard operation
charm copied to clipboard

No Error When Sending Messages of Unregistered Types

Open jszaday opened this issue 4 years ago • 0 comments

This issue arises when users of message types defined within external modules do not register them with the RTS (i.e., via extern module). Communicating an unregistered message type does not trigger a CkAssert failure which leads to more cryptic failures down the line (e.g., the RTS does not call the correct un/pack function). We do not seem to check whether the message's index is valid inside of envelope::setMsgIdx and, even if we did, an unregistered message may have a valid __idx.

If this is deemed a worthy cause, my proposed solution is two-fold:

  • Initialize CMessage_CkMessage::__idx to an unreasonable value by default (e.g., std::numeric_limits<UChar>::max).
  • Add a CkAssert within envelope::setMsgIdx to check whether the supplied message index is registered with the RTS.

jszaday avatar May 14 '21 22:05 jszaday