Index: src/libs/zbxnix/fatal.c
===================================================================
--- src/libs/zbxnix/fatal.c	(revision 54194)
+++ src/libs/zbxnix/fatal.c	(working copy)
@@ -66,6 +66,26 @@
 	}
 }
 
+static int	uctx_backtrace(ucontext_t *uctx, void *addr[], size_t addr_size)
+{
+	void	*ip, **bp;
+	int	n = 0;
+	
+	ip = (void*)uctx->uc_mcontext.mc_rip;
+	bp = (void**)uctx->uc_mcontext.mc_rbp;
+	
+	while (NULL != bp && NULL != ip) 
+	{
+		addr[n++] = ip;
+		
+		ip = bp[1];
+		bp = (void**)bp[0];
+	}
+	
+	return n;
+} 
+
+
 #if defined(HAVE_SYS_UCONTEXT_H) && (defined(REG_EIP) || defined(REG_RIP))
 
 static const char	*get_register_name(int reg)
@@ -211,9 +231,9 @@
 {
 #ifdef	HAVE_SYS_UCONTEXT_H
 
-#if defined(REG_EIP) || defined(REG_RIP)
+//#if defined(REG_EIP) || defined(REG_RIP)
 	ucontext_t	*uctx = (ucontext_t *)context;
-#endif
+//#endif
 
 	/* look for GET_PC() macro in sigcontextinfo.h files */
 	/* of glibc if you wish to add more CPU architectures */
@@ -291,7 +311,7 @@
 
 #ifdef	HAVE_EXECINFO_H
 
-	bcktrc_sz = backtrace(bcktrc, ZBX_BACKTRACE_SIZE);
+	bcktrc_sz = uctx_backtrace(uctx, bcktrc, ZBX_BACKTRACE_SIZE);
 	bcktrc_syms = backtrace_symbols(bcktrc, bcktrc_sz);
 
 	if (NULL == bcktrc_syms)
