From b4e223dd4d75443de41c0e380216bde073d23ab6 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 17 Feb 2016 18:18:17 -0500 Subject: [PATCH] Fix: disable use of __builtin_return_address(0) on 32-bit PowerPC It causes stack corruption in the tracepoint event probes. Signed-off-by: Mathieu Desnoyers --- include/lttng/ust-tracepoint-event.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 6632f67a..29a017b0 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -565,11 +565,23 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ #define _TP_SESSION_CHECK(session, csession) 1 #endif /* TP_SESSION_CHECK */ +/* + * Use of __builtin_return_address(0) sometimes seems to cause stack + * corruption on 32-bit PowerPC. Disable this feature on that + * architecture for now by always using the NULL value for the ip + * context. + */ #undef _TP_IP_PARAM #ifdef TP_IP_PARAM #define _TP_IP_PARAM(x) (x) #else /* TP_IP_PARAM */ + +#if defined(__PPC__) && !defined(__PPC64__) +#define _TP_IP_PARAM(x) NULL +#else /* #if defined(__PPC__) && !defined(__PPC64__) */ #define _TP_IP_PARAM(x) __builtin_return_address(0) +#endif /* #else #if defined(__PPC__) && !defined(__PPC64__) */ + #endif /* TP_IP_PARAM */ /* -- 2.34.1