Questions tagged [backtrace]

A backtrace is the series of currently active function calls for the program.

On linux and mac, it is possible to obtain the backtrace using the backtrace() function.

417 questions
7
votes
3 answers

Backtrace from SQL query to application code?

Is there a way to find which line of code generated a MySQL statement in a Rails development log? In order to do some performance optimization, I would like to find which part of my app is creating which MySQL queries. When I take a look at my log,…
7
votes
2 answers

How to interpret backtrace addresses for debugging with GDB

I am using backtrace() and backtrace_symbols() to output backtrace on SIGSEGV and other signals in format like this: 0: [0xb750818] 1: /opt/server/libQtScript.so.4(+0x6f42a) [0xb782c42a] 2: /opt/server/libQtScript.so.4(+0x7bffc) [0xb7838ffc] 3:…
Vincas Dargis
  • 535
  • 5
  • 14
6
votes
2 answers

How to "decrypt" linker method names?

I'm using backtrace to print application's stack trace and I'm getting something like libQtCore.so.4(_ZN11QMetaObject8activateEP7QObjectPKS_iPPv+0x843) [0x7f889d20cf33] libQtGui.so.4(_ZN7QAction9triggeredEb+0x32)…
Arenim
  • 4,097
  • 3
  • 21
  • 31
6
votes
1 answer

Transform backtrace to string during catch_unwind

I am writing a cross-platform (Linux/iOS/Android) library in Rust. In case my library panics I want the application to continue working as normal and not crash. In order to do that, I am using catch_unwind; its result contains panic information and…
6
votes
2 answers

Getting the caller's Return Address

I am trying to figure out how to grab the return address of a caller in MSVC. I can use _ReturnAddress() to get the return address of my function, but I can't seem to find a way to get the caller's. I've tried using CaptureStackBackTrace, but for…
6
votes
3 answers

How ro resolve cpp symbols from backtrace_symbols() in the offset during runtime for addr2line

To catch fatal errors like Segmentation Fault during runtime I write a custom SignalHandler that will print a stack trace to console and into a log file. To achieve this I use (as hundreds before me) the backtrace() and backtrace_symbols() functions…
J.Panek
  • 425
  • 5
  • 16
6
votes
3 answers

backtrace by SIGSEGV

I'm debugging an application write in ansi C, a multiple threads program. Sometime, in the main thread cause a SIGSEGV fault. (gdb) backtrace full #0 0x0000000000000000 in ?? () No symbol table info available. #1 0x0000000000000000 in ?? () No…
secmask
  • 7,649
  • 5
  • 35
  • 52
6
votes
5 answers

No more gdb in XCode console when build for iPhone simulator

Usually I use gdb backtrace to debug my application, but recently I can no longer do it when testing on iPhone simulator. The blue gdb word stops being displayed on console, and nothing happens when I type "bt" or "backtrace". I can still build and…
iamj4de
  • 780
  • 1
  • 6
  • 18
6
votes
1 answer

Getting the current stack trace on Mac OS X

I'm trying to work out how to store and then print the current stack in my C++ apps on Mac OS X. The main problem seems to be getting dladdr to return the right symbol when given an address inside the main executable. I suspect that the issue is…
user33847
  • 163
  • 1
  • 3
  • 8
6
votes
2 answers

0xfbad8001 Magic Number in backtrace

I am looking at the following backtrace of a program I am debugging in GDB: Thread 7 (Thread 3983): #0 0xf7737430 in __kernel_vsyscall () #1 0x41b85412 in __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S:142 #2 …
Digital Trauma
  • 15,475
  • 3
  • 51
  • 83
6
votes
2 answers

Analyze backtrace of a crash occurring due to a faulty library

In my application I have setup signal handler to catch Segfaults, and print bactraces. My application loads some plugins libraries, when process starts. If my application crashes with a segfault, due to an error in the main executable binary, I can…
mdk
  • 6,225
  • 1
  • 25
  • 30
5
votes
1 answer

How to show line numbers in D backtraces?

I have the following sample code in D: import std.stdio; int g(int i) { auto l = [1, 2, 3, 4]; return l[i]; } void f(int i) { writeln(g(i)); } void main(string[] args) { f(1); f(10); f(2); } I compiled this code with DMD…
gyim
  • 8,803
  • 2
  • 19
  • 21
5
votes
2 answers

Why does PHPUnit hide my xdebug backtrace?

I have PHPUnit and xdebug installed, and in my php.ini files for CLI I've got: display_errors = On xdebug.default_enable = 1 I've verified that an xdebug backtrace is printed when I create an error using the interactive console, but when an error…
Ian Phillips
  • 2,027
  • 1
  • 19
  • 31
5
votes
2 answers

GDB cannot show the stack and shows "#1 0x0000000000000000 in ?? ()"

I have a multi-threaded C++ program that deadlocks in some rare cases. The problem is hard to reproduce and I can only reproduce it in a remote machine. The method I want to use for solving this problem is run the program wait for deadlock send…
Shayan Pooya
  • 1,049
  • 1
  • 13
  • 22
5
votes
2 answers

what makes backtrace() crash(SIGSEGV ) on Linux 64 bit

I am developeing an application on linux where i wanted to have backtrace of all running threads at a particular frequency. so my user defined signal handler SIGUSR1 (for all threads) calls backtrace(). i am getting crash(SIGSEGV) in my signal…
sandeep
  • 513
  • 9
  • 17