HP (Hewlett-Packard) 5992-1918 TV Antenna User Manual


 
where <string> is a single command or a list of commands each separated by a semicolon.
Within <string> all occurrences of “%p” are replaced with the current process id (pid), and
all occurrences of “%%” are replaced by a single “%”.
Following is an example showing how the fatal error report can be mailed to a support alias
when a fatal error is encountered:
java -XX:OnError=cat hs_err_pid%p.log|mail support@acme.com MyApplication
Following is an example that launches gdb when an unexpected error is encountered. Once
launched, gdb attaches to the Java VM process:
java -XX:OnError=gdb - %p MyApplication
1.29 -XX:+ShowMessageBoxOnError
In addition to the-XX:OnError option, the Java VM can also be provided with the
option-XX:+ShowMessageBoxOnError . When this option is set and a fatal error is encountered,
the Java VM outputs information about the fatal error and ask the user if the debugger should
be launched. The output and prompt are sent to the application console (standard input and
standard output). Following is an example:
==============================================================================
Unexpected Error ------------------------------------------------------------------------------
SIGSEGV (0xb) at pc=0x2000000001164db1, pid=10791, tid=1026
Do you want to debug the problem?
To debug, run 'gdb /proc/10791/exe 10791'; then switch to thread 1026
Enter 'yes' to launch gdb automatically (PATH must include gdb)
Otherwise, press RETURN to abort...
==============================================================================
In this case, a SIGSEGV has occurred and the user is prompted whether to launch the debugger
to attach to the process. If the user enters “y” or “yes” then gdb is launched.
In the previous example, the output includes the process id (10791) and also the thread id (1026).
If the debugger is launched then one of the initial steps taken in the debugger should be to select
the thread and obtain its stack trace.
While waiting for a response from the process, it is possible to use other tools to obtain a crash
dump or query the state of the process.
Generally, -XX:+ShowMessageBoxOnError option is more useful in a development
environment where debugger tools are available. The -XX:OnError option is more suitable for
production environments where a fixed sequence of commands or scripts are executed when a
fatal error is encountered.
50 Diagnostic and Monitoring Tools and Options