[#5313] [ltp] ltp test cases kill05 and kill10 are broken
Submitted By: Vivi Li
Open Date
2009-07-06 03:09:40 Close Date
2009-11-09 22:13:44
Priority:
Low Assignee:
Vivi Li
Status:
Closed Fixed In Release:
N/A
Found In Release:
2010R1 Release:
Category:
Tests Board:
N/A
Processor:
ALL Silicon Revision:
Is this bug repeatable?:
Yes Resolution:
Fixed
Uboot version or rev.:
Toolchain version or rev.:
gcc4.1_09r1-rc7
App binary format:
N/A
Summary: [ltp] ltp test cases kill05 and kill10 are broken
Details:
ltp test cases kill05 and kill10 are broken.
Although it's not a regression result and they have been broken all the time, I record it as a bug.
--
root:/bin> kill05
kill05 1 BROK : self_exec of child failed
kill05 0 INFO : WARNING: shared memory deletion failed.
kill05 0 INFO : This could lead to IPC resource problems.
kill05 0 INFO : id = 0
kill05 2 PASS : errno set to 1 : Operation not permitted, as expected
kill05 0 WARN : tst_rmdir(): rmobj(/tmp/kilhsxPSp) failed: lstat(/tmp/kilhsxPSp) failed; errno=2: No such file or directory
root:/bin>
--
--
root:/bin> kill10
kill10 1 BROK : fork() failed in fork_pgrps(2), errno=38 : Function not implemented
root:/bin>
--
Follow-ups
--- Graf Yang 2009-10-13 05:37:28
For pass kill05, you can apply the following patch, and be sure kill05 is
executable for every user,
--- testcases/kernel/syscalls/kill/kill05.c (revision 153)
+++ testcases/kernel/syscalls/kill/kill05.c (working copy)
@@ -84,12 +84,19 @@
void cleanup(void);
void setup(void);
void do_child(void);
+#ifdef UCLINUX
+void uclinux_child(void);
+#endif
void do_master_child(char **av);
char *TCID= "kill05";
int TST_TOTAL = 1;
int shmid1 = -1;
+#ifdef UCLINUX
+static key_t semkey = 1234;
+#else
extern key_t semkey;
+#endif
int *flag;
int exp_enos[] = {EPERM, 0};
@@ -111,7 +118,7 @@
}
#ifdef UCLINUX
- maybe_run_child(&do_child, "");
+ maybe_run_child(&uclinux_child, "");
#endif
setup(); /* global setup */
@@ -245,7 +252,32 @@
}
}
+#ifdef UCLINUX
/*
+ * uclinux_child()
+ */
+void
+uclinux_child()
+{
+ if ((shmid1 = shmget(semkey, (int)getpagesize(),
+ 0666|IPC_CREAT)) == -1) {
+ tst_brkm(TBROK, cleanup, "uclinux_child: Failed to setup shared
memory");
+ }
+
+ if ((flag = (int *)shmat(shmid1, 0, 0)) == (int *)-1) {
+ tst_brkm(TBROK, cleanup,
+ "uclinux_child: Failed to attatch shared memory:%d", flag);
+ }
+ if (*flag == 1) {
+ shmdt(flag);
+ exit(0);
+ } else {
+ sleep (1);
+ }
+}
+#endif
+
+/*
* setup() - performs all ONE TIME setup for this test
*/
void
@@ -264,8 +296,10 @@
*/
tst_tmpdir();
- /* get an IPC resource key */
- semkey = getipckey();
+#ifndef UCLINUX
+ /* get an IPC resource key */
+ semkey = getipckey();
+#endif
if ((shmid1 = shmget(semkey, (int)getpagesize(),
0666|IPC_CREAT)) == -1) {
--- Graf Yang 2009-10-13 22:36:58
kill10.c is designed for system that have implemented fork, it is impossible to
use vfork/daemon with slight modifications to make it work.
--- Graf Yang 2009-10-14 23:50:37
sorry, there is a little modification for the patch that have been posted,
Index: testcases/kernel/syscalls/kill/kill05.c
===================================================================
--- testcases/kernel/syscalls/kill/kill05.c (revision 153)
+++ testcases/kernel/syscalls/kill/kill05.c (working copy)
@@ -84,12 +84,19 @@
void cleanup(void);
void setup(void);
void do_child(void);
+#ifdef UCLINUX
+void uclinux_child(void);
+#endif
void do_master_child(char **av);
char *TCID= "kill05";
int TST_TOTAL = 1;
int shmid1 = -1;
+#ifdef UCLINUX
+static key_t semkey = 1234;
+#else
extern key_t semkey;
+#endif
int *flag;
int exp_enos[] = {EPERM, 0};
@@ -111,7 +118,7 @@
}
#ifdef UCLINUX
- maybe_run_child(&do_child, "");
+ maybe_run_child(&uclinux_child, "");
#endif
setup(); /* global setup */
@@ -245,7 +252,33 @@
}
}
+#ifdef UCLINUX
/*
+ * uclinux_child()
+ */
+void
+uclinux_child()
+{
+ if ((shmid1 = shmget(semkey, (int)getpagesize(),
+ 0666|IPC_CREAT)) == -1) {
+ tst_brkm(TBROK, cleanup, "uclinux_child: Failed to setup shared
memory");
+ }
+
+ if ((flag = (int *)shmat(shmid1, 0, 0)) == (int *)-1) {
+ tst_brkm(TBROK, cleanup,
+ "uclinux_child: Failed to attatch shared memory:%d", flag);
+ }
+ while(1) {
+ if (*flag == 1) {
+ shmdt(flag);
+ exit(0);
+ } else
+ sleep (1);
+ }
+}
+#endif
+
+/*
* setup() - performs all ONE TIME setup for this test
*/
void
@@ -264,8 +297,10 @@
*/
tst_tmpdir();
- /* get an IPC resource key */
- semkey = getipckey();
+#ifndef UCLINUX
+ /* get an IPC resource key */
+ semkey = getipckey();
+#endif
if ((shmid1 = shmget(semkey, (int)getpagesize(),
0666|IPC_CREAT)) == -1) {
--- Vivi Li 2009-11-08 22:08:09
Patch is applied but still failed in regression with the same error info.
--- Graf Yang 2009-11-09 06:14:03
Would you please check the permission of kill05. It should be executable by
every user. Or else, it would failed at self_exec.
--- Vivi Li 2009-11-09 22:13:44
After I change the execution permission to all users, it can work. So close this
bug.
--
chmod +x /bin/kill05
--
Files
Changes
Commits
Dependencies
Duplicates
Associations
Tags
File Name File Type File Size Posted By
No Files Were Found