[dpdk-dev] [PATCH v2 15/15] eal/linux: simplify debug message in sigbus_handler

Natanael Copa ncopa at alpinelinux.org
Tue Mar 12 11:22:36 CET 2019

There is no guarantee that pthread_self() returns the thread ID or that
pthread_t is an integer. The thread ID is not that useful so simply
remove it.

This fixes the following warning when building with musl libc:

../lib/librte_eal/linuxapp/eal/eal_dev.c: In function 'sigbus_handler':
../lib/librte_eal/linuxapp/eal/eal_dev.c:70:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   (int)pthread_self(), info->si_addr);

Signed-off-by: Natanael Copa <ncopa at alpinelinux.org>

v1 -> v2: remove gettid() and remove thread id from debug message.

 lib/librte_eal/linuxapp/eal/eal_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal_dev.c b/lib/librte_eal/linuxapp/eal/eal_dev.c
index 2830c8687..c41809380 100644
--- a/lib/librte_eal/linuxapp/eal/eal_dev.c
+++ b/lib/librte_eal/linuxapp/eal/eal_dev.c
@@ -66,8 +66,8 @@ static void sigbus_handler(int signum, siginfo_t *info,
 	int ret;
-	RTE_LOG(DEBUG, EAL, "Thread[%d] catch SIGBUS, fault address:%p\n",
-		(int)pthread_self(), info->si_addr);
+	RTE_LOG(DEBUG, EAL, "Thread catch SIGBUS, fault address:%p\n",
+		info->si_addr);
 	ret = rte_bus_sigbus_handler(info->si_addr);

More information about the dev mailing list