* (Re-Send) shmctl() returns corrupt value on pb1000.
@ 2002-05-30 11:10 Takeshi Aihana
2002-05-30 12:19 ` Atsushi Nemoto
0 siblings, 1 reply; 7+ messages in thread
From: Takeshi Aihana @ 2002-05-30 11:10 UTC (permalink / raw)
To: linux-mips
# Sorry, please ignore previous mail I send.
Hello all,
I have a problem now about return the segment size of shared memory from
shmctl() func.
First of step was to start apache_1.3.24 on kernel-2.4.17/pb1000.
However it could not be started because it might be currput segment size
from shmctl() called in apache.
So that I tried to test with shmctl() on
(A)kernel-2.4.17/pb1000/gcc-2.95.3 and (B)kernel-2.4.9/x86/gcc-2.95.3 as
the follows.
(B) was just returned correct segment size, but (A)'s segment size was 0
(of cause memory on pb1000 was left).
This simple code is follows, and `gcc -o test test.c`.
-----------------------------------8<---------------------------------------
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
int main (void) {
int shm_id;
struct shmid_ds ds;
shm_id = shmget(IPC_PRIVATE, 123, IPC_CREAT|0666);
if (shm_id < 0) {
perror ("shmget");
return 1;
}
if (shmctl(shm_id, IPC_STAT, &ds)) {
perror ("shmctl");
exit (1);
}
printf( "shm_segsz = %d\n", ds.shm_segsz);
}
-----------------------------------8<---------------------------------------
Then each results are,
x86(kernel-2.4.9/RH-7.2/gcc-2.95.3) : shm_segsz = 123
pb1000(kernel-2.4.17/gcc-2.95.3) : shm_segsz = 0
This value of pb1000 could not be expected for me.
So if you have any adivices that should be add option to compile on
pb1000, or if you have been faced similar to this,
please let me knows.
Thank you for your helps.
Regards.
---
(TAKESHI - MontaVista Software Japan)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: (Re-Send) shmctl() returns corrupt value on pb1000.
2002-05-30 11:10 (Re-Send) shmctl() returns corrupt value on pb1000 Takeshi Aihana
@ 2002-05-30 12:19 ` Atsushi Nemoto
2002-05-30 13:02 ` Takeshi Aihana
0 siblings, 1 reply; 7+ messages in thread
From: Atsushi Nemoto @ 2002-05-30 12:19 UTC (permalink / raw)
To: takeshi_aihana; +Cc: linux-mips
>>>>> On 30 May 2002 20:10:16 +0900, Takeshi Aihana <takeshi_aihana@montavista.co.jp> said:
takeshi_aihana> I have a problem now about return the segment size of
takeshi_aihana> shared memory from shmctl() func.
What version of libc are you using? It seems your kernel headers and
libc headers are inconsistent.
Please look structures in libc's /usr/include/bits/{ipc,sem,shm,msg}.h
and kernel's include/asm-mips/{ipc,sem,shm,msg}buf.h carefully.
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: (Re-Send) shmctl() returns corrupt value on pb1000.
2002-05-30 12:19 ` Atsushi Nemoto
@ 2002-05-30 13:02 ` Takeshi Aihana
2002-05-31 2:28 ` Atsushi Nemoto
0 siblings, 1 reply; 7+ messages in thread
From: Takeshi Aihana @ 2002-05-30 13:02 UTC (permalink / raw)
To: linux-mips
Hello,
> >>>>> On 30 May 2002 20:10:16 +0900, Takeshi Aihana <takeshi_aihana@montavista.co.jp> said:
> takeshi_aihana> I have a problem now about return the segment size of
> takeshi_aihana> shared memory from shmctl() func.
>
> What version of libc are you using? It seems your kernel headers and
> libc headers are inconsistent.
(A) The version of glibc on x86 is 2.2.4/kernel-2.4.9.
(B) The version of glibc on pb1000 is 2.2.3/kernel-2.4.17.
Is there any inconsistents on those conditions?
Should be update to 2.2.4 on pb1000?
> Please look structures in libc's /usr/include/bits/{ipc,sem,shm,msg}.h
> and kernel's include/asm-mips/{ipc,sem,shm,msg}buf.h carefully.
OK. I will do carefully.
It looks like to not any diffs I should observe on both files, now.
Thank you for your help.
---
(TAKESHI - MontaVista Software Japan)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: (Re-Send) shmctl() returns corrupt value on pb1000.
2002-05-30 13:02 ` Takeshi Aihana
@ 2002-05-31 2:28 ` Atsushi Nemoto
2002-06-03 10:09 ` Takeshi AIHANA
0 siblings, 1 reply; 7+ messages in thread
From: Atsushi Nemoto @ 2002-05-31 2:28 UTC (permalink / raw)
To: takeshi_aihana; +Cc: linux-mips
>>>>> On 30 May 2002 22:02:57 +0900, Takeshi Aihana <takeshi_aihana@montavista.co.jp> said:
takeshi_aihana> (B) The version of glibc on pb1000 is 2.2.3/kernel-2.4.17.
takeshi_aihana> Is there any inconsistents on those conditions?
AFAIK, Yes. For example, look struct ipc_perm in bits/ipc.h and
struct ipc64_perm in asm-mips/ipcbuf.h (not struct ipc_perm in
linux/ipc.h which is obsolete).
takeshi_aihana> Should be update to 2.2.4 on pb1000?
If you can. Please do not forget rebuilding all applications which
including these headers. If you want to stay in 2.2.3, you will have
to modify your kernel headers according to the libc headers.
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: (Re-Send) shmctl() returns corrupt value on pb1000.
2002-05-31 2:28 ` Atsushi Nemoto
@ 2002-06-03 10:09 ` Takeshi AIHANA
2002-06-03 12:49 ` Atsushi Nemoto
0 siblings, 1 reply; 7+ messages in thread
From: Takeshi AIHANA @ 2002-06-03 10:09 UTC (permalink / raw)
To: linux-mips
Hello,
At Fri, 31 May 2002 11:28:47 +0900 (JST),
Atsushi Nemoto wrote:
> takeshi_aihana> Is there any inconsistents on those conditions?
>
> AFAIK, Yes. For example, look struct ipc_perm in bits/ipc.h and
> struct ipc64_perm in asm-mips/ipcbuf.h (not struct ipc_perm in
> linux/ipc.h which is obsolete).
I did to check both bits/shm.h (glibc-2.2.3), bits/shm.h (glibc-2.2.4) and asm-mips/shmbuf.h
for calling shmctl();
There are any differences 'struct shmid_ds' between glibc-2.2.3 and 2.2.4 that I saw.
However, I do not think those diffs are caused this problem.
Because the 'shm_segsz` which a member of this will be allocated on same location even if the follows members
behind 'shm_segsz' are changed; i.e. it will have same value as 'shm_segsz' on both different structure.
Is this right?
> If you can. Please do not forget rebuilding all applications which
> including these headers. If you want to stay in 2.2.3, you will have
> to modify your kernel headers according to the libc headers.
I understood. It might to solve this problem as the most simple way.
Thank you for your advice.
Regards.
---
(TAKESHI - MontaVista Software)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: (Re-Send) shmctl() returns corrupt value on pb1000.
2002-06-03 10:09 ` Takeshi AIHANA
@ 2002-06-03 12:49 ` Atsushi Nemoto
2002-06-04 3:14 ` Takeshi AIHANA
0 siblings, 1 reply; 7+ messages in thread
From: Atsushi Nemoto @ 2002-06-03 12:49 UTC (permalink / raw)
To: takeshi_aihana; +Cc: linux-mips
>>>>> On Mon, 03 Jun 2002 19:09:18 +0900, Takeshi AIHANA <takeshi_aihana@montavista.co.jp> said:
takeshi_aihana> There are any differences 'struct shmid_ds' between
takeshi_aihana> glibc-2.2.3 and 2.2.4 that I saw. However, I do not
takeshi_aihana> think those diffs are caused this problem. Because
takeshi_aihana> the 'shm_segsz` which a member of this will be
takeshi_aihana> allocated on same location even if the follows members
takeshi_aihana> behind 'shm_segsz' are changed; i.e. it will have same
takeshi_aihana> value as 'shm_segsz' on both different structure. Is
takeshi_aihana> this right?
Did you check the contents of 'shm_perm'? The type of shm_perm is
'struct ipc64_perm' in kernel and 'struct ipc_perm' in libc. I
suppose these definitions are differ.
---
Atsushi Nemoto
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: (Re-Send) shmctl() returns corrupt value on pb1000.
2002-06-03 12:49 ` Atsushi Nemoto
@ 2002-06-04 3:14 ` Takeshi AIHANA
0 siblings, 0 replies; 7+ messages in thread
From: Takeshi AIHANA @ 2002-06-04 3:14 UTC (permalink / raw)
To: linux-mips
At Mon, 03 Jun 2002 21:49:57 +0900 (JST),
Atsushi Nemoto wrote:
---
> Did you check the contents of 'shm_perm'? The type of shm_perm is
> 'struct ipc64_perm' in kernel and 'struct ipc_perm' in libc. I
> suppose these definitions are differ.
Oops, I lost that member before 'shm_segs' in.
Yes, you're right.
So I agree that it should be updated glibc to 2.2.4 and then try to do.
Thanks for your help.
Regards.
---
(TAKESHI - MontaVista Software)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-06-04 3:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-30 11:10 (Re-Send) shmctl() returns corrupt value on pb1000 Takeshi Aihana
2002-05-30 12:19 ` Atsushi Nemoto
2002-05-30 13:02 ` Takeshi Aihana
2002-05-31 2:28 ` Atsushi Nemoto
2002-06-03 10:09 ` Takeshi AIHANA
2002-06-03 12:49 ` Atsushi Nemoto
2002-06-04 3:14 ` Takeshi AIHANA
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox