Skip to contentSkip to conversation

syscalls: kill: Remove kill07

PATCH In review Ricardo B. Marlière via ltp 1 participant 8 messages Jun 11, 2025 – Jun 16, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls: kill: Remove kill07

From: Ricardo B. Marlière <[email protected]>

The test case description reads:

"Test case to check that SIGKILL can not be caught."

It makes use of sigaction() to set up a handler for SIGKILL, but according to its manual page:

"EINVAL An invalid signal was specified. This will also be generated if an attempt is made to change the action for SIGKILL or SIGSTOP, which cannot be caught or ignored."

Therefore, since the handler can never be executed, flag will never be set to 1. This renders the test invalid.

---
 runtest/syscalls                          |   1 -
 testcases/kernel/syscalls/kill/.gitignore |   1 -
 testcases/kernel/syscalls/kill/Makefile   |   3 +-
 testcases/kernel/syscalls/kill/kill07.c   | 230 ------------------------------
 4 files changed, 1 insertion(+), 234 deletions(-)
runtest/syscalls +0 -1
index 8c40048cc7534c42a79c738bdb06a8ea7aa335ac..d5582ca8da01f11adba75a56d22cb6e5c4996c68 100644
@@ -698,7 +698,6 @@ kill02 kill02
 kill03 kill03
 kill05 kill05
 kill06 kill06
-kill07 kill07
 kill08 kill08
 kill10 kill10
 kill11 kill11
testcases/kernel/syscalls/kill/.gitignore +0 -1
index 8188aa1083d92e25e654b9af32c15a4acbb6ab3d..f73696b9d076e6e9cae9359dd825b3324115ed67 100644
@@ -2,7 +2,6 @@
 /kill03
 /kill05
 /kill06
-/kill07
 /kill08
 /kill10
 /kill11
testcases/kernel/syscalls/kill/Makefile +1 -2
index 369eec8f21dd75adfafd810b32f75a376475809f..dfe5c3053801feeaa4c9fafe9097a34077798799 100644
@@ -3,11 +3,10 @@
 
 top_srcdir		?= ../../../..
 
-LTPLIBS = ipc newipc
+LTPLIBS = newipc
 
 include $(top_srcdir)/include/mk/testcases.mk
 
-kill07: LTPLDLIBS  = -lltpipc
 kill05: LTPLDLIBS  = -lltpnewipc
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
testcases/kernel/syscalls/kill/kill07.c deleted +0 -230

230 lines not on this page · raw message

---
base-commit: bf9589d5bdeef15b3dbb03f896793306552d0d0f
change-id: 20250611-conversions-kill-a31e42d7bc24

Best regards,

Signature · 5 lines
Ricardo B. Marlière <[email protected]>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Ricardo B. Marlière via ltp <[email protected]> wrote:

From: Ricardo B. Marlière <[email protected]>

Quoted 12 lines

The test case description reads:

"Test case to check that SIGKILL can not be caught."

It makes use of sigaction() to set up a handler for SIGKILL, but according to its manual page:

"EINVAL An invalid signal was specified. This will also be generated if an attempt is made to change the action for SIGKILL or SIGSTOP, which cannot be caught or ignored."

Or could we refactor kill07 to validate the EINVAL when changing action on SIGKILL/SIGSTOP?

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw
Quoted 11 lines · Li Wang

Ricardo B. Marlière via ltp <[email protected]> wrote:

From: Ricardo B. Marlière <[email protected]>

Quoted 8 lines

The test case description reads:

"Test case to check that SIGKILL can not be caught."

It makes use of sigaction() to set up a handler for SIGKILL, but according to its manual page:

Quoted 7 lines
Quoted 4 lines

"EINVAL An invalid signal was specified. This will also be generated if an attempt is made to change the action for SIGKILL or SIGSTOP, which cannot be caught or ignored."

Or could we refactor kill07 to validate the EINVAL when changing action on SIGKILL/SIGSTOP?

But then we would be testing sigaction(). Could you please elaborate?

Thanks,
- Ricardo.

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#3 lore raw
Quoted 16 lines · Ricardo B. Marlière
Quoted 12 lines · Li Wang

Ricardo B. Marlière via ltp <[email protected]> wrote:

From: Ricardo B. Marlière <[email protected]>

