Hello,

the attached program fails to run with a sigsegv on a IBM power8-based system while it works flawlessly on Intel x86-64 and on a ARM v7l.

I compiled the code against libunwind downloaded from git on October 13th using the following command:

# gcc --version
gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1

# gcc -g traverse_callers.c -o traverse_callers -L $HOME/libunwind/git/lib64/ -lunwind -Wl,-rpath -Wl,$HOME/libunwind/git/lib64/ -I $HOME/libunwind/git/include -O0

  The debugger says:

(gdb) run
Starting program: ./traverse_callers

Program received signal SIGSEGV, Segmentation fault.
_ULppc64_step (cursor=0x3fffffffec08) at ppc64/Gstep.c:442
442         if (*inst == (0xE8410000 + 24)) {
(gdb) where
#0  _ULppc64_step (cursor=0x3fffffffec08) at ppc64/Gstep.c:442
#1  0x0000000010000810 in traverse_callstack () at traverse_callers.c:16
#2 0x000000001000089c in main (argc=1, argv=0x3ffffffff928) at traverse_callers.c:23

Thank you


WARNING / LEGAL TEXT: This message is intended only for the use of the
individual or entity to which it is addressed and may contain
information which is privileged, confidential, proprietary, or exempt
from disclosure under applicable law. If you are not the intended
recipient or the person responsible for delivering the message to the
intended recipient, you are strictly prohibited from disclosing,
distributing, copying, or in any way using this message. If you have
received this communication in error, please notify the sender and
destroy and delete any copies you may have received.

http://www.bsc.es/disclaimer
#define UNW_LOCAL_ONLY
#include <libunwind.h>

unsigned long long traverse_callstack (void)
{
	unw_cursor_t cursor;
	unw_context_t uc;

	if (unw_getcontext(&uc) < 0)
		return 0;

	if (unw_init_local(&cursor, &uc))
		return 0;

	while (1)
		if (unw_step (&cursor) <= 0)
			return 1;
	return 0;
}

int main(int argc, char **argv)
{
	traverse_callstack ();
}
_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to