mbind01 test failed with after ltp-2009-11-12.tar.gz
Hi,
Following failure occurred in mbind01 when I execute "runltp" using ltp-2009-11-12.tar.gz.
Similer failure occured with several recent versions from ltp-2009-11-17.tar.gz
to ltp-2009-11-24.tar.gz, too.
<error message>
-----------------------------
EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=14 (Bad address) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=38 (Function not implemented) EXPECT: return value(ret)=-1 errno=14 (Bad address) RESULT: return value(ret)=-1 errno=38 (Function not implemented) mbind01 0 TINFO : (case00) START mbind01 1 TFAIL : (case00) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case01) START mbind01 2 TFAIL : (case01) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case02) START mbind01 3 TFAIL : (case02) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case03) START mbind01 4 TFAIL : (case03) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case04) START mbind01 5 TFAIL : (case04) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case05) START mbind01 6 TFAIL : (case05) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case06) START mbind01 7 TFAIL : (case06) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case07) START mbind01 8 TFAIL : (case07) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case08) START mbind01 9 TFAIL : (case08) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case09) START mbind01 10 TFAIL : (case09) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case10) START mbind01 11 TFAIL : (case10) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case00) START mbind01 12 TFAIL : (case00) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case01) START mbind01 13 TFAIL : (case01) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case02) START mbind01 14 TFAIL : (case02) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case03) START mbind01 15 TFAIL : (case03) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case04) START mbind01 16 TFAIL : (case04) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case05) START mbind01 17 TFAIL : (case05) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case06) START mbind01 18 TFAIL : (case06) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case07) START mbind01 19 TFAIL : (case07) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case08) START mbind01 20 TFAIL : (case08) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case09) START mbind01 21 TFAIL : (case09) END: errno=???(38): Function not implemented mbind01 0 TINFO : (case10) START mbind01 22 TFAIL : (case10) END: errno=???(38): Function not
implemented
-----------------------------
On the other hand, with "ltp-full-20091031", it passed as following message (My system not supports NUMA).
-----------------------------
mbind01 1 TCONF : NUMA support not provided.
-----------------------------
Therefore, this problem seems to be after 2009/11/04 revision, I think.
Following shows revision contribution contents.
http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/syscalls/mbin
d/mbind01.c?view=log
-----------------------------
Revision 1.7
Wed Nov 4 06:18:27 2009 UTC (2 weeks, 6 days ago) by yaberauneya
Branch: MAIN
Changes since 1.6: +1 -13 lines
Diff to previous 1.6
I was confused, and numaif.h is in fact a header under testcases/kernel/syscalls/utils. As such:
1. The autoconf test for the header is removed.
2. An appropriate inclusion is added for numa.h in numaif.h
3. Remove overengineered code in get_mempolicy01.c because linux_syscall_numbers.h handles the unhandled numa syscall numbers.
Revision 1.6
Wed Nov 4 04:59:44 2009 UTC (2 weeks, 6 days ago) by yaberauneya
Branch: MAIN
Changes since 1.5: +263 -281 lines
Diff to previous 1.5
1. Disable the test whenever the appropriate headers and syscalls don't exist so this will compile on systems without numa and without.
2. Fix the indentation.
3. Use TFAIL | TERRNO instead of all of the ad-hoc (TFAIL ... TERRNO, strerror(TERRNO)) logic.
-----------------------------
According to the contribution of these revisions, it is written that "Disable the test whenever the appropriate headers and syscalls don't exist.".
However, when I compare these revisions, the judgement sentence whether numa is supported or not is deleted, and the error output sentence that numa is not supported is deleted.
Following shows the result of compare of "Revision 1.6 and Revision 1.5" and "Revision 1.7 and Revision 1.6".
<Revision 1.6 and Revision 1.5>
-----------------------------
mbind01.c +0 -0
@@ -1,50 +1,51 @@
.
@@ -55,10 +56,12 @@
.
@@ -66,70 +69,72 @@
.
-#if HAS_NUMA_H
static struct test_case tcase[] = {
.
-#else
-static struct test_case tcase[] = { }; -#endif
.
@@ -261,82 +262,80 @@
.
static int do_test(struct test_case *tc) {
-#if HAS_NUMA_H
.
-#else
- return -1;
-#endif
.
@@ -346,47 +345,43 @@
.
-#if HAS_NUMA_H
.
@@ -394,45 +389,32 @@
.
#else
+int main (void) {
tst_resm(TCONF, "NUMA support not provided.");
-#endif
- cleanup();
tst_exit();
}
+#endif
-----------------------------
<Revision 1.7 and Revision 1.6>
-----------------------------
mbind01.c +0 -0
@@ -59,14 +59,11 @@
.
@@ -77,8 +74,6 @@
.
@@ -411,10 +406,3 @@
cleanup();
tst_exit();
}
-
-#else
-int main (void) {
- tst_resm(TCONF, "NUMA support not provided.");
- tst_exit();
-}
-#endif
-----------------------------
I think that these revisions may contradict the above contribution. (Please forgive me if my opinion was wrong.)
To revise this problem (error of "Function not implemented") like above contribution, it is necessary to judge numa supporting by using "#if HAS_NUMA_H".
And it is necessary to end with " tst_resm(TCONF, "NUMA support not provided.") "
when not support, I think.
It is the point same as 2009/10/31 version.
Following shows my revise draft.
============
mbind01.c renamed from mbind01.c.org +8 -0
@@ -176,6 +176,7 @@* (only we can do is simulate 1-node NUMA) */ +#if HAS_NUMA_H static struct test_case tcase[] = { { /* case00 */ .policy = MPOL_DEFAULT,
@@ -246,6 +247,7 @@ .err = EFAULT, }, }; +#endif #define MEM_LENGTH (4 * 1024 * 1024)/*
@@ -365,6 +367,7 @@setup (); +#if HAS_NUMA_H int lc, i, ret;/* loop counter */ /* Check looping state if -i option given */
@@ -404,4 +407,9 @@ }cleanup ();tst_exit (); + +#else +tst_resm (TCONF ,"NUMA support not provided." ); +#endif + }
============
Can I get opinion that my revision is right or not?
Thank you--
-Tomonori Mitani
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 9 lines · Mitani
Hi,
Following failure occurred in mbind01 when I execute "runltp" using ltp-2009-11-12.tar.gz.
Similer failure occured with several recent versions from ltp-2009-11-17.tar.gz
to ltp-2009-11-24.tar.gz, too.<error message>
[...]
Quoted 177 lines
On the other hand, with "ltp-full-20091031", it passed as following message (My system not supports NUMA).
-----------------------------
mbind01 1 TCONF : NUMA support not provided.
-----------------------------Therefore, this problem seems to be after 2009/11/04 revision, I think.
Following shows revision contribution contents.
http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/syscalls/mbin
d/mbind01.c?view=log-----------------------------
Revision 1.7
Wed Nov 4 06:18:27 2009 UTC (2 weeks, 6 days ago) by yaberauneya
Branch: MAIN
Changes since 1.6: +1 -13 lines
Diff to previous 1.6
I was confused, andnumaif.his in fact a header under testcases/kernel/syscalls/utils. As such:1. The autoconf test for the header is removed.
2. An appropriate inclusion is added fornuma.hinnumaif.h
3. Remove overengineered code inget_mempolicy01.cbecauselinux_syscall_numbers.hhandles the unhandled numa syscall numbers.Signed-off-by Garrett Cooper <[email protected]>Revision 1.6
Wed Nov 4 04:59:44 2009 UTC (2 weeks, 6 days ago) by yaberauneya
Branch: MAIN
Changes since 1.5: +263 -281 lines
Diff to previous 1.5
1. Disable the test whenever the appropriate headers and syscalls don't exist so this will compile on systems without numa and without.
2. Fix the indentation.
3. Use TFAIL | TERRNO instead of all of the ad-hoc (TFAIL ... TERRNO, strerror(TERRNO)) logic.Signed-off-by Garrett Cooper <[email protected]>-----------------------------
According to the contribution of these revisions, it is written that "Disable the test whenever the appropriate headers and syscalls don't exist.".
However, when I compare these revisions, the judgement sentence whether numa is supported or not is deleted, and the error output sentence that numa is not supported is deleted.Following shows the result of compare of "Revision 1.6 and Revision 1.5" and "Revision 1.7 and Revision 1.6".
<Revision 1.6 and Revision 1.5>
-----------------------------11/04 04:59:44 1.6 renamed from 10/09 17:55:57 1.5 +0
-0@@ -1,50 +1,51 @@.
11/04 04:59:44 1.6 renamed from 10/09 17:55:57 1.5 +0
-0@@ -55,10 +56,12 @@.
11/04 04:59:44 1.6 renamed from 10/09 17:55:57 1.5 +0
-0@@ -66,70 +69,72 @@.
-#ifHAS_NUMA_H
static structtest_casetcase[] = {
.11/04 04:59:44 1.6 renamed from 10/09 17:55:57 1.5 +0
-3-#else -static struct test_case tcase[] = { }; -#endif.
11/04 04:59:44 1.6 renamed from 10/09 17:55:57 1.5 +0
-0@@ -261,82 +262,80 @@.
static intdo_test(struct test_case *tc){
-#ifHAS_NUMA_H
.11/04 04:59:44 1.6 renamed from 10/09 17:55:57 1.5 +0
-3-#else - return -1; -#endif.
11/04 04:59:44 1.6 renamed from 10/09 17:55:57 1.5 +0
-0@@ -346,47 +345,43 @@.
-#ifHAS_NUMA_H
.11/04 04:59:44 1.6 renamed from 10/09 17:55:57 1.5 +0
-0@@ -394,45 +389,32 @@.
#else
+int main (void) {
tst_resm(TCONF, "NUMA support not provided."); -#endif
- cleanup();
tst_exit();
}
+#endif
-----------------------------<Revision 1.7 and Revision 1.6>
-----------------------------11/04 06:18:27 1.7 renamed from 11/04 04:59:44 1.6 +0
-0@@ -59,14 +59,11 @@.
11/04 06:18:27 1.7 renamed from 11/04 04:59:44 1.6 +0
-0@@ -77,8 +74,6 @@.
11/04 06:18:27 1.7 renamed from 11/04 04:59:44 1.6 +0
-8@@ -411,10 +406,3 @@ cleanup(); tst_exit(); } - -#else -int main (void) { - tst_resm(TCONF, "NUMA support not provided."); - tst_exit(); -} -#endif -----------------------------I think that these revisions may contradict the above contribution. (Please forgive me if my opinion was wrong.)
To revise this problem (error of "Function not implemented") like above contribution, it is necessary to judge numa supporting by using "#if
HAS_NUMA_H".
And it is necessary to end with "tst_resm(TCONF, "NUMA support not provided.")"
when not support, I think.
It is the point same as 2009/10/31 version.Following shows my revise draft.
============
mbind01.c 2009-11-24 16:09:03.000000000 +0900 renamed from mbind01.c.org 2009-11-24 18:17:27.000000000 +0900 +1
-0@@ -176,6 +176,7 @@ * (only we can do is simulate 1-node NUMA) */ +#if HAS_NUMA_H static struct test_case tcase[] = {{ /* case00 */
.policy =MPOL_DEFAULT,mbind01.c 2009-11-24 16:09:03.000000000 +0900 renamed from mbind01.c.org 2009-11-24 18:17:27.000000000 +0900 +2
-0@@ -246,6 +247,7 @@ .err = EFAULT, }, }; +#endif #define MEM_LENGTH (4 * 1024 * 1024) /*@@ -365,6 +367,7 @@ setup(); +#if HAS_NUMA_Hint lc, i, ret; /* loop counter */
/* Check looping state if -i option given */
mbind01.c 2009-11-24 16:09:03.000000000 +0900 renamed from mbind01.c.org 2009-11-24 18:17:27.000000000 +0900 +5
-0@@ -404,4 +407,9 @@ } cleanup(); tst_exit(); + +#else + tst_resm(TCONF, "NUMA support not provided."); +#endif + }============
Quoted 1 line
Can I get opinion that my revision is right or not?
Something I realized after testing yesterday, is that although we're overriding syscall, it doesn't catch ENOSYS and output tst_brkm(TCONF, ...) like I thought it would.
Would you please do the following?
1. cd $LTPSRC/testcases/kernel/include
2. Apply the following patch:
Index: regen.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/include/regen.sh,v retrieving revision 1.12
regen.sh +6 -1
@@ -32,8 +32,13 @@ static void cleanup(void); tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ errno = ENOSYS; \\ __ret = -1; \\ - } else \\ + } else { \\ __ret = syscall(NR, ##__VA_ARGS__); \\ + if (__ret == -1 && errno == ENOSYS) { \\ + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ + errno = ENOSYS; \\ + } \\ + } \\ __ret; \\ }) EOF
3. make clean all
4. cd ../syscalls/mbind
5. make clean all
6. ./mbind01
Let me know how it goes -- if other folks agree with the solution (ENOSYS is always TCONF with the syscall(2) wrapper) I'll check it directly into CVS; otherwise I'll have to engineer a large scale solution in a number of tests which have syscall numbers defined on later kernel versions, s.t. they fail happily with TCONF when errno == ENOSYS.
Thanks!
-Garrett
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 7 lines · On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
regen.sh +0
-1@@ -32,8 +32,13 @@ static void cleanup(void); tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ errno = ENOSYS; \\ __ret = -1; \\ - } else \\
regen.sh static void cleanup(void);
Quoted 10 lines
regen.sh +5
-0+ } else { \\ __ret = syscall(NR, ##__VA_ARGS__); \\ + if (__ret == -1 && errno == ENOSYS) { \\ + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ + errno = ENOSYS; \\ + } \\ + } \\ __ret; \\ }) EOF
i'd prefer this change
kernel/include/regen.sh +2 -1
@@ -30,11 +30,12 @@ static void cleanup(void); #define syscall(NR, ...) ({ \\ int __ret; \\ if (NR == 0) { \\ - tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ errno = ENOSYS; \\ __ret = -1; \\ } else \\ __ret = syscall(NR, ##__VA_ARGS__); \\ + if (__ret == -1 && errno == ENOSYS) \\ + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ __ret; \\ }) EOF
-mike
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 35 lines · Mike Frysinger
Quoted 16 lines · On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
regen.sh 25 Nov 2009 05:12:13 -0000 renamed from regen.sh 19 Nov 2009 19:35:15 -0000 1.12 +5
-1@@ -32,8 +32,13 @@ static void cleanup(void); tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ errno = ENOSYS; \\ __ret = -1; \\ - } else \\ + } else { \\ __ret = syscall(NR, ##__VA_ARGS__); \\ + if (__ret == -1 && errno == ENOSYS) { \\ + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ + errno = ENOSYS; \\ + } \\ + } \\ __ret; \\ })Quoted 1 line
EOF
i'd prefer this change
kernel/include/regen.sh 25 Nov 2009 05:28:27 -0000 renamed from kernel/include/regen.sh 9 Oct 2009 17:55:48 -0000 1.11 +2
-1@@ -30,11 +30,12 @@ static void cleanup(void); #define syscall(NR, ...) ({ \\ int __ret; \\ if (NR == 0) { \\ - tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ errno = ENOSYS; \\ __ret = -1; \\ } else \\ __ret = syscall(NR, ##__VA_ARGS__); \\ + if (__ret == -1 && errno == ENOSYS) \\ + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ __ret; \\ })
Quoted 1 line
EOF
Ok -- that makes more sense.. besides, I think gcc was optimizing
out the first branch with -O2 if it always evaluated to false. Here's the new patch (I'm keeping the errno = ENOSYS part because I want to make sure that tst_brkm doesn't mess up the errno value if a write(2) fails or something).
Thanks!
-Garrett
EXAMPLE (Positive):
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/mbind $ ./mbind01
mbind01 0 TINFO : (case00) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 1 TPASS : (case00) END mbind01 0 TINFO : (case01) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 2 TPASS : (case01) END mbind01 0 TINFO : (case02) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 3 TPASS : (case02) END mbind01 0 TINFO : (case03) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 4 TPASS : (case03) END mbind01 0 TINFO : (case04) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 5 TPASS : (case04) END mbind01 0 TINFO : (case05) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 6 TPASS : (case05) END mbind01 0 TINFO : (case06) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 7 TPASS : (case06) END mbind01 0 TINFO : (case07) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 8 TPASS : (case07) END mbind01 0 TINFO : (case08) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 9 TPASS : (case08) END mbind01 0 TINFO : (case09) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 10 TPASS : (case09) END mbind01 0 TINFO : (case10) START EXPECT: return value(ret)=-1 errno=14 (Bad address) RESULT: return value(ret)=-1 errno=14 (Bad address) mbind01 11 TPASS : (case10) END mbind01 0 TINFO : (case00) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 12 TPASS : (case00) END mbind01 0 TINFO : (case01) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 13 TPASS : (case01) END mbind01 0 TINFO : (case02) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 14 TPASS : (case02) END mbind01 0 TINFO : (case03) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 15 TPASS : (case03) END mbind01 0 TINFO : (case04) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 16 TPASS : (case04) END mbind01 0 TINFO : (case05) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 17 TPASS : (case05) END mbind01 0 TINFO : (case06) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 18 TPASS : (case06) END mbind01 0 TINFO : (case07) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 19 TPASS : (case07) END mbind01 0 TINFO : (case08) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 20 TPASS : (case08) END mbind01 0 TINFO : (case09) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 21 TPASS : (case09) END mbind01 0 TINFO : (case10) START EXPECT: return value(ret)=-1 errno=14 (Bad address) RESULT: return value(ret)=-1 errno=14 (Bad address) mbind01 22 TPASS : (case10) END
EXAMPLE (Negative):
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ make all make -C "/scratch/ltp-dev2/ltp/lib" -f "/scratch/ltp-dev2/ltp/lib/Makefile" all make[1]: Entering directory `/scratch/ltp-dev2/ltp/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/scratch/ltp-dev2/ltp/lib'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -I/scratch/ltp-dev2/ltp/testcases/kernel/include -I../../../../include
-I../../../../include -L../../../../lib foo.c -lltp -o foo
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ ./foo
foo 1 TCONF : syscall __NR_foo not supported on your arch
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo
$ cat foo.c #include "test.h" #include "linux_syscall_numbers.h"
#define __NR_foo 19567
int TST_TOTAL = 1;
char *TCID = "foo";
void cleanup(void) { }
int
main (void) {
return syscall(__NR_foo, "bar");
}gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ ./foo
foo 1 TCONF : syscall __NR_foo not supported on your arch
PATCH:
Index: regen.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/include/regen.sh,v retrieving revision 1.12
regen.sh +6 -2
@@ -29,11 +29,15 @@ static void cleanup(void); #define syscall(NR, ...) ({ \\ int __ret; \\ if (NR == 0) { \\ - tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ errno = ENOSYS; \\ __ret = -1; \\ - } else \\ + } else { \\ __ret = syscall(NR, ##__VA_ARGS__); \\ + } \\ + if (__ret == -1 && errno == ENOSYS) { \\ + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ + errno = ENOSYS; \\ + } \\ __ret; \\ }) EOF
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 35 lines · On Wednesday 25 November 2009 01:26:20 Garrett Cooper wrote:
Quoted 34 lines · Mike Frysinger
Quoted 7 lines · On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
regen.sh 25 Nov 2009 05:12:13 -0000 renamed from regen.sh 19 Nov 2009 19:35:15 -0000 1.12 +0
-1@@ -32,8 +32,13 @@ static void cleanup(void); tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ errno = ENOSYS; \\ __ret = -1; \\ - } else \\regen.sh 25 Nov 2009 05:12:13 -0000 static void cleanup(void);
Quoted 10 lines
regen.sh 25 Nov 2009 05:12:13 -0000 renamed from regen.sh 19 Nov 2009 19:35:15 -0000 1.12 +5
-0+ } else { \\ __ret = syscall(NR, ##__VA_ARGS__); \\ + if (__ret == -1 && errno == ENOSYS) { \\ + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ + errno = ENOSYS; \\ + } \\ + } \\ __ret; \\ }) EOFi'd prefer this change
---testcases/kernel/include/regen.sh9 Oct 2009 17:55:48 -0000
1.11 +++testcases/kernel/include/regen.sh25 Nov 2009 05:28:27 -0000(quoted diff) +2
-1@@ -30,11 +30,12 @@ static void cleanup(void); #define syscall(NR, ...) ({ \\ int __ret; \\ if (NR == 0) { \\ - tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ errno = ENOSYS; \\ __ret = -1; \\ } else \\ __ret = syscall(NR, ##__VA_ARGS__); \\ + if (__ret == -1 && errno == ENOSYS) \\ + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ __ret; \\
Quoted 8 lines
Review static void cleanup(void); · line 41
Quoted 2 lines
(quoted diff) +0
-0}) EOFOk -- that makes more sense.. besides, I think gcc was optimizing
out the first branch with -O2 if it always evaluated to false. Here's the new patch (I'm keeping the errno = ENOSYS part because I want to make sure thattst_brkmdoesn't mess up the errno value if a write(2) fails or something).
i thought tst_brkm exited when called with a cleanup func like we do here -mike
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 45 lines · Mike Frysinger
Quoted 35 lines · On Wednesday 25 November 2009 01:26:20 Garrett Cooper wrote:
Quoted 34 lines · Mike Frysinger
Quoted 9 lines · On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
regen.sh 25 Nov 2009 05:12:13 -0000 renamed from regen.sh 19 Nov 2009 19:35:15 -0000 1.12 +0
-0@@ -32,8 +32,13 @@ static void cleanup(void);
tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ errno = ENOSYS; \\
__ret= -1; \\
- } else \\
+ } else { \\
__ret=syscall(NR, ##__VA_ARGS__); \\Quoted 8 lines
+ if (
__ret== -1 && errno == ENOSYS) { \\
+tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ + errno = ENOSYS; \\
+ } \\
+ } \\
__ret; \\
})
EOFi'd prefer this change
---testcases/kernel/include/regen.sh9 Oct 2009 17:55:48 -0000 1.11 +++testcases/kernel/include/regen.sh25 Nov 2009 05:28:27 -0000(quoted diff) +2
-1@@ -30,11 +30,12 @@ static void cleanup(void); #define syscall(NR, ...) ({ \\ int __ret; \\ if (NR == 0) { \\ - tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ errno = ENOSYS; \\ __ret = -1; \\ } else \\ __ret = syscall(NR, ##__VA_ARGS__); \\ + if (__ret == -1 && errno == ENOSYS) \\ + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on your arch"); \\ __ret; \\Quoted 8 lines
Quoted 2 lines
(quoted diff) +0
-0})EOF
Ok -- that makes more sense.. besides, I think gcc was optimizing out the first branch with -O2 if it always evaluated to false. Here's the new patch (I'm keeping the errno = ENOSYS part because I want to make sure that
tst_brkmdoesn't mess up the errno value if a write(2) fails or something).
Quoted 1 line
i thought
tst_brkmexited when called with a cleanup func like we do here
tst_brkm exits when cleanup is non-NULL:
/*
* If no cleanup function was specified, just return to the caller.
* Otherwise call the specified function. If specified function
* returns, call tst_exit().
*/
if (func != NULL) {
(*func)();
tst_exit();
}
It's always defined for us in linux_syscall_numbers.h, thus italways exits...
Cheers,
-Garrett
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi,
Sorry I'm late.
I copied a patch part from ltp-list and apply it, but the patch failed. I didn't notice that tabs in the patch were changed to blanks, and I took time. Forgive me.
But, I could make right patch by copying from your email, and I succeeded.
As a result, mbind01 became PASS by applying your last patch.
Thank you.
-Tomonori Mitani
-----Original Message-----
From: Garrett Cooper [mailto:[email protected]]
Sent: Wednesday, November 25, 2009 3:26 PM
To: Mike Frysinger
Cc: Mitani; [email protected]; Nate Straz; Matt Helsley
Subject: Re: [LTP] mbind01 test failed with after ltp-2009-11-12.tar.gz
Quoted 5 lines · Mike Frysinger
Quoted 4 lines · On Wednesday 25 November 2009 00:17:16 Garrett Cooper wrote:
regen.sh 25 Nov 2009 05:12:13 -0000 renamed from regen.sh 19 Nov 2009 19:35:15 -0000 1.12 +0
-0@@ -32,8 +32,13 @@ static void cleanup(void);tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch");
Quoted 7 lines
Quoted 7 lines
\\ errno = ENOSYS; \\
__ret= -1; \\
- } else \\
+ } else { \\
__ret=syscall(NR, ##__VA_ARGS__); \\
+ if (__ret== -1 && errno == ENOSYS) { \\
+ tst_brkm(TCONF, cleanup, "syscall " #NR " not
supported on your arch");
Quoted 9 lines
Quoted 6 lines
\\ + errno = ENOSYS; \\
+ } \\
+ } \\
__ret; \\
})
EOFi'd prefer this change
---testcases/kernel/include/regen.sh9 Oct 2009 17:55:48 -0000
1.11
Review static void cleanup(void); · line 33
Quoted 6 lines
+++
testcases/kernel/include/regen.sh25 Nov 2009 05:28:27 -0000(quoted diff) +0
-1@@ -30,11 +30,12 @@ static void cleanup(void); #define syscall(NR, ...) ({ \\ int __ret; \\ if (NR == 0) { \\ - tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
Review static void cleanup(void); · line 38
Quoted 6 lines
(quoted diff) +2
-0errno = ENOSYS; \\ __ret = -1; \\ } else \\ __ret = syscall(NR, ##__VA_ARGS__); \\ + if (__ret == -1 && errno == ENOSYS) \\ + tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
Quoted 3 lines
(quoted diff) +0
-0__ret; \\ })EOF
Ok -- that makes more sense.. besides, I think gcc was optimizing
out the first branch with -O2 if it always evaluated to false. Here's the new patch (I'm keeping the errno = ENOSYS part because I want to make sure that tst_brkm doesn't mess up the errno value if a write(2) fails or something).
Thanks!
-Garrett
EXAMPLE (Positive):
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/mbind $ ./mbind01
mbind01 0 TINFO : (case00) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 1 TPASS : (case00) END mbind01 0 TINFO : (case01) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 2 TPASS : (case01) END mbind01 0 TINFO : (case02) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 3 TPASS : (case02) END mbind01 0 TINFO : (case03) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 4 TPASS : (case03) END mbind01 0 TINFO : (case04) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 5 TPASS : (case04) END mbind01 0 TINFO : (case05) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 6 TPASS : (case05) END mbind01 0 TINFO : (case06) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 7 TPASS : (case06) END mbind01 0 TINFO : (case07) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 8 TPASS : (case07) END mbind01 0 TINFO : (case08) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 9 TPASS : (case08) END mbind01 0 TINFO : (case09) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 10 TPASS : (case09) END mbind01 0 TINFO : (case10) START EXPECT: return value(ret)=-1 errno=14 (Bad address) RESULT: return value(ret)=-1 errno=14 (Bad address) mbind01 11 TPASS : (case10) END mbind01 0 TINFO : (case00) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 12 TPASS : (case00) END mbind01 0 TINFO : (case01) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 13 TPASS : (case01) END mbind01 0 TINFO : (case02) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 14 TPASS : (case02) END mbind01 0 TINFO : (case03) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 15 TPASS : (case03) END mbind01 0 TINFO : (case04) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 16 TPASS : (case04) END mbind01 0 TINFO : (case05) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 17 TPASS : (case05) END mbind01 0 TINFO : (case06) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 18 TPASS : (case06) END mbind01 0 TINFO : (case07) START EXPECT: return value(ret)=0 errno=0 (Success) RESULT: return value(ret)=0 errno=0 (Success) mbind01 19 TPASS : (case07) END mbind01 0 TINFO : (case08) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 20 TPASS : (case08) END mbind01 0 TINFO : (case09) START EXPECT: return value(ret)=-1 errno=22 (Invalid argument) RESULT: return value(ret)=-1 errno=22 (Invalid argument) mbind01 21 TPASS : (case09) END mbind01 0 TINFO : (case10) START EXPECT: return value(ret)=-1 errno=14 (Bad address) RESULT: return value(ret)=-1 errno=14 (Bad address) mbind01 22 TPASS : (case10) END
EXAMPLE (Negative):
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ make all
make -C "/scratch/ltp-dev2/ltp/lib" -f "/scratch/ltp-dev2/ltp/lib/Makefile" all
make[1]: Entering directory `/scratch/ltp-dev2/ltp/lib'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/scratch/ltp-dev2/ltp/lib'
gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -I/scratch/ltp-dev2/ltp/testcases/kernel/include -I../../../../include
-I../../../../include -L../../../../lib foo.c -lltp -o foo
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ ./foo
foo 1 TCONF : syscall __NR_foo not supported on your arch
gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo
$ cat foo.c #include "test.h" #include "linux_syscall_numbers.h"
#define __NR_foo 19567
int TST_TOTAL = 1;
char *TCID = "foo";
void cleanup(void) { }
int
main (void) {
return syscall(__NR_foo, "bar");
}gcooper@orangebox /scratch/ltp-dev2/ltp/testcases/kernel/syscalls/foo $ ./foo
foo 1 TCONF : syscall __NR_foo not supported on your arch
PATCH:
Index: regen.sh
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/include/regen.sh,v retrieving revision 1.12
regen.sh +0 -1
@@ -29,11 +29,15 @@ static void cleanup(void); #define syscall(NR, ...) ({ \\ int __ret; \\ if (NR == 0) { \\ - tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
errno = ENOSYS; \\
__ret = -1; \\
- } else \\
+ } else { \\
__ret = syscall(NR, ##__VA_ARGS__); \\
+ } \\
+ if (__ret == -1 && errno == ENOSYS) { \\
+ tst_brkm(TCONF, cleanup, "syscall " #NR " not supported on
your arch"); \\
+ errno = ENOSYS; \\
+ } \\
__ret; \\
})
EOF
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list