Kbase 19849: How to produce a readable stack trace on Linux.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  02/04/2008 |
|
Status: Verified
GOAL:
How can I force a core on Linux?
GOAL:
How do I allow for the creation of a core file?
GOAL:
How to produce a readable stack trace on Linux?
GOAL:
How to debug a Linux core file?
FACT(s) (Environment):
Linux
FIX:
Although the log file states that a core file has been generated, this is not true due to the permissions of the Progress executables. Therefore, it is unlikely that a core file will be found on the system. Moreover, a protrace.<pid> file will be created that contains the following information:
PROGRESS stack trace as of Mon Jun 5 11:05:41 2000
Command line arguments are /usr1/v91A05/dlc/bin/_progres sports
Automatic Stack Trace Functionality not supported
In order to obtain a readable stack trace, a reproducible case against a progress executable with permissions to generate a core file is necessary. The reproducible case is necessary because the permissions on the executable must be changed. To change permissions, follow these steps:
1. Make sure that the ulimit for core files (ulimit -c) is not set to 0. The safest is to set it to a value equal to the amount of RAM on the system, or unlimited. Please keep in mind that ulimit is expressed in half-Kb units, therefore for a 256Mb system, ulimit should be set to:
ulimit -c 524288
ulimit -c should be added to the /etc/profile in order to make sure that it will be set appropriately each time a user logs in.
2. Determine which executable is creating the core (_progres, _mprosrv, _proapsv, etc.). The protrace file contains this information. In this case, protrace indicates that the core was created on the _progres executable.
3. Copy the executable to a test directory and change the permissions of this file (for example, chmod 0777).
4. Check that you have the "gdb" debugger installed on the system.
5. Test the reproducible case with the modified Progress executable. For example, you use the following syntax:
./_progres sports -1
(when running ps -ef you should find that your User ID is the owner, not root).
At this point, you can reproduce the problem and the core file will be written. Follow these steps:
1. Run the "gdb" debugger against the core to get a readable stack trace, from the command line:
gdb -c core _progres
This should show the copyright information and numerous lines like the following:
stating: Reading symbols from ...
At this point you are in the debugger. The command prompt should be:
( gdb )
2. Type either bt or backtrace to get the readable stack trace.
For example:
(gdb) backtrace
#0 0x400cb111 in __kill () from /lib/libc.so.6
#1 0x8329a6b in utcore_dbe ()
#2 0x8329b58 in utcore ()
#3 0x80610a2 in drexit ()BR> #4 0x8061901 in drSigFatal ()
#5 <signal handler called>
#6 0x81260ae in wvDrawStatus ()
#7 0x811ab29 in wvUnixReadKey ()
#8 0x811a066 in wvGetEvent ()
#9 0x8119b47 in wvRunDispatcher ()
#10 0x82ae608 in iodispatch ()
#11 0x807180e in rnrq ()
#12 0x805c349 in main ()
.