Bug 122174 - shmctl call (IPC_STAT ) when made by a 32 bit application on a ia64 system fails
Summary: shmctl call (IPC_STAT ) when made by a 32 bit application on a ia64 system fails
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: kernel
Version: 2.1
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jim Paradis
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-05-01 12:44 UTC by Chinmaya
Modified: 2013-08-06 01:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-06-08 21:47:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Chinmaya 2004-05-01 12:44:05 UTC
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 
structure.

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);
        }

        shmdt(shmt);
        shmctl(shmid,IPC_RMID,0);
}


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 12:52:19 UTC
2.4.18-e.12sm 
what kernel is that; how does it differ from the RHEL 2.1 kernel ?


Comment 2 Chinmaya 2004-05-03 10:38:08 UTC
The kernel version is "2.4.18-e.12smp" which is shipped with 2.1AS.


Comment 3 Chinmaya 2004-05-04 16:25:00 UTC
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 21:47:26 UTC
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.