Quoted 9 lines

The test case description reads:

"Test case to check that SIGKILL can not be caught."

It makes use of sigaction() to set up a handler for SIGKILL, but according to its manual page:

"EINVAL An invalid signal was specified. This will also be generated

if an

Quoted 1 line
Quoted 1 line

attempt is made to change the action for SIGKILL or SIGSTOP, which

cannot

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

be caught or ignored."

Or could we refactor kill07 to validate the EINVAL when changing action

on

Quoted 1 line

SIGKILL/SIGSTOP?

But then we would be testing sigaction(). Could you please elaborate?

You're right, if we test sigaction(), then the code should be put into kernel/syscalls/sigaction/sigaction03.c.

Maybe we can try:

static void run(void)

{
    struct sigaction act = {
        .sa_handler = SIG_IGN,
    };

    int ret;

    ret = sigaction(SIGKILL, &act, NULL);
    if (ret == -1 && errno == EINVAL) {
        tst_res(TPASS, "sigaction(SIGKILL) failed as expected with EINVAL");
    } else {
        tst_res(TFAIL, ...);
    }

    ret = sigaction(SIGSTOP, &act, NULL);
    If (ret == -1 && errno == EINVAL) {
        tst_res(TPASS, "sigaction(SIGSTOP) failed as expected with EINVAL");
    } else {
        tst_res(TFAIL, ...);
    }
}
Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#4 lore raw
Quoted 25 lines · Li Wang
Quoted 23 lines · Ricardo B. Marlière
Quoted 12 lines · Li Wang

Ricardo B. Marlière via ltp <[email protected]> wrote:

From: Ricardo B. Marlière <[email protected]>

Quoted 9 lines

The test case description reads:

"Test case to check that SIGKILL can not be caught."

It makes use of sigaction() to set up a handler for SIGKILL, but according to its manual page:

"EINVAL An invalid signal was specified. This will also be generated

if an

Quoted 1 line
Quoted 1 line

attempt is made to change the action for SIGKILL or SIGSTOP, which

cannot

Quoted 4 lines
Quoted 2 lines

be caught or ignored."

Or could we refactor kill07 to validate the EINVAL when changing action

on

Quoted 1 line

SIGKILL/SIGSTOP?

Quoted 7 lines
Quoted 2 lines

But then we would be testing sigaction(). Could you please elaborate?

You're right, if we test sigaction(), then the code should be put into kernel/syscalls/sigaction/sigaction03.c.

Maybe we can try:

Sure! But in any case kill07 should still be removed IMHO.

Quoted 23 lines

static void run(void)

{
    struct sigaction act = {
        .sa_handler = SIG_IGN,
    };

    int ret;

    ret = sigaction(SIGKILL, &act, NULL);
    if (ret == -1 && errno == EINVAL) {
        tst_res(TPASS, "sigaction(SIGKILL) failed as expected with EINVAL");
    } else {
        tst_res(TFAIL, ...);
    }

    ret = sigaction(SIGSTOP, &act, NULL);
    If (ret == -1 && errno == EINVAL) {
        tst_res(TPASS, "sigaction(SIGSTOP) failed as expected with EINVAL");
    } else {
        tst_res(TFAIL, ...);
    }
}
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
author Reviewed-by Li Wang
#5 lore raw
Quoted 31 lines · Ricardo B. Marlière
Quoted 1 line · Li Wang

On Mon, Jun 16, 2025 at 7:02 PM Ricardo B. Marlière <[email protected]>

Quoted 13 lines · wrote:
Quoted 13 lines · Li Wang
Quoted 11 lines

Ricardo B. Marlière via ltp <[email protected]> wrote:

From: Ricardo B. Marlière <[email protected]>

Quoted 8 lines

The test case description reads:

"Test case to check that SIGKILL can not be caught."

It makes use of sigaction() to set up a handler for SIGKILL, but according to its manual page:

Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line

"EINVAL An invalid signal was specified. This will also be generated

if an

Quoted 1 line
Quoted 1 line

attempt is made to change the action for SIGKILL or SIGSTOP, which

cannot

Quoted 4 lines
Quoted 2 lines

be caught or ignored."

Or could we refactor kill07 to validate the EINVAL when changing

action

Quoted 6 lines
Quoted 5 lines

on

Quoted 1 line

