|SUCCESS| [v2] app/test-pmd: terminate process on second signal

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Apr 28 17:46:07 CEST 2026


Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/163315

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-04-28

git sha: 20260428135323.119782-1-stephen at networkplumber.org
Author: Stephen Hemminger <stephen at networkplumber.org>
app/test-pmd: terminate process on second signal

This patch modifies the signal handler in testpmd to reset SIGINT and
SIGTERM to their default handlers when the first signal is received,
preventing use-after-free on a second signal during shutdown.

> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index e2569d9e30..59372838a5 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -4555,6 +4555,8 @@ print_stats(void)
>  static void
>  signal_handler(int signum __rte_unused)
>  {
> +	signal(SIGINT, SIG_DFL);
> +	signal(SIGTERM, SIG_DFL);

Does this code introduce a race condition? Between the two signal()
calls, if SIGTERM arrives while SIGINT's handler was being executed,
can signal_handler() re-enter and call signal(SIGINT, SIG_DFL) twice
before the second signal() call completes?

Should both signals be reset atomically, perhaps using sigaction() with
a sigset containing both SIGINT and SIGTERM, or by blocking signals
during the reset operation?

>  	f_quit = 1;
>  	prompt_exit();
>  }


More information about the test-report mailing list