backtrace

Alternative to backtrace() on Linux that can find symbols for static functions

血红的双手。 提交于 2019-11-30 04:46:57
问题 In the man page, the backtrace() function on Linux says: Note that names of "static" functions are not exposed, and won't be available in the backtrace. However, with debugging symbols enabled ( -g ), programs like addr2line and gdb can still get the names of static functions. Is there a way to get the names of static functions programmatically from within the process itself? 回答1: If your executable (and linked libraries) are compiled with debugging information (i.e. with -g flag to gcc or g+

What is the meaning of question marks '?' in Linux kernel panic call traces?

孤街醉人 提交于 2019-11-29 22:51:51
The Call Trace contains entries like that: [<deadbeef>] FunctionName+0xAB/0xCD [module_name] [<f00fface>] ? AnotherFunctionName+0x12/0x40 [module_name] [<deaffeed>] ClearFunctionName+0x88/0x88 [module_name] What is the meaning of the '?' mark before AnotherFunctionName? Eugene '?' means that the information about this stack entry is probably not reliable. The stack output mechanism (see the implementation of dump_trace() function ) was unable to prove that the address it has found is a valid return address in the call stack. '?' itself is output by printk_stack_address() . The stack entry may

Backtrace from SQL query to application code?

无人久伴 提交于 2019-11-29 20:47:24
问题 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, I see hundres of queries flashing around on each web request I do, and I need to find out where they come from. I'm thinking about adding some variables like ____FILE____ and ____LINE____ to the log output. Is that possible? 回答1: https://github.com

How do I shorten the backtrace for a test failure in RSpec 2?

混江龙づ霸主 提交于 2019-11-29 16:44:54
问题 When my specs hit an error, I get a message like this: Vendor should reject duplicate names Failure/Error: user_with_duplicate_email.should_not be_valid expected valid? to return false, got true # /home/kevin/.rvm/gems/ruby-1.9.2-p136@rails3tutorial/gems/rspec-expectations-2.3.0/lib/rspec/expectations/fail_with.rb:29:in `fail_with' # /home/kevin/.rvm/gems/ruby-1.9.2-p136@rails3tutorial/gems/rspec-expectations-2.3.0/lib/rspec/expectations/handler.rb:44:in `handle_matcher' # /home/kevin/.rvm

gdb weird backtrace

前提是你 提交于 2019-11-29 12:54:08
问题 My program is statically compiled with dietlibc. It is compiled on ubuntu x64 (compiled for x86 using the -m32 flag) and is run on a centos x86. The compiled size is only about 100KB. I compile it with -ggdb3 and no optimization flags. My program uses signal.h to handle a SIGSEGV signal and then calls abort(). The program runs without problems for days but sometimes segfaults. This is when I get weird backtraces that I do not understand: username@ubuntu:~/Desktop$ gdb -c core.28569 program

set rails console stack backtrace limit permanently

痞子三分冷 提交于 2019-11-29 11:17:11
rails console by default boots with context.back_trace_limit=16 , which can be changed to whatever you want simply by typing context.back_trace_limit=n . The problem is you have to type it each time you boot rails c . Where do I change the context.back_trace_limit permanently? Some more reading on rails console configuration appreciated. Fer You have to create/edit your ~/.irbrc with the following: IRB.conf[:BACK_TRACE_LIMIT]= 20 To be taken into account: The options must be uppercased This option is changing not only the rails console, but the normal "irb" behavior (the rails console uses irb

Any porting available of backtrace for uclibc?

情到浓时终转凉″ 提交于 2019-11-29 02:02:19
We are running the uclibc linux on ARM 9. The problem is uclibc doesn't support backtrace. When a core dump happens, I cannot grab the call stack. Does anyone have a good solution for that? For example, an existing porting of backtrace for uclibc, or any good method to grab the call stack when a core dump happens (uclibc+ARM+Linux)? Update: It seems that a patch was created to support backtrace() on uclibc for x86 and ARM (XScale) and it makes use of the __libc_stack_end symbol. Original Answer: I worked on a project where the version of glibc we were using did not provide a functional

How to include C backtrace in a kernel module code?

柔情痞子 提交于 2019-11-28 19:16:49
So I am trying to find out what kernel processes are calling some functions in a block driver. I thought including backtrace() in the C library would make it easy. But I am having trouble to load the backtrace. I copied this example function to show the backtrace: http://www.linuxjournal.com/files/linuxjournal.com/linuxjournal/articles/063/6391/6391l1.html All attempts to compile have error in one place or another that a file cannot be found or that the functions are not defined. Here is what comes closest. In the Makefile I put the compiler directives: -rdynamic -I/usr/include If I leave out

How do I get the backtrace for all the threads in GDB?

笑着哭i 提交于 2019-11-28 15:41:02
Is there an equivalent command in GDB to that of WinDbg's "!process 0 7"? I want to extract all the threads in a dump file along with their backtraces in GDB. "info threads" doesn't output the stack traces. So, is there a command that does? Sharad Generally, the backtrace is used to get the stack of the current thread, but if there is a necessity to get the stack trace of all the threads, use the following command. thread apply all bt Employed Russian Is there a command that does? thread apply all where 来源: https://stackoverflow.com/questions/18391808/how-do-i-get-the-backtrace-for-all-the

Why does PHPUnit hide my xdebug backtrace?

為{幸葍}努か 提交于 2019-11-28 11:41:23
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 occurs while running phpunit, there is no backtrace? What is happening to the backtrace? Is phpunit hiding it from me? Is there some setting I'm missing? Thanks! What is happening to the backtrace? Is phpunit hiding it from me? Yes, PHPUnit disables xdebug, at least these traces (by calling xdebug_disable() Docs ). Is there some setting I'm missing?