log: fix crash after dump
authorJan Blunck <jblunck@infradead.org>
Mon, 1 Jun 2015 09:30:38 +0000 (11:30 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 22 Jun 2015 16:46:46 +0000 (18:46 +0200)
commit408a082c4a4ef4dd9a5b37e3217c0edb9b7f6b20
treef9a53695171be6d3baa3b8dfb89a623225a83be0
parentcda3f638c348b4ad35eb2492bf2ff8e1296f1489
log: fix crash after dump

In rte_log_dump_history() the log_history list is reinitialized without
resetting the log_history_size. In the next call to rte_log_add_in_history()
the log_history_size > RTE_LOG_HISTORY and the code unconditionally tries
to remove the first entry:

Program received signal SIGSEGV, Segmentation fault.
rte_log_add_in_history (
    buf=buf@entry=0x7f02035cd000 "[snip]\n", size=size@entry=86)
    at /usr/src/packages/BUILD/lib/librte_eal/common/eal_common_log.c:122

Signed-off-by: Jan Blunck <jblunck@infradead.org>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_eal/common/eal_common_log.c