]> git.droids-corp.org - dpdk.git/commit
trace: fix crash when exiting
authorChengwen Feng <fengchengwen@huawei.com>
Fri, 17 Jun 2022 02:29:10 +0000 (10:29 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 21 Jun 2022 09:11:00 +0000 (11:11 +0200)
commita8f23b444dc3ff32ff27ceeba267fe996c0fbabd
tree5b96a8493da8050b48fe2b7a5eaec9b83f71e240
parent8b59472875e283e6f0ae1b6c3f4356c5240eb036
trace: fix crash when exiting

Bug scenario:
1. start testpmd:
  $ dpdk-testpmd -l 4-6 -a 0000:7d:00.0 --trace=.* -- -i
2. quit testpmd and then observed segment fault:
  Bye...
  Segmentation fault (core dumped)

The root cause is that rte_trace_save() and eal_trace_fini() access
the huge pages which were cleanup by rte_eal_memory_detach().

This patch moves rte_trace_save() and eal_trace_fini() before
rte_eal_memory_detach() to fix the bug.

Fixes: dfbc61a2f9a6 ("mem: detach memsegs on cleanup")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Tested-by: Jerin Jacob <jerinj@marvell.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
lib/eal/freebsd/eal.c
lib/eal/linux/eal.c