public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* System V msg queue bugs in latest kernels
@ 2001-02-17 18:42 Mark Swanson
  2001-02-17 19:03 ` Manfred Spraul
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Swanson @ 2001-02-17 18:42 UTC (permalink / raw)
  To: linux-kernel

Hello,

ipcs (msg) gives incorrect results if used-bytes is above 65536. It
stays at 65536 even though messages are being read and removed from the
msg queue.

The sysv msg queue either ignores the /proc/sys/kernel/msgmnb value if
it is above 65536 or simply gets it wrong. Proof: I can place more than
msgmnb bytes in a queue. The behavior is not consistent, but 100%
reproducable. It's not consistent because if I use messages of about
1000-2000 bytes the msgmnb never gets bigger than 65536 (even if
/proc/sys/kernel/msgmnb is set to 1048576 - bug). However, if I use
small messages like 13 bytes I can get bizarre (wrong) ipcs results
like this:

used-bytes    messages
65536          65536


Why does Linux ignore the /proc/sys/kernel/msgmnb value - or seem to
partly ignore it if it is above 65536? I *really* need this to be
around a MB. Is there an undocumented limit here or is this a bug?

Thanks.





=====
A camel is ugly but useful; it may stink, and it may spit, but it'll get you where you're going. - Larry Wall -

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: System V msg queue bugs in latest kernels
@ 2001-02-17 23:53 Christopher Allen Wing
  0 siblings, 0 replies; 6+ messages in thread
From: Christopher Allen Wing @ 2001-02-17 23:53 UTC (permalink / raw)
  To: Manfred Spraul; +Cc: Mark Swanson, linux-kernel

Manfred:

> If you want to access values > 65535 from your app you have 2 options:
> 
> 1) use the new msqid64_ds structure. You must pass IPC_64 to the msgctl
> call. This is the only option if you need correct 32-bit uids.

glibc 2.2 will support this natively without needing any changes to your
application (besides a recompile). struct msqid_ds in the glibc 2.2
headers corresponds to struct msqid64_ds in the kernel.

It would be a bad thing to require people to change their source code in
order to build against the improved sysvipc interface :)

(glibc 2.2 also handles the case of a non 2.4 kernel properly, by
detecting the lack of IPC_64 support and emulating it in software-- Jakub
Jelinek wrote this compatibility code because I was too lazy/didn't need
it myself)

-Chris Wing
wingc@engin.umich.edu


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-02-17 23:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-17 18:42 System V msg queue bugs in latest kernels Mark Swanson
2001-02-17 19:03 ` Manfred Spraul
2001-02-17 19:22   ` Mark Swanson
2001-02-17 19:40   ` Mark Swanson
2001-02-17 20:07   ` Manfred Spraul
  -- strict thread matches above, loose matches on Subject: below --
2001-02-17 23:53 Christopher Allen Wing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox