stack-trace

Stacktrace for C on Android

让人想犯罪 __ 提交于 2019-12-09 19:00:56
问题 I have C code in my Android app and would like to catch crashes and print them to a log file. I saw this post, and tried, but I can't find the execinfo lib. I'm working with Ubuntu 11.10 and using NDK for compiling to Android. Does anyone know how to find execinfo lib for NDK/ARM, or have another simple solution? 回答1: On Android, you have some sample specials utils code allowing to see and/or dump the stack. Implementation is in base/libs/utils/CallStack.cpp. You'll a find a tiny sample code

How can I tell who calls System.gc()?

荒凉一梦 提交于 2019-12-09 17:29:54
问题 In a running system, we see lots of "Full GC (System)" which indicates someone triggers System.gc(). Is there a way to find out where in the code this happens? I did search all the available source but found nothing suspicious so it must be somewhere, probably another app that's running in the same container or the container itself. 回答1: You can change the Runtime class to log where gc() is being called to a file (System.gc() calls Runtime.gc()) To do this, edit a copy, compile it and add it

How to change Play Framework 2 “test” settings to show complete stacktraces?

梦想与她 提交于 2019-12-09 17:14:13
问题 I am using Java in Play framework and I have some tests (functional tests) that are passed when I run them through my IDE (IntelliJ) but failed when I run the tests through console. My problems is that the stack traces that are shown in the test logs are only 2 lines and I need the complete stack trace to see what is going on in there, I have tried any combination of settings mentioned here: spec2 settings both through putting them in build.sbt or providing them in the command line. It seems

How do you programmatically obtain a stack trace of a child process from its parent?

佐手、 提交于 2019-12-09 13:28:23
问题 Let's say that I fork a child process within my program. At some point, I pause the child process with kill(child, SIGSTOP) and want to inspect the stack's contents. Is there a way to programmatically obtain a stack trace of a child process from its parent? I know that ptrace is the standard way of tracing a child process and examining its memory/registers. I also know that backtrace provides this functionality for the calling thread. Is there a function or library that merges these

Stack trace method names redacted

孤者浪人 提交于 2019-12-09 08:41:12
问题 I have users email me stack traces when my app crashes on their device. Prior to iOS 6 they looked like this: CRASH: NSInvalidArgumentException (*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil) TRACE: ( 0 CoreFoundation 0x355e58a7 __exceptionPreprocess + 186 1 libobjc.A.dylib 0x3798c259 objc_exception_throw + 32 2 CoreFoundation 0x3553a1d7 -[__NSArrayM insertObject:atIndex:] + 186 3 MYAPP 0x0006c0f7 MYAPP + 188663 4 MYAPP 0x000652a3 MYAPP + 160419 5 Foundation 0x3512ac29 __65-

Forging a stack trace in Java

梦想与她 提交于 2019-12-09 05:59:35
问题 When you use RMI in Java the remote stack trace of an exception will be prepended when you receive it, somewhat like this: ERROR Client received error when doing stuff: myapp.FooBarException: bla at server.myMethod() at rmi.callHandler() // and now, on the next line comes the client at rmi.sendCall(); at client.doServerMethod() at Thread.run() How is that kind of stacktrace "forgery" done? What do I want it for (apart from just being iterested)? Well, it would help me if I could do this:

iOS - Symbolicate Stack trace symbols

℡╲_俬逩灬. 提交于 2019-12-09 02:18:34
I want to symbolicate the stack trace symbols logged using [NSThread callStackSymbols] to identify the full stack backtrace calls. But, this doesn't give symbolicated trace. 0 TestApp 0x0029616f TestApp + 1823087 1 TestApp 0x003ef18d TestApp + 3236237 2 UIKit 0x2ab7bb1f <redacted> + 438 3 UIKit 0x2ac0bea3 <redacted> + 306 4 UIKit 0x2ab7bb1f <redacted> + 438 5 CoreFoundation 0x2757546d <redacted> + 48 6 CoreFoundation 0x2756e4c3 <redacted> + 234 7 UIKit 0x2ab7bc9b <redacted> + 818 8 UIKit 0x2ae32799 <redacted> + 584 9 UIKit 0x2abdfbd9 <redacted> + 308 10 UIKit 0x2ab5bdd7 <redacted> + 458 11

Why doesn't stack walking work properly when using SetUnhandledExceptionFilter?

时光毁灭记忆、已成空白 提交于 2019-12-09 01:57:22
问题 I am using the following code to walk the stack on an exception ( note: you must run it in release in order to properly receive the desired output of the stack trace to the console, not in debug mode or else it will only show a popup): #include "stdafx.h" #include <process.h> #include <iostream> #include <Windows.h> #include "dbghelp.h" using namespace std; #define TRACE_MAX_FUNCTION_NAME_LENGTH 1024 #define TRACE_LOG_ERRORS FALSE #define TRACE_DUMP_NAME L"Exception.dmp" void function2() {

Log4j JDBCAppender to log stacktraces

允我心安 提交于 2019-12-09 01:28:35
问题 Using org.apache.log4j.jdbc.JDBCAppender , how can I get stracktraces logged with warn and error into the PatternLayout . I'm logging like logger.warn("warning description", e); logger.error("error description", e); I get the String descriptions into the table, but the Throwable's stacktrace is now where. Is there another parameter that I can access via the PatternLayout . Currently I am using "INSERT INTO app_logs (app, log_date, log_level, location, loc, message) VALUES ('my-apps-name', '%d

Warnings from caller's perspective (aka Python-equivalent of Perl's carp)?

痞子三分冷 提交于 2019-12-08 18:39:44
问题 Short version: Is there way to achieve in Python the same effect achieved by Perl's Carp::carp utility? Long version (for those unfamiliar with Carp::carp ): Suppose we are implementing some library API function (i.e., it is meant to be used by other programmers in their code), say spam , and suppose that spam includes some code to check the validity of the arguments passed to it. Of course, this code is supposed to raise an exception if any problem with these arguments is detected. Let's say