From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,17235c28292766d7,start X-Google-Attributes: gidfee84,public From: Joe Mario Subject: Re: Help: Big problems with messaage queues Date: 1999/05/03 Message-ID: <372DABD2.15FB@zk3.dec.com>#1/1 X-Deja-AN: 473509544 Content-Transfer-Encoding: 7bit References: <372AE3EE.41E19C09@tde-online.de> To: Burkhard Schultheis Content-Type: text/plain; charset=us-ascii Organization: UBPG Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 Burkhard Schultheis wrote: > > we ported our software from AIX to DEC UNIX (until now 4.0B), > and now we have big problems with our message queues. > Sometimes no program can write to an empty queue. The first > few writes are OK, and then the writing program is blocked. > On AIX we had never such a problem with message queues. > Any ideas? > Thank you in advance! Make sure your 'msgsz' buffer is properly specified. The msgrcv() manpage is not clear on the size to specify and unfortunately this has led to problems. (The manpage is much clearer in V4.0E). The 'msgsz' parameter CANNOT be the size of the structure pointed to by the 'msgp' parameter. The msgsz parameter is only used to specify the size of the msgbuf.mtext field. It cannot include the msgbuf.mtype field or else the msgbuf buffer will be overwritten. This is because the kernel first zero-fills the msgbuf.mtext field. If the 'msgsz' parameter is the size of the (msgbuf.mtext + msgbuf.mtype) fields, then the zero-filling will go eight bytes beyond the end of the msgbuf.mtext buffer - corrupting any data located there. Joe Mario Compaq Tru64 Development Environment