2

Accidentally I found the stat of one Java process is T(Stopped, either by a job control signal or because it is being traced). I think it may be related to jinfo because I ran this command at that time. Then I try to run jinfo again and the process crashed agagin. But it's not easy to reproduce.

Does anyone have the idea of why the stat of process became T without kill -SIGSTOP? Does jinfo have bug which may crash the process?

EDIT: I have 100% reproduced this issue when jinfo the process which has ran over 60 days. The bug seems to be triggered if the process has ran for a long time. It doesn't work for the new processes.

OMG, jmap has the same issue and it's also 100% reproduced. But not for jstack. Now I'm so sure it's something about detecting jvm.

$ java -version
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)

tobe
  • 1,671
  • 2
  • 23
  • 38
  • Please clarify what do you mean by 'crash'. Does the process terminate abnormally or does it just suspend? When does it happen? After you run `jinfo`? What command line exactly? How often does it happen? Does `jinfo` show anything in this case? – apangin Sep 01 '14 at 19:12
  • Thank @apangin for replying. For the first time the Java process suspend and not response to any request, but the process existed and the stat is T. The next time I ran `jinfo` which made the process exited. This has happened two times since then. I just ran `jinfo` without any parameter, like `jinfo 23943`. The output of `jinfo` is normal but occasionally it crashed the process. – tobe Sep 02 '14 at 01:15
  • OK. What JDK version is used? Do you run `jinfo` and `jmap` from the same JDK that your target application works on? – apangin Sep 02 '14 at 09:37
  • @apangin Yes, it's the same JDK. I will add the JDK info in the description. – tobe Sep 02 '14 at 10:12
  • OK. Looks like a bug in JVM attach mechanism. JDK 6 is no longer supported, so it's unlikely you'll get a fix for that. Can you check if the problem still exists in the latest JDK 7? – apangin Sep 02 '14 at 16:51
  • @apangin I have JDK 7 but not long running processes on it. If it's fixed on latest JDK, I think we can find the issue or patch about it. – tobe Sep 02 '14 at 23:44
  • Or in the latest Java 8. Consider raising a bug. – Thorbjørn Ravn Andersen Sep 04 '14 at 22:39

1 Answers1

0

It's the bug of JDK 1.6.0 or ptrace with kernel 2.6.32. I will test for different versions.

tobe
  • 1,671
  • 2
  • 23
  • 38