[uClibc-cvs] [uClibc 0000222]: SysV IPC incorrect in user space
bugs at busybox.net
bugs at busybox.net
Sun Apr 17 10:32:51 UTC 2005
A NOTE has been added to this issue.
======================================================================
<http://busybox.net/bugs/view.php?id=222>
======================================================================
Reported By: Luke
Assigned To: uClibc
======================================================================
Project: uClibc
Issue ID: 222
Category: Architecture Specific
Reproducibility: always
Severity: major
Priority: normal
Status: assigned
======================================================================
Date Submitted: 04-11-2005 21:15 PDT
Last Modified: 04-17-2005 03:32 PDT
======================================================================
Summary: SysV IPC incorrect in user space
Description:
The output of ipcs does not correspond to the output of /proc/sysvipc/msg.
More specifically ipcs reports the "used-bytes" column to be 16384 when
there are no messages on the queue.
It looks like an alignment issue in the msqid_ds structure in
/usr/include/bits/ipc.h since the msg_qbytes default value of 16384 is
actually being seen in the msg_cbytes field.
======================================================================
----------------------------------------------------------------------
Luke - 04-11-05 23:08
----------------------------------------------------------------------
uClibc : 0.9.27
kernel : 2.6.11.6
gcc : 3.4.3
kernel-headers: 2.6.11.2
busybox : 1.00
Built using buildroot
----------------------------------------------------------------------
Luke - 04-16-05 04:13
----------------------------------------------------------------------
uClibc needs to distinguish between msqid_ds and msqid64_ds and be able to
convert from one to the other.
glibc does this and passes __IPC_64 as part of the cmd arg in msgctl,
shmctl and semctl syscalls.
----------------------------------------------------------------------
Luke - 04-16-05 19:18
----------------------------------------------------------------------
I have a patch against 0.9.27 that fixes the issue with the
{msg,sem,shm}ctl calls
however I am not sure if uClibc keeps compatibility with older libc
versions and if so, this patch would break that compatibility.
glibc uses conditional compilation using SHLIB_COMPAT macros but I do not
see such a mechanism is uClibc.
If we want to use newer structures, glibc ORs the cmd field with __IPC_64
(0x100) in the {msg,sem,shm}ctl syscalls and everything is fine, otherwise
if SHLIB_COMPAT is set then it must ensure it passes the older struct in
the syscall (since that is what the kernel would be using).
It seems later 2.4.x and 2.6.x will work fine with this patch, 2.2.x will
not...
Anyhow, I will upload patch for those interested. Since I dont have much
experience with uClibc (or glibc for that matter) I cant make any
guarentees...
----------------------------------------------------------------------
jocke - 04-17-05 03:32
----------------------------------------------------------------------
Does all archs in glibc/kernel use the new __IPC_64 stuff?
Does this patch apply to all archs in uClibc?
uClibc usally break binary compatiblity between releases so you
must recompile your apps, but I don't know if uClibc still works
for 2.2 kernels.
Issue History
Date Modified Username Field Change
======================================================================
04-11-05 21:15 Luke New Issue
04-11-05 23:08 Luke Note Added: 0000142
04-13-05 22:29 Luke Note Added: 0000146
04-16-05 04:13 Luke Note Added: 0000165
04-16-05 15:42 vapier Project buildroot => uClibc
04-16-05 19:18 Luke Note Added: 0000166
04-16-05 19:18 Luke Note Edited: 0000146
04-16-05 19:24 Luke Note Added: 0000167
04-16-05 19:48 Luke File Added: 999-sysvipc.patch
04-16-05 19:49 Luke Note Added: 0000168
04-16-05 19:49 Luke Note Deleted: 0000167
04-16-05 19:49 Luke Note Deleted: 0000168
04-16-05 19:49 Luke Note Deleted: 0000146
04-17-05 03:32 jocke Note Added: 0000171
======================================================================
More information about the uClibc-cvs
mailing list