Skip to content

Commit 817a01e

Browse files
authored
[syncd armhf] Fix syncd crash when running community test suites (sonic-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.
1 parent 649b108 commit 817a01e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/src/PerformanceIntervalTimer.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "PerformanceIntervalTimer.h"
22

33
#include "swss/logger.h"
4+
#include <inttypes.h>
45

56
using namespace sairediscommon;
67

@@ -46,7 +47,7 @@ void PerformanceIntervalTimer::inc(
4647
{
4748
if (m_enable)
4849
{
49-
SWSS_LOG_NOTICE("%zu (calls %zu) %s op took: %zu ms", m_count, m_calls, m_msg.c_str(), m_total/1000000);
50+
SWSS_LOG_NOTICE("%" PRIu64 " (calls %" PRIu64 ") %s op took: %" PRIu64 " ms", m_count, m_calls, m_msg.c_str(), m_total/1000000);
5051
}
5152

5253
reset();

lib/src/VirtualObjectIdManager.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "meta/sai_serialize.h"
44
#include "swss/logger.h"
5+
#include <inttypes.h>
56

67
extern "C" {
78
#include "saimetadata.h"
@@ -242,7 +243,7 @@ sai_object_id_t VirtualObjectIdManager::allocateNewObjectId(
242243

243244
if (objectIndex > SAI_REDIS_OBJECT_INDEX_MAX)
244245
{
245-
SWSS_LOG_THROW("no more object indexes available, given: 0x%lx but limit is 0x%llx",
246+
SWSS_LOG_THROW("no more object indexes available, given: 0x%" PRIu64 " but limit is 0x%" PRIu64 " ",
246247
objectIndex,
247248
SAI_REDIS_OBJECT_INDEX_MAX);
248249
}

0 commit comments

Comments
 (0)