msgrcv crash in AIX 5.3 SP6

Hi All,

I have a piece of code like blow. It is working fine with AIX 5.3 SP3. When the same thing is getting executed in AIX 5. SP6 it is giving segmentation fault. If I put debug statements before and after, it works fine.

    rc = msgrcv\(mqid, &msg, size, HIGH\_PRIORITY_FIRST , 0\)
    if \(rc > 0\) \{
       /* message was recieved \(waiting or not\) */
        memset \(buf, NULL, sizeof\(MsgBuffer\)\);
        memcpy \(buf, &msg.message, rc\);
    \}

Can somebody help me what is happening here? Do you think any restriction of message queues is creating the problem.

Thanks,
Sandhya,