Please excuse the formating, I'm cutting and pasting into this silly little web page.
You can reach me at gallatin@FreeBSD.ORG
Environment: Redhat 7.0, running the distribution's binary kernel and strace 4.2
Eg:
> uname -a
Linux frenchtoast 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown
> strace -V
strace -- version 4.2
It also interferes with execution. Eg, run IBM's jdk 1.3.
Without strace:
> bin/java
Usage: java [-options] class [args...]
(to execute a class)
or java -jar [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath <directories and zip/jar files separated by :>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-showversion print product version and continue
-? -help print this help message
-X print help on non-standard options
With strace:
> strace -o /tmp/foo -ff -F bin/java
Process 6898 attached
Process 6898 detached
Process 6899 attached
Process 6899 detached
Process 6900 attached
Process 6900 detached
Process 6901 attached
Process 6901 detached
Process 6902 attached
Process 6897 suspended
Process 6897 resumed
Process 6902 detached
Process 6903 attached
Process 6903 detached
Process 6904 attached
Process 6904 detached
Process 6905 attached
Process 6905 detached
Process 6906 attached
Usage: java [-options] class [args...]
(to execute a class)
or java -jar [-options] jarfile [args...]
(to execute a jar file)
where options include:
-cp -classpath <directories and zip/jar files separated by :>
set search path for application classes and resources
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-showversion print product version and continue
-? -help print this help message
-X print help on non-standard options
Process 6897 suspended
<hang, keyboard unresponsive>
On another tty, I see:
ps axl | egrep 'strace|java'
000 1387 6896 826 4 0 1616 712 wait4 S pts/0 0:00 strace -o /
044 1387 6906 6897 5 0 0 0 do_exi Z pts/0 0:00 [java <defu
Killing strace gets me back my tty.
>
tail /tmp/foo
rt_sigprocmask(SIG_SETMASK, [USR1 RT_0], NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [USR1 RT_0], 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [USR1 RT_0], 8) = 0
write(7,"@\372\2@\2\0\0\0\0\0\0\0\210\340\4\10\314\36\5@\260w\1"..., 148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [USR1 RT_0], 8) = 0
rt_sigsuspend([USR1] <unfinished ...>
--- SIGRT_0 (Real-time signal 0) ---
<... rt_sigsuspend resumed> ) = -1 EINTR (Interrupted system call)
sigreturn() = ? (mask now [USR1])
wait4(6906,
clone syscall tracing was added in strace 4.3.