Skip to content

Commit

Permalink
[syncd armhf] Fix syncd crash when running community test suites (son…
Browse files Browse the repository at this point in the history
…ic-net#777)

This commit fixes a syncd crash seen when running the sonic-mgmt comunity test
suites against the Marvell armhf platform. Analysis of the generated core file
points to improper format specifiers used when writing SWSS log entries. This
commit fixes that.
  • Loading branch information
dflynn-Nokia authored Jan 29, 2021
1 parent 649b108 commit 817a01e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/src/PerformanceIntervalTimer.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "PerformanceIntervalTimer.h"

#include "swss/logger.h"
#include <inttypes.h>

using namespace sairediscommon;

Expand Down Expand Up @@ -46,7 +47,7 @@ void PerformanceIntervalTimer::inc(
{
if (m_enable)
{
SWSS_LOG_NOTICE("%zu (calls %zu) %s op took: %zu ms", m_count, m_calls, m_msg.c_str(), m_total/1000000);
SWSS_LOG_NOTICE("%" PRIu64 " (calls %" PRIu64 ") %s op took: %" PRIu64 " ms", m_count, m_calls, m_msg.c_str(), m_total/1000000);
}

reset();
Expand Down
3 changes: 2 additions & 1 deletion lib/src/VirtualObjectIdManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "meta/sai_serialize.h"
#include "swss/logger.h"
#include <inttypes.h>

extern "C" {
#include "saimetadata.h"
Expand Down Expand Up @@ -242,7 +243,7 @@ sai_object_id_t VirtualObjectIdManager::allocateNewObjectId(

if (objectIndex > SAI_REDIS_OBJECT_INDEX_MAX)
{
SWSS_LOG_THROW("no more object indexes available, given: 0x%lx but limit is 0x%llx",
SWSS_LOG_THROW("no more object indexes available, given: 0x%" PRIu64 " but limit is 0x%" PRIu64 " ",
objectIndex,
SAI_REDIS_OBJECT_INDEX_MAX);
}
Expand Down

0 comments on commit 817a01e

Please sign in to comment.