prelink breaks JAVA 'jinfo' utility normal behaviour
Issue
Issue with prelink and jinfo (one of the troubleshooting tools of OpenJDK).
Running jinfo on a JVM works fine until we (or the OS via anacron) run prelink.
Then, the JVM hangs.
Steps to reproduce the issue:
1) Open a Terminal n°1 and run:
yum install java-1.7.0-openjdk
yum install java-1.7.0-openjdk-devel
javac TCPServer.java
java TCPServer
2) Open a Terminal n°2 to test the program (sending current date for example):
date | nc -w0 localhost 6666
You should see the date on Terminal n°1
3) run multiple times jinfo on your TCPServer program PID. You should get each time the output from jinfo
jinfo
4) ensure TCPServer program is still working (as in step 2)
5) Force a prelink by running:
prelink -a
6) Try using jinfo (as in step 3)
jinfo
The 1st time it seems to work (you get jinfo's output) but in Terminal n°1 you get:
[1]+ Stopped java TCPServer
7) now your TCPServer is left in an unstable state and depending on what you do immediately at that point, you'll get different behaviours:
-
If you try to send some input to the program (as in step 2), it won't answer. If you "wake up" the process by sending a SIGCONT signal, it will print "Received: null" for each request you tried to send while it was in background
-
If your 1st action is to bring back in foreground the program (by running the command 'fg" on Terminal n°1, OR sending the CONT signal, you will be able to make it work somehow, but each jinfo command will put the TCPServer in background again (remember that wasn't the case in step 3 before we do the prelink. Back then we could run jinfo multiple times with no harm)
-
If your 1st action is to run jinfo several times, it will work 1 or 3 times before hanging with the message "Attaching to process ID
, please wait...".
8) if you need to start over and do more tests, you probably want to undo any prelinking by running:
prelink -au
Environment
- Red Hat Enterprise Linux 6.2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
