- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我遇到的问题与 this SO question 几乎相同除了不同的操作系统和 Java 版本(他的回答似乎是特定于 Solaris 的修复程序,而我使用的是 Linux)。在某些情况下,当我尝试从 Java 中运行进程时,它完全卡在 java.lang.UNIXProcess.forkAndExec
上。
情况
$ uname -a
Linux localhost.localdomain 2.6.33.9-rt31.75.el6rt.x86_64 #1 SMP PREEMPT RT Tue Sep 13 11:24:45 CEST 2011 x86_64 x86_64 x86_64 GNU/Linux
$ java -version
java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)
(我无法使用 Sun 1.6.0_27-b07 JDK 重现此内容。)
我启动的子进程只是带有一些参数的ps
。我在运行它之前打印出我运行的内容,当它挂起后我在 shell 中尝试完全相同的命令时,ps
运行得很好。
当它发生时,它只是偶尔发生(可能是 500 次运行中的一次)。
如果我在启动后立即启动子进程,它不会挂起。如果我在执行其他操作(例如字符串操作、使用 ObjectInputStream/ObjectOutputStream 打开/通信/关闭套接字以及从小文件读取)之后启动子进程,它只会(并且只是偶尔)发生。
由于挂起的频率不高,因此很难准确地缩小它的范围,但我绝对可以在大约 10 分钟内重现它,方法是在 Bash while-true 循环中运行程序直到它挂起。
另外我昨天重启了机器,所以应该与闰秒错误无关。
症状
当它挂起时,堆栈跟踪看起来像这样:
Full thread dump Java HotSpot(TM) 64-Bit Server VM (23.1-b03 mixed mode):
"process reaper" daemon prio=10 tid=0x00007f42904dc000 nid=0x14bf waiting on condition [0x00007f427aa2f000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007c229fbf0> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
"Service Thread" daemon prio=10 tid=0x00007f42900f1000 nid=0x14bc runnable [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread1" daemon prio=10 tid=0x00007f42900ee000 nid=0x14bb waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" daemon prio=10 tid=0x00007f42900eb000 nid=0x14ba waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" daemon prio=10 tid=0x00007f42900e8000 nid=0x14b9 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" daemon prio=10 tid=0x00007f429009b800 nid=0x14b8 in Object.wait() [0x00007f427b8f6000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000007c00057f0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
- locked <0x00000007c00057f0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:177)
"Reference Handler" daemon prio=10 tid=0x00007f4290099000 nid=0x14b7 in Object.wait() [0x00007f427b9f8000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0x00000007c0005370> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:503)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
- locked <0x00000007c0005370> (a java.lang.ref.Reference$Lock)
"main" prio=10 tid=0x00007f4290009000 nid=0x14b1 runnable [0x00007f4299077000]
java.lang.Thread.State: RUNNABLE
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:68)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.run(ProcessBuilderImpl.scala:99)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder$$anonfun$runBuffered$1.apply(ProcessBuilderImpl.scala:147)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder$$anonfun$runBuffered$1.apply(ProcessBuilderImpl.scala:147)
at scala.sys.process.ProcessLogger$$anon$1.buffer(ProcessLogger.scala:64)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.runBuffered(ProcessBuilderImpl.scala:147)
at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang(ProcessBuilderImpl.scala:113)
at mypackage.Main.main(Main.scala)
"VM Thread" prio=10 tid=0x00007f4290091800 nid=0x14b6 runnable
"GC task thread#0 (ParallelGC)" prio=10 tid=0x00007f4290017000 nid=0x14b2 runnable
"GC task thread#1 (ParallelGC)" prio=10 tid=0x00007f4290018800 nid=0x14b3 runnable
"GC task thread#2 (ParallelGC)" prio=10 tid=0x00007f429001a800 nid=0x14b4 runnable
"GC task thread#3 (ParallelGC)" prio=10 tid=0x00007f429001c800 nid=0x14b5 runnable
"VM Periodic Task Thread" prio=10 tid=0x00007f42900f5800 nid=0x14bd waiting on condition
如果我在 pid 挂起后运行 jstack -m
或 jstack -F
,我得到这个(与 -m
相同的输出) > 和 -F
):
$ jstack -m 3199
Attaching to process ID 3199, please wait...
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.tools.jstack.JStack.runJStackTool(JStack.java:118)
at sun.tools.jstack.JStack.main(JStack.java:84)
Caused by: java.lang.RuntimeException: Type "nmethodBucket*", referenced in VMStructs::localHotSpotVMStructs in the remote VM, was not present in the remote VMStructs::localHotSpotVMTypes table (should have been caught in the debug build of that VM). Can not continue.
at sun.jvm.hotspot.HotSpotTypeDataBase.lookupOrFail(HotSpotTypeDataBase.java:362)
at sun.jvm.hotspot.HotSpotTypeDataBase.readVMStructs(HotSpotTypeDataBase.java:253)
at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:87)
at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:568)
at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:494)
at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:332)
at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)
at sun.jvm.hotspot.tools.JStack.main(JStack.java:86)
... 6 more
概要
我相信 java.lang.UNIXProcess.forkAndExec
永远不应该挂起。如果我自己的代码中存在竞争条件,它就会卡在其他地方;如果子进程本身被挂起,我的 Java 进程只会卡在 waitFor
中,而不是在 java.lang.UNIXProcess.forkAndExec
中。对我来说这似乎是一个 JVM 错误,但我只是不确定如何将它精确定位到可重现的测试用例。对下一步做什么有什么建议吗?
编辑
当挂起发生时,我有两个相同的 java 进程显示在顶部。当我 ctrl-c 它时,主要的退出但另一个仍然存在,并且直到我杀死 -9 才死。两个进程都使用 0% CPU。
编辑
当我运行 kill -QUIT
时,子进程什么都不做。
当我在子进程上运行 pstack
时,我得到:
#0 0x0000003c2fa0e054 in __lll_lock_wait () from /lib64/libpthread.so.0
#1 0x0000003c2fa09388 in _L_lock_854 () from /lib64/libpthread.so.0
#2 0x0000003c2fa09257 in pthread_mutex_lock () from /lib64/libpthread.so.0
#3 0x00007fb79c4c8a30 in __oo_rwlock_unlock_write_slow () from /usr/lib64/libonload.so
#4 0x00007fb79c4990be in citp_netif_child_fork_hook () from /usr/lib64/libonload.so
#5 0x0000003c2f2abb76 in fork () from /lib64/libc.so.6
#6 0x00007fb79b0219f6 in startChild () from /usr/java/jdk1.7.0_05/jre/lib/amd64/libjava.so
#7 0x00007fb79b0220eb in Java_java_lang_UNIXProcess_forkAndExec () from /usr/java/jdk1.7.0_05/jre/lib/amd64/libjava.so
#8 0x00007fb791011f90 in ?? ()
#9 0x00007fb700000000 in ?? ()
#10 0x0000000000000000 in ?? ()
当我在父进程上运行 pstack
时,我得到:
Thread 17 (Thread 0x7fb79b544700 (LWP 8437)):
#0 0x0000003c2fa0e54d in read () from /lib64/libpthread.so.0
#1 0x00007fb79c488816 in read () from /usr/lib64/libonload.so
#2 0x00007fb79b022126 in Java_java_lang_UNIXProcess_forkAndExec () from /usr/java/jdk1.7.0_05/jre/lib/amd64/libjava.so
#3 0x00007fb791011f90 in ?? ()
#4 0x00007fb700000000 in ?? ()
#5 0x0000000000000000 in ?? ()
Thread 16 (Thread 0x7fb79ab11700 (LWP 8438)):
#0 0x0000003c2fa0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc811b3 in os::PlatformEvent::park() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc4cfbf in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc4d74e in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79bdfbb2b in GangWorker::loop() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#7 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 15 (Thread 0x7fb79aa10700 (LWP 8439)):
#0 0x0000003c2fa0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc811b3 in os::PlatformEvent::park() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc4cfbf in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc4d74e in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79bdfbb2b in GangWorker::loop() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#7 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 14 (Thread 0x7fb79a90f700 (LWP 8440)):
#0 0x0000003c2fa0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc811b3 in os::PlatformEvent::park() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc4cfbf in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc4d74e in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79bdfbb2b in GangWorker::loop() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#7 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 13 (Thread 0x7fb79a80e700 (LWP 8441)):
#0 0x0000003c2fa0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc811b3 in os::PlatformEvent::park() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc4cfbf in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc4d74e in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79bdfbb2b in GangWorker::loop() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#7 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 12 (Thread 0x7fb798100700 (LWP 8442)):
#0 0x0000003c2fa0b7bb in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc85cd7 in os::PlatformEvent::park(long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc4d26e in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc4d74e in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79b93b498 in ConcurrentMarkSweepThread::run() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#7 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 11 (Thread 0x7fb78e2c9700 (LWP 8443)):
#0 0x0000003c2fa0b7bb in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc85cd7 in os::PlatformEvent::park(long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc4d26e in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc4d74e in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79bded430 in VMThread::loop() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79bded970 in VMThread::run() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#7 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#8 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 10 (Thread 0x7fb78e1c8700 (LWP 8444)):
#0 0x0000003c2fa0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc811b3 in os::PlatformEvent::park() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc76c5c in ObjectMonitor::wait(long, bool, Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79baebc81 in JVM_MonitorWait () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb791011f90 in ?? ()
#5 0x00000007e7802b98 in ?? ()
#6 0x00007fb794123000 in ?? ()
#7 0x00007fb78e1c7160 in ?? ()
#8 0x00007fb78e1c7108 in ?? ()
#9 0x0000000000000000 in ?? ()
Thread 9 (Thread 0x7fb78e0c7700 (LWP 8445)):
#0 0x0000003c2fa0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc811b3 in os::PlatformEvent::park() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc76c5c in ObjectMonitor::wait(long, bool, Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79baebc81 in JVM_MonitorWait () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb791011f90 in ?? ()
#5 0x00007fb78e0c6160 in ?? ()
#6 0x00007fb7910124ea in ?? ()
#7 0x0000000000000000 in ?? ()
Thread 8 (Thread 0x7fb78dfc6700 (LWP 8446)):
#0 0x0000003c2fa0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc811b3 in os::PlatformEvent::park() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc4cfbf in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc4d7c6 in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79b910cfe in SurrogateLockerThread::loop() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79bda52e8 in JavaThread::thread_main_inner() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x00007fb79bda5438 in JavaThread::run() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#7 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#8 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#9 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 7 (Thread 0x7fb78dec5700 (LWP 8447)):
#0 0x0000003c2fa0d720 in sem_wait () from /lib64/libpthread.so.0
#1 0x00007fb79bc858ca in check_pending_signals(bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc7f9f5 in signal_thread_entry(JavaThread*, Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bda52e8 in JavaThread::thread_main_inner() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79bda5438 in JavaThread::run() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#7 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 6 (Thread 0x7fb78ddc4700 (LWP 8448)):
#0 0x0000003c2fa0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc811b3 in os::PlatformEvent::park() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc4cfbf in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc4d7c6 in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79b903458 in CompileQueue::get() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79b90616a in CompileBroker::compiler_thread_loop() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x00007fb79bda52e8 in JavaThread::thread_main_inner() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#7 0x00007fb79bda5438 in JavaThread::run() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#8 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#9 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#10 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 5 (Thread 0x7fb78dcc3700 (LWP 8449)):
#0 0x0000003c2fa0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc811b3 in os::PlatformEvent::park() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc4cfbf in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc4d7c6 in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79b903458 in CompileQueue::get() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79b90616a in CompileBroker::compiler_thread_loop() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x00007fb79bda52e8 in JavaThread::thread_main_inner() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#7 0x00007fb79bda5438 in JavaThread::run() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#8 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#9 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#10 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 4 (Thread 0x7fb78dbc2700 (LWP 8450)):
#0 0x0000003c2fa0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc811b3 in os::PlatformEvent::park() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bc4cfbf in Monitor::IWait(Thread*, long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc4d74e in Monitor::wait(bool, long, bool) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79bd0c9c8 in ServiceThread::service_thread_entry(JavaThread*, Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79bda52e8 in JavaThread::thread_main_inner() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x00007fb79bda5438 in JavaThread::run() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#7 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#8 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#9 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 3 (Thread 0x7fb78dac1700 (LWP 8451)):
#0 0x0000003c2fa0b7bb in pthread_cond_timedwait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
#1 0x00007fb79bc85cd7 in os::PlatformEvent::park(long) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#2 0x00007fb79bda2ae7 in WatcherThread::run() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#5 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 2 (Thread 0x7fb78c11f700 (LWP 8501)):
#0 0x0000003c2fa0e84d in accept () from /lib64/libpthread.so.0
#1 0x00007fb79c489f34 in onload_accept () from /usr/lib64/libonload.so
#2 0x00007fb79b7c5171 in LinuxAttachListener::dequeue() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#3 0x00007fb79b7c530b in AttachListener::dequeue() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#4 0x00007fb79b7c3d5f in attach_listener_thread_entry(JavaThread*, Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#5 0x00007fb79bda52e8 in JavaThread::thread_main_inner() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#6 0x00007fb79bda5438 in JavaThread::run() () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#7 0x00007fb79bc870a0 in java_start(Thread*) () from /usr/java/jdk1.7.0_05/jre/lib/amd64/server/libjvm.so
#8 0x0000003c2fa07851 in start_thread () from /lib64/libpthread.so.0
#9 0x0000003c2f2e76dd in clone () from /lib64/libc.so.6
Thread 1 (Thread 0x7fb79c264da0 (LWP 8413)):
#0 0x0000003c2fa080ad in pthread_join () from /lib64/libpthread.so.0
#1 0x00007fb79c2754d5 in ContinueInNewThread0 () from /usr/java/jdk1.7.0_05/bin/../jre/lib/amd64/jli/libjli.so
#2 0x00007fb79c26a4fa in ContinueInNewThread () from /usr/java/jdk1.7.0_05/bin/../jre/lib/amd64/jli/libjli.so
#3 0x00007fb79c26d085 in JLI_Launch () from /usr/java/jdk1.7.0_05/bin/../jre/lib/amd64/jli/libjli.so
#4 0x00000000004006a6 in main ()
最佳答案
我在 Linux 和 SunOS 的 forkandexec 上的 oracle 站点中发现了一些错误但是这些错误已经在你的 java 1.7 中修复了
看到堆栈跟踪,我觉得线程正在等待某个条件。您能否检查一下您的代码是否使用了这些方法中的任何一种,例如
get()
或
poll()
因为这些方法会使线程进入 TIMED_WAITING 状态。
我建议使用 jdk/bin 中的 Jvisualvm 工具进行更详细的监控我相信您将能够找到根本原因。
您可以使用相同的方式监视子线程和父线程。如果在启动和分析您的程序时遇到任何问题,请告诉我。
关于java - 调试挂起java.lang.UNIXProcess.forkAndExec,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11588906/
昨晚我因为这个问题脑子崩溃了。在确保没有来 self 的 eclipse 错误检查的明显错误之后,我开始调试我的程序。顺便说一下,我正在使用 Jre7。无论如何,每次我进入我的类调用(我们称之为“a”
(前言:我对 C/C++ 还很陌生,我真的不知道 native 代码中的调试实际上是如何工作的。) 一些消息来源说 gdb 和 lldb 可以调试 any program compiled to ma
我正在尝试从 Visual Studio 2012 外部调试 T4Scaffolding.Core Nuget 包。我使用的是安装了 Powershell 3.0 的 Powershell ISE,并
如何调试汇编代码?我在 Linux 上使用 gdb。我知道我可以看寄存器。有哪些调试汇编代码的方法? 最佳答案 您当然可以使用 breakpoints就像 C 或任何其他编译语言一样。 This ar
如何在每次通话时打印列表或 haskell 中的内容,例如: funct a list = funct (a + 1) (a : list) print list her
让我用我对 Makefiles 或 make 知之甚少的评论作为这个问题的前缀。 有一个非常大的项目,每晚自动构建。它以 Debug 和 Release 模式构建,Debug 用于 Valgrind
我正在创建一个计算每周工资的程序,那么任何加类工资都是该周正常工资的 1.5 倍。我的代码如下: #include int main() { double payrate; double h
我使用的是 Visual Studio 2010 Express Developer 版本。开发网站。我在我的 .aspx 页面中使用 JavaScript。 如何在 Javascript 中放置断点
我最近开始修补 Project Euler 问题,并尝试用 Javascript 解决它们。这样做我往往会产生许多无限循环,现在我想知道是否有比终止 Firefox 或 Chrome 中的选项卡更好的
有没有办法在程序执行期间生成一个交互式 python 控制台(最好是 iPython)而不暂停主程序并且能够检查和修改程序变量?类似于浏览器为 JavaScript 提供的功能。 我知道 pdb.se
我正在使用 FFmpeg @ Android 并希望能够进入 FFmpeg 代码(Eclipse + Seqouya),同时编译 FFmpeg 我使用 --disable-stripping --en
我从使用互操作调用 win32 api 函数的 .net 进程中得到一个异常。 我有一个调试器,我想查看 LastError 的值。 是否可以从 Visual Studio 调试器中查看 LastEr
我正在尝试通过 VBA 创建一个宏,以在 IE 的多个选项卡中打开一组指定的链接。目前我正在使用下面的代码,如果我试图打开 3 个或更少的选项卡,它大部分时间都可以工作。任何超过 3 的代码都会在“N
好的,这似乎是一个愚蠢的问题,因为 MonoDevelop 越来越成熟,所以我确定我只是想念它,但我环顾四周,所有关于这个主题的问题似乎都是关于远程调试或 Mac 上的调试。 我使用的是 Ubuntu
如何调试 Rscripts是从命令行运行的? 我目前正在使用 getopt传递命令行选项的包,当有错误时,我很难: 看看到底出了什么问题; 在 R 中交互式调试(因为脚本需要命令行选项。) 有没有人有
支持 PDF 和网络上的信息很少。我碰巧在博客中看到一篇文章,提到 $.write() 或 $.writeln() 将向 javascript 控制台写入一个字符串。相当有用。有谁知道这个 $ 对象是
PyCharm 1.5 中是否可以使用 Firefox 和 Chrome 支持的 JavaScript 调试? 如果是这样,它能否与 Python/Django 调试器一起有效运行? 如果没有,有没有
我确定这以前发生在人们身上,某些东西在 Debug模式下工作,你在发布时编译,但有些东西坏了。 这发生在我在嵌入式 XP 环境中工作时,我发现最好的方法确实是编写一个日志文件来确定它会出错的地方。 您
我目前正在为即将到来的项目评估 Flow3。 AOP 模式和依赖注入(inject)将非常适合我们的目的。 现在我想不通的是如何在 Controller Action 中调试一些结果。 public
最初,我有一个包含测试服务器的 Django 应用程序。要调试此设置,我只需添加 import pdb; pdb.set_trace()代码中的任何位置,并且有一个断点将我扔到终端中的交互式调试器中(
我是一名优秀的程序员,十分优秀!