Skip to contentSkip to conversation

syscalls/modify_ldt: Replace TINFO with TPASS or TFAIL

PATCH New zhaogongyi 2 participants 2 messages May 6, 2021

lore
Share & tools
lore

zhaogongyi

author
#0 lore raw

PATCH 2/4 syscalls/modify_ldt: Replace TINFO with TPASS or TFAIL

Hi,

I have reviewed the patch for some time, but I have not find the possible reason of it. Theoretically the patch didn't change the logic.

Because I have not the i386 machine, so I can't run it.

Best Regards,
Gongyi

Quoted 36 lines

Hi Petr,

Before my MR merged, the test case would not eixt a nozero value, is it the root cause of the problem?

Quoted 9 lines

Hi Zhao, Cyril,

Review

Quoted 1 line
(quoted diff) +0 -0

b/testcases/kernel/syscalls/modify_ldt/modify_ldt01.c
...

Quoted 2 lines
(quoted diff) +0 -0
@@ -149,15 +132,13 @@ int main(int ac, char **av)
 		(void)waitpid(pid, &status, 0);
Quoted 11 lines

Review int main(int ac, char **av) · line 137

Quoted 11 lines
(quoted diff) +1 -6
 		if (WEXITSTATUS(status) != 0) {
-			flag = FAILED;
 			tst_resm(TFAIL, "Did not generate SEGV, child returned "
 				 "unexpected status");
-		}
-
-		if (flag) {
-			tst_resm(TINFO, "block 2 FAILED");
 		} else {
-			tst_resm(TINFO, "block 2 PASSED");
+			if (WIFSIGNALED(status) && (WTERMSIG(status) ==

SIGSEGV))

Quoted 4 lines

Review int main(int ac, char **av) · line 140

Quoted 3 lines
(quoted diff) +3 -0
+				tst_resm(TPASS, "generate SEGV as expected");
+			else
+				tst_resm(TFAIL, "Did not generate SEGV");

FYI: since merging this patch (f5e8e6b11) test fails on this. Is it

expected?

Quoted 4 lines

I haven't looked closer whether it's a test bug or real issue.

Kind regards,
Petr

#1 lore raw

PATCH 2/4 syscalls/modify_ldt: Replace TINFO with TPASS or TFAIL

HI Gongyi,

Quoted 1 line

I have reviewed the patch for some time, but I have not find the possible reason of it. Theoretically the patch didn't change the logic.

I don't see the problem on first quick look.

Quoted 1 line

Because I have not the i386 machine, so I can't run it.

FYI You can compile 32bit on 64bit machine:

$ PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig CFLAGS=-m32 LDFLAGS=-m32 ./configure \
&& make && make install

NOTE: PKG_CONFIG_LIBDIR can vary, see INSTALL file. Or you can build LTP 32bit with build.sh script:

$ ./build.sh -t 32

Kind regards,
Petr