FAQ Database Discussion Community


Preserve Java stack trace across threads

java,multithreading,logging,stack-trace
I am using ExecutorService to send mails asynchronously, so there is a class: class Mailer implements Runnable { ... That handles the sending. Any exception that gets caught is logged, for (anonymized) example: javax.mail.internet.AddressException: foo is bar at javax.mail.internet.InternetAddress.checkAddress(InternetAddress.java:1213) ~[mail.jar:1.4.5] at javax.mail.internet.InternetAddress.parse(InternetAddress.java:1091) ~[mail.jar:1.4.5] at javax.mail.internet.InternetAddress.parse(InternetAddress.java:633) ~[mail.jar:1.4.5] at...

Examining local variables returned function

c,gdb,stack-trace
I have a coredump of a process that has crashed (hard to reproduce). I have figured out that something goes wrong in a function that has just returned (it returned a NULL pointer rather than a non-NULL pointer). It would be of great help for me to know the contents...

Why does main function differ from other function from stack point of view

c,assembly,operating-system,stack-trace
I'm studying to use gdb and i got little confused. Here is my code: #include <stdio.h> #include <stdlib.h> #include <string.h> void g(char *password) { } int main(int argc, char *argv[]) { if(argc > 1) { g(argv[1]); } } So with the regular function (g() in this example) if I want...

How do I find the line of my code causing an error when the stacktrace only shows native methods in eclipse

java,android,eclipse,debugging,stack-trace
The short question is when using eclipse, how can I find out what line of my code triggered the error in cases where the stacktrace and debugger call stack don't reveal anything other than Android native methods. I have been trying for a while to debug a program and have...

How to get a correctly-chained stack trace for exceptions thrown when handling other exceptions?

java,exception-handling,stack-trace
Suppose I am handling FooException and BarException occurs. Let's assume they are both unchecked exceptions. What I want to see in the stacktrace is: com.bar.BarException: Bar Message at com.baz.BazCode(BazCode.java:123) ... Caused by: com.foo.FooException: Foo Message at com.baz.BazCode(BazCode.java:321) .... Caused by: ... However, by default, all record of FooException will be...

How do I access variables in a higher stack frame in perl?

perl,stack-trace
How can I do something like this in Perl? E.g. access $a in a function that it isn't defined in? I don't want to use globals, and also don't want to use a CPAN module or pass $a as a parameter to bar. sub foo { my $a; bar(); }...

How to print the first line from a traceback stack

python,exception,stack-trace,traceback
Suppose I am given the following traceback: Traceback (most recent call last): File "<wingdb_compile>", line 3, in <module> File "C:\Python34\lib\ftplib.py", line 419, in login resp = self.sendcmd('PASS ' + passwd) File "C:\Python34\lib\ftplib.py", line 272, in sendcmd return self.getresp() File "C:\Python34\lib\ftplib.py", line 245, in getresp raise error_perm(resp) ftplib.error_perm: 530 Login incorrect....

Activate Stacks only for some specific ETW Tasks in a provider?

windows-8.1,stack-trace,etw,wpr
Since Windows 7 it is possible to activate callstacks for usermode events. This works fine, but sometimes activating stacks for all tasks/Events in a provider is not needed and it would be nice to only activate stacks for some specific Tasks. Is this possible?

Dumping a stack trace from C++ (Windows) - fails to find symbols

c++,windows,stack-trace
I'm a developer of Windows desktop software, and from time to time our app crashes. In rare cases I'd like to get a customer to run a debug version of the app to send me a stack trace so I know where it crashed. I followed the instructions in here:...

Javascript V8 composite Error stack format

javascript,error-handling,stack-trace
I working on a framework. I want to define a CompositeError class which means that it can contain other related errors... var err1 = new Error("msg1"); var err2 = new TypeError("msg2"); var err3 = new Error("msg3"); var err = new CompositeError({ errors: [err1, err2, err3] }); Now by v8 I...

Jasmine2 Stacktrace

jasmine,protractor,stack-trace,jasmine2.0
When we run our Protractor tests with the jasmine2 framework we get rather useless stack traces such as the following. These are sporadic and never in the same place twice. I can re-run the tests and it'll work just fine. What exact causes this type of error and how can...

Why is the catch statement being ignored here?

java,try-catch,stack-trace
This is practice code from a book and i'm learning about try/catch statements. The first method shown calls for the load method an retrieves two images. The error in this code is that the name of the first img in the resources file is called "welcome.png" but as you can...

Java monitoring tool which will allow to see the stacktrace at “real time”

java,monitoring,stack-trace,visualvm,thread-dump
I work on very large web project which is written in java. when I click some button or do other actions it is hard to me to understand what methods called in application code(because I am new in project and application is really really big). So I would like to...

Java - how to get the stack trace from before a Runnable?

java,multithreading,stack-trace,runnable
I had a close look at the SO "questions that may already have your answer" here and surprised not to find what I'm asking for... When an exception occurs in (for example) the EDT, or you just want to examine the stack for whatever reason, it's trivial to find the...

Log stack trace for python warning

python,logging,warnings,stack-trace
A package that I'm using in my python program is throwing a warning that I'd like to understand the exact cause of. I've set logging.captureWarning(True) and am capturing the warning in my logging, but still have no idea where it is coming from. How do I also log the stack...

Get actual class from stack trace element

java,debugging,reflection,stack-trace
Using Eclipse I can set a breakpoint and see current stack trace on debug view: But when I inspect stack trace using Thread.currentThread().getStackTrace(), the information I get is not exactly the same. For example, selected element is JUnitTestClassReference and the correlated one in stack trace (within dashes) is JUnit4TestReference (its...

Group Java/Android stack traces into unique buckets

java,android,stack-trace,acra
When logging stack traces for unhandled exceptions in Java or Android (e.g. via ACRA), you usually get the stack trace as a plain long string. Now all services that offer crash reporting and analysis (e.g. Google Play Developer Console, Crashlytics) group those stack traces into unique buckets. This is obviously...

Lua stack on iOS device only has ?, and not class names or line numbers

ios,lua,corona,stack-trace,testflight
I'm debugging an app made in Corona on an iOS device. We've passed our app out for testing via test flight around the office, and given our testers a little xCode tutorial, so they can give us the device log when a bug happens. But now, when they send us...

Java call stack inspection and manipulation

java,jvm,stack-trace
My question is: is it possible (in ANY way) to analyze and modify call stack (both content of frames and stack content) in runtime? I'm looking for any possibility - low-level, unsafe or internal API, possibility to write C extension, etc. Only constraint: it should be usable in standard runtime,...