This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".
The branch, master has been updated
via fbc5f7d1433bd3a9fea7c55fed6ec3336a4fef02 (commit)
via d232f60bca28a01f19e7de993d356cab645f62b4 (commit)
from 70a21e1b3c797f96ed0768f045be7f1f624a415b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit fbc5f7d1433bd3a9fea7c55fed6ec3336a4fef02
Author: Stanislaw Kardach <skardach(a)marvell.com>
Date: Thu Jul 11 13:05:34 2019 +0200
test: performance: guard against double exit
Some applications use SHM to store global state, including a flag used
by signal handlers to indicate application termination request (through
SIGINT). If that signal is delivered a second time after the SHM segment
was freed, it will result in a segmentation fault as the memory is
released.
Signed-off-by: Stanislaw Kardach <skardach(a)marvell.com>
Reviewed-by: Matias Elo <matias.elo(a)nokia.com>
diff --git a/test/performance/odp_bench_packet.c b/test/performance/odp_bench_packet.c
index c89e86d8d..387bd9f25 100644
--- a/test/performance/odp_bench_packet.c
+++ b/test/performance/odp_bench_packet.c
@@ -171,6 +171,8 @@ static args_t *gbl_args;
static void sig_handler(int signo ODP_UNUSED)
{
+ if (gbl_args == NULL)
+ return;
gbl_args->exit_thread = 1;
}
@@ -1661,6 +1663,8 @@ int main(int argc, char *argv[])
LOG_ERR("Error: pool destroy\n");
exit(EXIT_FAILURE);
}
+ gbl_args = NULL;
+ odp_mb_full();
if (odp_shm_free(shm)) {
LOG_ERR("Error: shm free\n");
diff --git a/test/performance/odp_cpu_bench.c b/test/performance/odp_cpu_bench.c
index 4c36aca1e..00efb7a86 100644
--- a/test/performance/odp_cpu_bench.c
+++ b/test/performance/odp_cpu_bench.c
@@ -177,6 +177,8 @@ static const uint8_t test_udp_packet[] = {
static void sig_handler(int signo ODP_UNUSED)
{
+ if (gbl_args == NULL)
+ return;
gbl_args->exit_threads = 1;
}
@@ -799,6 +801,9 @@ int main(int argc, char *argv[])
}
}
}
+ gbl_args = NULL;
+ odp_mb_full();
+
if (odp_pool_destroy(pool)) {
LOG_ERR("Error: pool destroy\n");
exit(EXIT_FAILURE);
diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c
index 89c979324..2cec9c90c 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -178,6 +178,8 @@ static args_t *gbl_args;
static void sig_handler(int signo ODP_UNUSED)
{
+ if (gbl_args == NULL)
+ return;
gbl_args->exit_threads = 1;
}
@@ -1724,6 +1726,8 @@ int main(int argc, char *argv[])
free(gbl_args->appl.if_names);
free(gbl_args->appl.if_str);
+ gbl_args = NULL;
+ odp_mb_full();
if (odp_pool_destroy(pool)) {
LOG_ERR("Error: pool destroy\n");
diff --git a/test/performance/odp_sched_pktio.c b/test/performance/odp_sched_pktio.c
index 393ea3521..bc5da01f3 100644
--- a/test/performance/odp_sched_pktio.c
+++ b/test/performance/odp_sched_pktio.c
@@ -1544,6 +1544,8 @@ quit:
if (test_global->tx_pkt_sum > TEST_PASSED_LIMIT)
ret += 2;
}
+ test_global = NULL;
+ odp_mb_full();
if (odp_shm_free(shm)) {
printf("Error: shm free failed.\n");
commit d232f60bca28a01f19e7de993d356cab645f62b4
Author: Stanislaw Kardach <skardach(a)marvell.com>
Date: Thu Jul 11 13:04:55 2019 +0200
example: guard against double exit
Some applications use SHM to store global state, including a flag used
by signal handlers to indicate application termination request (through
SIGINT). If that signal is delivered a second time after the SHM segment
was freed, it will result in a segmentation fault as the memory is
released.
Signed-off-by: Stanislaw Kardach <skardach(a)marvell.com>
Reviewed-by: Matias Elo <matias.elo(a)nokia.com>
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index 313305f01..976dd722a 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -172,7 +172,8 @@ static void print_global_stats(int num_workers);
static void sig_handler(int signo ODP_UNUSED)
{
int i;
-
+ if (args == NULL)
+ return;
for (i = 0; i < args->thread_cnt; i++)
args->thread[i].stop = 1;
}
@@ -1408,6 +1409,8 @@ int main(int argc, char *argv[])
free(ifs);
free(args->appl.if_names);
free(args->appl.if_str);
+ args = NULL;
+ odp_mb_full();
if (0 != odp_pool_destroy(pool))
fprintf(stderr, "unable to destroy pool \"pool\"\n");
if (0 != odp_shm_free(shm))
diff --git a/example/l2fwd_simple/odp_l2fwd_simple.c b/example/l2fwd_simple/odp_l2fwd_simple.c
index 7bfa73b75..48f1462dd 100644
--- a/example/l2fwd_simple/odp_l2fwd_simple.c
+++ b/example/l2fwd_simple/odp_l2fwd_simple.c
@@ -32,6 +32,8 @@ static global_data_t *global;
static void sig_handler(int signo ODP_UNUSED)
{
printf("sig_handler!\n");
+ if (global == NULL)
+ return;
global->exit_thr = 1;
}
@@ -281,7 +283,9 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
- if (odp_shm_free(global->shm)) {
+ global = NULL;
+ odp_mb_full();
+ if (odp_shm_free(shm)) {
printf("Error: shm free global data\n");
exit(EXIT_FAILURE);
}
-----------------------------------------------------------------------
Summary of changes:
example/generator/odp_generator.c | 5 ++++-
example/l2fwd_simple/odp_l2fwd_simple.c | 6 +++++-
test/performance/odp_bench_packet.c | 4 ++++
test/performance/odp_cpu_bench.c | 5 +++++
test/performance/odp_l2fwd.c | 4 ++++
test/performance/odp_sched_pktio.c | 2 ++
6 files changed, 24 insertions(+), 2 deletions(-)
hooks/post-receive
--