From: Subrata M. <sub...@in...> - 2007-05-18 12:44:53
|
This is also through. Regards & Thanks-- Subrata Modak, Carmelo AMOROSO <carmelo.amoroso@ st.com> To Sent by: Carmelo AMOROSO ltp-list-bounces@ <car...@st...> lists.sourceforge cc .net ltp...@li..., Filippo ARCIDIACONO <fil...@st...> 05/14/07 05:25 PM Subject Re: [LTP] mtest06/mmap1.c test really broken !? Carmelo AMOROSO wrote: > Carmelo AMOROSO wrote: >> Subrata Modak wrote: >>> Hi Carmelo, >>> >>> Applied your Patch Manually as it created some problems with the >>> APRIL version. The attached is the diff-ed patch that i generated >>> against APRIL release. Please verify it. I also found some page >>> faults in my machines when i ran the modified mmap1. Please see the >>> attached tar containing outputs and logs of the test results done on >>> "2.6.9-42.0.3.EL" and "2.6.18-1.2961.el5" kernels. But logs say that >>> tests passed. >>> >>> Regards-- >>> Subrata >> Hi Subrata, >> for what I can see, your modified patch is rejecting all my changes, >> so it seems that you run the test using the original code. >> About the original log, the test says PASS just because it perfomors >> the check againt the thread exit value in the wrong way. >> To have evidence of what it is happening you need to run the test >> with the -v (verbose) option ON, but without our patch >> it doesnt' work. >> So I split the patch into three parts and attached the log for each run. >> I executed the test with the following command line: ./mmap1 -l 10 -v >> , where -l 10 it used to set the iterations number to 10 >> (just to reduce the execution time). >> > ..................... snippet out ............................ > > A last minute bug: the usage of OPT_MISSING is wrong. It should be > called into the if(..............) statements and not into the > else. > A forthcoming patch will be posted. > > Regards, > Carmelo > > Hi All, please find attached a proposal to fix the wrong usage of OPT_MISSING macro. Plase note that the patch has been created against 20070228 code base, with all previous posted patches already applied. Regards, Carmelo --- mmap1.c.orig 2007-05-14 13:23:27.195996000 +0200 +++ mmap1.c 2007-05-14 13:47:41.702766000 +0200 @@ -116,6 +116,7 @@ #define OPT_MISSING(prog, opt) do {\ fprintf(stderr, "%s: option -%c ", prog, opt); \ fprintf(stderr, "requires and argument\n");\ + usage(prog); \ } while(0) @@ -528,7 +529,7 @@ num_iter = 1000; exec_time = 24; - while ((c = getopt(argc, argv, "h:l:s:vx:")) != -1) + while ((c = getopt(argc, argv, "hvl:s:x:")) != -1) { switch(c) { @@ -537,25 +538,29 @@ break; case 'l': if ((num_iter = atoi(optarg)) == (int)NULL) - num_iter = 1000; - else - OPT_MISSING(argv[0], optopt); + OPT_MISSING(argv[0], optopt); + else + if (num_iter < 0) + fprintf(stdout,"WARNING: bad argument. Using default %d\n", (num_iter = 1000)); break; case 's': if ((file_size = atoi(optarg)) == 0) - file_size = 1024; - else - OPT_MISSING(argv[0], optopt); + OPT_MISSING(argv[0], optopt); + else + if (file_size < 0) + fprintf(stdout,"WARNING: bad argument. Using default %d\n", (file_size = 1024)); break; case 'v': verbose_print = TRUE; break; case 'x': if ((exec_time = atoi(optarg)) == (int)NULL) - exec_time = 24; - else - OPT_MISSING(argv[0], optopt); - run_once = FALSE; + OPT_MISSING(argv[0], optopt); + else + if (exec_time < 0) { + fprintf(stdout,"WARNING: bad argument. Using default %d\n", (exec_time = 24)); + } else + run_once = FALSE; break; default : usage(argv[0]); ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Ltp-list mailing list Ltp...@li... https://lists.sourceforge.net/lists/listinfo/ltp-list |