Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 124477

Forum Post: RE: IPC between 2 cores gives invalid region

$
0
0

You're illegally (not from a compiler standpoint) casting the MessageQ_Msg returned from MessageQ_alloc to a pointer to a MessageQ_Msg.  Since the return type of MessageQ_alloc is a MessageQ_Msg your eventual call to MessageQ_put with the "invalid" derefence of the MessageQ_Msg will cause a failure.  The dereference of something that was not meant to be derefenced in the first place will cause MessageQ to validate the provided MessageQ_Msg against the wrong data in memory.

If you look at the MessageQ APIs you'll see that MessageQ_Msg is actually a typedef'd pointer to a MessageQ_MsgHeader.  Therefore, your "p" structure need only have an element of type MessageQ_Msg, not MessageQ_Msg *.

Justin


Viewing all articles
Browse latest Browse all 124477

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>