SIGKILL/SIGSTOP?

But then we would be testing sigaction(). Could you please elaborate?

Quoted 7 lines
Quoted 4 lines

You're right, if we test sigaction(), then the code should be put into kernel/syscalls/sigaction/sigaction03.c.

Maybe we can try:

Sure! But in any case kill07 should still be removed IMHO.

Agreed. If you plan to add sigaction03.c separately, this one should be good.

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#6 lore raw
Quoted 36 lines · Li Wang
Quoted 34 lines · Ricardo B. Marlière
Quoted 1 line · Li Wang

On Mon, Jun 16, 2025 at 7:02 PM Ricardo B. Marlière <[email protected]>

Quoted 13 lines · wrote:
Quoted 13 lines · Li Wang
Quoted 11 lines

Ricardo B. Marlière via ltp <[email protected]> wrote:

From: Ricardo B. Marlière <[email protected]>

Quoted 8 lines

The test case description reads:

"Test case to check that SIGKILL can not be caught."

It makes use of sigaction() to set up a handler for SIGKILL, but according to its manual page:

Quoted 8 lines
Quoted 8 lines
Quoted 1 line
Quoted 1 line

"EINVAL An invalid signal was specified. This will also be generated

if an

Quoted 1 line
Quoted 1 line

attempt is made to change the action for SIGKILL or SIGSTOP, which

cannot

Quoted 4 lines
Quoted 2 lines

be caught or ignored."

Or could we refactor kill07 to validate the EINVAL when changing

action

Quoted 9 lines
Quoted 5 lines

on

Quoted 1 line

SIGKILL/SIGSTOP?

But then we would be testing sigaction(). Could you please elaborate?

You're right, if we test sigaction(), then the code should be put into kernel/syscalls/sigaction/sigaction03.c.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Maybe we can try:

Sure! But in any case kill07 should still be removed IMHO.

Agreed. If you plan to add sigaction03.c separately, this one should be good.

I think this is already covered in sigaction02.c:

https://github.com/linux-test-project/ltp/blob/7651bb22d715558c8a6d8732ef982e2146050b10/testcases/kernel/syscalls/sigaction/sigaction02.c#L29

They should be converted to the new API, though.

Quoted 2 lines

Thanks for reviewing,
- Ricardo.

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#7 lore raw
Quoted 44 lines · Ricardo B. Marlière
Quoted 1 line · Li Wang

On Mon, Jun 16, 2025 at 10:09 PM Ricardo B. Marlière <[email protected]>

Quoted 10 lines · wrote:
Quoted 10 lines · Li Wang
Quoted 1 line

On Mon, Jun 16, 2025 at 7:02 PM Ricardo B. Marlière <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines · Li Wang
Quoted 4 lines

Ricardo B. Marlière via ltp <[email protected]> wrote:

From: Ricardo B. Marlière <[email protected]>

Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

The test case description reads:

"Test case to check that SIGKILL can not be caught."

It makes use of sigaction() to set up a handler for SIGKILL, but according to its manual page:

"EINVAL An invalid signal was specified. This will also be

generated

Quoted 22 lines
Quoted 21 lines
Quoted 7 lines
Quoted 7 lines

if an

Quoted 1 line
Quoted 1 line

attempt is made to change the action for SIGKILL or SIGSTOP, which

cannot

Quoted 4 lines
Quoted 2 lines

be caught or ignored."

Or could we refactor kill07 to validate the EINVAL when changing

action

Quoted 10 lines
Quoted 5 lines

on

Quoted 1 line

SIGKILL/SIGSTOP?

But then we would be testing sigaction(). Could you please elaborate?

You're right, if we test sigaction(), then the code should be put into kernel/syscalls/sigaction/sigaction03.c.

Maybe we can try:

Sure! But in any case kill07 should still be removed IMHO.

Quoted 7 lines
Quoted 2 lines

Agreed. If you plan to add sigaction03.c separately, this one should be good.

I think this is already covered in sigaction02.c:

https://github.com/linux-test-project/ltp/blob/7651bb22d715558c8a6d8732ef982e2146050b10/testcases/kernel/syscalls/sigaction/sigaction02.c#L29

Oh, yes, I wasn't aware of that. Thanks for pointing that out. This patch merged!

Signature · 5 lines
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp