charm
charm copied to clipboard
No Error When Sending Messages of Unregistered Types
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::__idxto an unreasonable value by default (e.g.,std::numeric_limits<UChar>::max). - Add a
CkAssertwithinenvelope::setMsgIdxto check whether the supplied message index is registered with the RTS.