Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QNX 7.0 Backtrace bt_get_backtrace returns 0xFFFFFFFF: (8 Items)
   
QNX 7.0 Backtrace bt_get_backtrace returns 0xFFFFFFFF  
Hi all, I'm trying to get a backtrace on my application (running on QNX7.0), but calls to bt_get_backtrace() keep 
returning 0xFFFFFFFF for some reason. The following code is how I'm initiating a backtrace

bt_accessor_t bt_accessor;
bt_memmap_t memmap;
uintptr_t addr_buff[32];
char out_buff[1024];

bt_init_accessor(&bt_accessor, BT_SELF);
bt_load_memmap(&bt_accessor, &memmap);
bt_sprn_memmap(&memmap, out_buff, sizeof(out_buff));

int depth = bt_get_backtrace(&bt_accessor, addr_buff, max_depth);

// At this point depth = 0xFFFFFFFF.

For additional context, I am compiling with gcc O2 flag. Can you point me in the right direction? Am I missing something
?
Re: QNX 7.0 Backtrace bt_get_backtrace returns -1  
sorry, small correction. returned value from bt_get_backtrace(...) is actually -1, which i was type-casting to unsigned 
(size_t)
Re: QNX 7.0 Backtrace bt_get_backtrace returns -1  
What CPU architecture?
Re: QNX 7.0 Backtrace bt_get_backtrace returns -1  
Hey Stephen, it's a 64-bit Arm Cortex A53
Re: QNX 7.0 Backtrace bt_get_backtrace returns -1  
Unfortunately the implementation of backtrace for that architecture consists of a single line setting errno to ENOTSUP.

Until either an implementation is provided or a port of an alternative library like libunwind is made available, 64-bit 
ARM backtraces on QNX can only be done using gdb, either remotely or on a core file.
Re: QNX 7.0 Backtrace bt_get_backtrace returns -1  
Hey Stephen thanks so much for confirming! I found this article: https://lists.nongnu.org/archive/html/libunwind-devel/
2013-04/msg00006.html

Seems like some people are trying to get libunwind ported to QNX as well. I'll follow through and see if I can use any 
of it on my project. Thank you again for your replies!

Alex 
Re: QNX 7.0 Backtrace bt_get_backtrace returns -1  
Upstream libunwind development has moved to https://github.com/libunwind/libunwind if you're looking for something newer
 than 2013.
Re: QNX 7.0 Backtrace bt_get_backtrace returns -1  
this is excellent. thank you for sharing the link!