From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1PSQHV-0005vn-BA for ltp-list@lists.sourceforge.net; Tue, 14 Dec 2010 08:30:45 +0000 Received: from out03.sjc.mx.trendmicro.com ([216.99.131.7]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1PSQHT-0006km-BJ for ltp-list@lists.sourceforge.net; Tue, 14 Dec 2010 08:30:45 +0000 Received: from relay03.sjc.mx.trendmicro.com (unknown [10.30.239.26]) by out03.sjc.mx.trendmicro.com (Postfix) with ESMTP id 4AC672113BF for ; Tue, 14 Dec 2010 08:30:37 +0000 (UTC) Received: from smtp-gate.ryobi.co.jp (unknown [210.163.224.132]) by relay03.sjc.mx.trendmicro.com (Postfix) with ESMTP id 4C58E3DD01F for ; Tue, 14 Dec 2010 08:30:36 +0000 (UTC) Message-ID: <000001cb9b68$e2a50240$a7ef06c0$@co.jp> From: "Mitani" Date: Tue, 14 Dec 2010 17:28:28 +0900 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="--=_NextPart_ST_17_28_29_Tuesday_December_14_2010_29415" Content-Language: ja Subject: [LTP] [PATCH] POSIX "sched_setparam/9-1" and "sched_setparam/10-1" tests List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-list-bounces@lists.sourceforge.net To: ltp-list@lists.sourceforge.net Cc: =?iso-2022-jp?B?GyRCYUQ6QhsoQiAbJEI3cjtUGyhC?= This is a multi-part message in MIME format. ----=_NextPart_ST_17_28_29_Tuesday_December_14_2010_29415 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit Hi, LTP's testset "hugeshmget02" failed in my systems. But usually, "hugeshmget02" passed. My environments are as follows: ------------ RHEL5.5 --- (x86, x86_64) RHEL4.8 --- (x86_64) ------------ I noticed that "hugeshmget02" certainly fails after running of following POSIX testsets: ------------ sched_setparam/9-1 sched_setparam/10-1 ------------ I tried to find the reason of this failure, and examined status of the shared memory before execution of test and after execution of test: ------------ [root@RHEL55-64-LTP sched_setparam]# ipcs -m ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x7402035b 1605632 root 600 4 0 0x00000000 1966081 gdm 600 393216 2 dest 0x7402035a 1572866 root 600 4 0 [root@RHEL55-64-LTP sched_setparam]# strace -o $(date +%Y%m%d%H%M%S).strace -s 256 -T -tt -ff ./9-1.run-test Test PASSED [root@RHEL55-64-LTP sched_setparam]# ipcs -m ------ Shared Memory Segments -------- key shmid owner perms bytes nattch status 0x7402035b 1605632 root 600 4 0 0x00000000 1966081 gdm 600 393216 2 dest 0x7402035a 1572866 root 600 4 0 0xffffffff 1998851 root 600 4 0 ------------ The result of strace is as follows: ------------ 09:28:18.314752 execve("./9-1.run-test", ["./9-1.run-test"], [/* 24 vars */]) = 0 <0.011434> 09:28:18.332764 brk(0) = 0x17e5000 <0.000011> 09:28:18.332836 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2b9422d13000 <0.000018> 09:28:18.332974 uname({sys="Linux", node="RHEL55-64-LTP", ...}) = 0 <0.000010> 09:28:18.333069 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) <0.000027> 09:28:18.333214 open("/etc/ld.so.cache", O_RDONLY) = 3 <0.000014> [...] 09:28:18.336308 stat("conformance/interfaces/sched_setparam/9-1.c", 0x7fff1883ce60) = -1 ENOENT (No such file or directory) <0.000014> 09:28:18.336369 shmget(0xffffffff, 4, IPC_CREAT|0600) = 1998851 <0.000026> 09:28:18.336427 shmat(1998851, 0, 0) = ? <0.000013> 09:28:18.336500 sched_get_priority_min(SCHED_FIFO) = 1 <0.000026> 09:28:18.336565 sched_setscheduler(2465, SCHED_FIFO, { 1 }) = 0 <0.000012> 09:28:18.336626 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2b9422d28930) = 2466 <0.000363> [...] 09:28:19.384594 kill(2466, SIGTERM) = 0 <0.000077> 09:28:19.384932 kill(2467, SIGTERM) = 0 <0.000031> 09:28:19.385112 exit_group(0) = ? ------------ New shared memory was added after "sched_setparam/9-1". Added shmid "1998851" is from "shmget()" of "sched_setparam/9-1". And I judged that it is necessary to detach shared memory. "sched_setparam/10-1" is same situation. I revised "sched_setparam/9-1" and "sched_setparam/10-1". After revision, "hugeshmget02" passed. This failure may be only in several syetems of RHEL environment. But I think that detaching is necessary at least even in non-failed systems. Signed-off-by: Tomonori Mitani ============ --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/9-1.c 2010-12-14 09:47:45.000000000 +0900 +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/9-1.c 2010-12-14 15:07:56.000000000 +0900 @@ -144,6 +144,7 @@ shmptr = (int *)shmat(shm_id, 0, 0); if (shmptr < (int*)0) { perror("An error occurs when calling shmat()"); + shmctl(shm_id, IPC_RMID, NULL); return PTS_UNRESOLVED; } *shmptr = 0; @@ -155,6 +156,8 @@ } else { perror("An error occurs when calling sched_setscheduler()"); } + shmdt(shmptr); + shmctl(shm_id, IPC_RMID, NULL); return PTS_UNRESOLVED; } @@ -165,12 +168,16 @@ for(j=0; j