Consultor Eletrônico



Kbase P6238: How to use dbx to obtain a stack trace when no core is dumped
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/24/2008
Status: Verified

GOAL:

How to use dbx to obtain a stack trace (if no core is dumped)!

GOAL:

How to produce an ascii file from a core file with dbx

GOAL:

How to get a readable trace when adb or sdb fails

FACT(s) (Environment):

UNIX
Progress/OpenEdge Versions

FIX:

This specifically explains how to produce an ascii file, when:
- there is no core file dumped, or
- adb/sdb fails.

When Progress generates the following error messages:
* SYSTEM ERROR: Bus error. (48)
* SYSTEM ERROR: Memory violation. (49)
it means that the UNIX kernel intercepted a system error, and is unable to continue.

If a core file is produced, use adb or adb to obtain a stack trace.

In some cases however, the core file cannot be analyzed by adb / sdb debuggers, or no core file is actually produced. In these cases, other tools can be employed to obtain this information. The commonly used tool is called the dbx module, which is a database abstraction layer (db 'X', where 'X' is a supported database) implemented in C. It may be used on most UNIX platforms.The following provides examples of how to use this tool, using the "tee" utility to store the display information in a file, called "trace.txt"..


Important commands for the dbx tool:

Command Meaning
------- -----------------------------------------------
cont Continue execution
where Gives a stack trace, i.e. all internal function
called to this point in the program
quit Quit dbx tool


To get the PID for the executable, either start the process with "&" to see the pid displayed: .
Example: $DLC/bin/_mpromtf -ws &
Returns : 12345 back as the PID.

or get the PID from the kernel with the "ps -aef" utility:
Example: ps -aef | grep _mprosrv
Returns : 12345 as the PID


To run the dbx tool type:
dbx -a 12345 | tee trace.txt
i.e. use the -a option to attach to a process thru PID, and echo output to the trace.txt file. Continue the process by:
cont
This should give focus back to the process. When the error occurs, the program will return back to the dbx tool. Then type:
where
which will give you the stack trace. Quit the program by:
quit
and print out the "trace.txt" file, which should be sent to Progress Software Technical Support.


For the DG & SUN platforms, the commands are a little bit different:
Startup: dbx | tee trace.txt
Attach: debug <module> <pid>
Process: cont
Trace: where
Stop: quit

Example: Progress executable (/usr/dlc/bin/_promtf) was started with
pid 1234 running in a Motif environment on a DG machine. Type:
dbx | tee trace.txt
debug /usr/dlc/bin/_promtf 1234
cont
Once the error occurs, the process will return back to dbx. Type:
where
cont
until the process is completed. Use quit to stop.
On a Sun platform, you have to type "Ctrl-C" to get back into the dbx tool, but otherwise it works similar.

Again, in case of problems, please refer to dbx documentation on your own system.