Bug 122174 - shmctl call (IPC_STAT ) when made by a 32 bit application on a ia64 system fails
shmctl call (IPC_STAT ) when made by a 32 bit application on a ia64 system fails
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: kernel (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jim Paradis
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2004-05-01 08:44 EDT by Chinmaya
Modified: 2013-08-05 21:06 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-06-08 17:47:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Chinmaya 2004-05-01 08:44:05 EDT
Description of problem:

When a 32bit application running on a ia64 system makes a shmctl call 
with IPC_STAT flag junk data will be filled in the shmid_ds 

Version-Release number of selected component (if applicable):
Kernel version - 2.4.18-e.12sm

How reproducible:

Build the sample program given below on a 32bit machine and run it on 
a 64bit machine.
#include <stdio.h>
#include <errno.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/types.h>

#define errmsg(s,no) { printf("*** %s - %s ***\n",s,strerror(no)); 
exit(1); }
#define FTOK_FILENAME "/sbin"
#define PRJ_NO 419
int main()
        key_t shmkey;
        int shmid;
        char *shmt=NULL;
        struct shmid_ds shdata;

        if ((shmkey = ftok(FTOK_FILENAME,PRJ_NO)) == -1)
                errmsg("ftok error",errno);

        if ((shmid = shmget(shmkey,1048700,IPC_CREAT|IPC_EXCL|0666)) 
== -1)
                errmsg("shmget error",errno);

        if((shmt=(char*)shmat(shmid,NULL,0)) == -1)
                errmsg("shmat error", errno);

        if(shmctl(shmid,IPC_STAT,&shdata) == 0)
                printf("=Shared mem size==%d==\n",shdata.shm_segsz);


Steps to Reproduce:
1.Build the above program on a 32bit machine
2.Run it on a ia64 machine with 2.1AS
Actual results:

=Shared mem size==1073832704==

Expected results:

=Shared mem size==1048700==

Additional info:
Comment 1 Arjan van de Ven 2004-05-01 08:52:19 EDT
what kernel is that; how does it differ from the RHEL 2.1 kernel ?
Comment 2 Chinmaya 2004-05-03 06:38:08 EDT
The kernel version is "2.4.18-e.12smp" which is shipped with 2.1AS.
Comment 3 Chinmaya 2004-05-04 12:25:00 EDT
This problem does not occur on RH AS3.0. I verified that this bug has 
been fixed in 2.4.21 kernel version. 
Could you let me know as to whether it is advisable to upgrade to 
this kernel version or is RedHat going to release a upgrade patch or 
something for 2.1 AS?

Comment 5 Jim Paradis 2006-06-08 17:47:26 EDT
RHEL2.1 is currently accepting only critical security fixes.  This issue is
outside the current scope of support.

Note You need to log in before you can comment on or make changes to this bug.