[uClibc-cvs] [uClibc 0000222]: SysV IPC incorrect in user space

bugs at busybox.net bugs at busybox.net
Sun Apr 17 02:24:58 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-16-2005 19:24 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 19:18 
----------------------------------------------------------------------
Seems to be OK with uClibc 0.9.26 ????



----------------------------------------------------------------------
 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...

----------------------------------------------------------------------
 Luke - 04-16-05 19:24 
----------------------------------------------------------------------
... although I am not allowed to upload any files with my current profile.

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                          
======================================================================




More information about the uClibc-cvs mailing list