Questions tagged [stack-trace]

A report of the active stack frames at a certain point in time during the execution of a program.

A stack trace is a report of the active stack frames at a certain point in time during the execution of a program and is often referred to as a stack backtrace.

A stack trace is commonly used during interactive and post-mortem debugging. It typically lists all the functions awaiting return values on the stack at the time of the error. By examining what is on the stack and comparing it to what you expect, you can often determine how the error occurred. By inspecting the function containing the error, you may be able to edit and correct the problem.

A stack trace allows to track the sequence of nested functions called up to the point where the stack trace is generated. In a post-mortem scenario this is up to function where the failure occurred (but not necessarily is caused there). Sibling function calls are not visible in a stack trace.

Before you start

Please browse the list of frequently asked questions to see if your question is similar to one that has already been answered.

The tag should be used to mark questions related to generating, interpreting, debugging, or otherwise understanding stack traces.

2320 questions
37
votes
4 answers

Oracle PL/SQL: how to get the stack trace, package name and procedure name

Sometimes the exception returns something like: "ORA-06502: PL/SQL: numeric or value error: character string buffer too small". It's not so readable since it doesn't report neither the table, the column and the value it tried to write. it would be…
Revious
  • 7,816
  • 31
  • 98
  • 147
37
votes
3 answers

How to read objective-c stack traces

i have the following stack trace: 0 MyApp 0x000833a3 +[TFCrashHandler backtrace] + 26 1 MyApp 0x000836bd TFSignalHandler + 28 2 libsystem_c.dylib 0x33eac727 _sigtramp + 34 3 ??? 0x00000002 0x0 + 2 4 MyApp 0x000803f1 msgpack_unpack_next + 112 5 MyApp…
Chris
  • 39,719
  • 45
  • 189
  • 235
37
votes
1 answer

Java only get Exception name without StackTrace

how can I get the exception name without getting the stack trace? I am using exception.toString() to convert the thrown exception into a string, but I only want the exception name likeNullPointerException and not the entire stack trace. How can I…
Broadwell
  • 1,343
  • 2
  • 19
  • 33
37
votes
2 answers

How can I get the stack trace for a JavaScript exception in IE 8?

When a JavaScript exception is thrown in IE 8, how can I see its stack trace? For example, the following code from jQuery catches an exception and rethrows it. Debugging in Visual Studio (2012), execution breaks as the exception ('e') is caught by…
aknuds1
  • 65,625
  • 67
  • 195
  • 317
37
votes
8 answers

StackTrace in Flash / ActionScript 3.0

I want to see the stack trace in any function of my code, so i made somthing like this to call it and print the stack trace: public function PrintStackTrace() { try { throw new Error('StackTrace'); } catch (e:Error) { …
Lucas Gabriel Sánchez
  • 40,116
  • 20
  • 56
  • 83
35
votes
6 answers

Cleaning noise out of Java stack traces

My Java stack traces have a lot of entries that I don't care about, showing method invocation going through proxies and Spring reflection methods and stuff like that. It can make it pretty hard to pick out the part of the stack trace that's actually…
bhollis
  • 4,624
  • 2
  • 28
  • 32
35
votes
3 answers

How to print stack trace with reference to typescript source in Nest.js

I am developing a Nest.js server and would like to be able to print useful stack trace in console (e.g. console.log). By default, it returns a reference to the line number in the compiled sources (.js). This is not useful for debugging as it's…
Alex Predescu
  • 792
  • 2
  • 7
  • 24
35
votes
2 answers

How can I jump to a frame in a stack trace according to the function name in gdb?

I'm debugging a stack overflow due to infinite recursion. The program fails when the stack is 700 calls deep. I want to jump to the frame in which the function was initially called. However, gdb shows me the stack trace from the top of the stack…
Nathan Fellman
  • 122,701
  • 101
  • 260
  • 319
35
votes
5 answers

How can I invoke buffer overflow?

I got a homework assignment asking me to invoke a function without explicitly calling it, using buffer overflow. The code is basically this: #include #include void g() { printf("now inside g()!\n"); } void f() { …
sa125
  • 28,121
  • 38
  • 111
  • 153
33
votes
3 answers

c++ stack trace from unhandled exception?

This question has been asked before and there have been windows-specific answers but no satisfactory gcc answer. I can use set_terminate() to set a function that will be called (in place of terminate()) when an unhandled exception is thrown. I know…
c-urchin
  • 4,344
  • 6
  • 28
  • 30
33
votes
6 answers

How to get non-current thread's stacktrace?

It is possible to get stacktrace using System.Diagnostics.StackTrace, but thread has to be suspended. Suspend and Resume function are obsolete, so I expect that better way exists.
bh213
  • 6,343
  • 9
  • 43
  • 52
33
votes
5 answers

How to specify a "caused by" in a JavaScript Error?

In my NodeJS program, I parse some user JSON file. So I use : this.config = JSON.parse(fs.readFileSync(path)); The problem is that if the json file is not correctly formated, the error thrown is like: undefined:55 }, …
Anthony O.
  • 22,041
  • 18
  • 107
  • 163
33
votes
2 answers

Stop displaying entire stack trace in WebAPI

When an unexpected error occurs in WebAPI the user sees the entire stack trace. I believe that showing the entire stack trace is not safe. What is the default behaviour to stop showing the entire trace to my users? Just a friendly message like…
33
votes
3 answers

Meaningful stack traces for address sanitizer in GCC

I just tried compiling with GCC and the -fsanitize=address flag. When I run my program, the address sanitizer finds a flaw, but the stack trace is not helpful. How can I configure this so that it points to the source code locations I need to look…
clstaudt
  • 21,436
  • 45
  • 156
  • 239
32
votes
2 answers

How to log js stack trace with console.trace() but keep it collapsed

I wanted to log the stack trace for certain function calls in my app. I like the way console.trace() present the data, but it always spits it out to console expanded. if you have dozens of logs this gets messy very quickly. Some people…
user1768699
  • 1,041
  • 9
  • 8