Bug: Generating prelink cache breaks JAVA 'jinfo' utility normal behaviour

Dmitry Samersoff dmitry.samersoff at oracle.com
Wed Mar 26 12:09:22 UTC 2014


Carlos,

I'd filed

https://bugs.openjdk.java.net/browse/JDK-8038392

and take care for your fix.


-Dmitry


On 2014-03-18 22:11, Carlos Santos wrote:
> Hello,
> 
> My name is Carlos Santos and I'm a Red Hat software maintenance engineer. Recently a customer noticed that running prelink to generate its cache causes the OpnJDK "jinfo" utility to fail. I'm transcribing below our internal bug report.
> 
> Version-Release number of selected component (if applicable):
> 
> java-1.7.0-openjdk-1.7.0.51-2.4.4.1.el6_5
> 
> How reproducible:
> 
> Always
> 
> Steps to Reproduce:
> 
> 1. export LIBSAPROC_DEBUG=1
> 2. yum install -y java-1.7.0-openjdk-devel
> 3. javac TCPServer.java (see attachment)
> 4. prelink -ua
> 5. java TCPServer &     (take the process pid)
> 6. jinfo <pid>          (works, lots of information shown)
> 7. prelink -a
> 8. jinfo <pid>          (fails, lots of information shown)
> 
> Actual results:
> 
> Step 8 fails, the message below is shown and the Java vm is kept stopped.
> 
>    [1]+  Stopped                 java TCPServer
> 
> Expected results:
> 
> All steps should succeed.
> 
> Additional info:
> 
> The problem happens because when prelink runs while the Java VM is running the format of the proc/<pid>/maps file changes to a funky format:
> 
>   - Libraries that are to be ignored receive a trailing " (deleted)"
>   - Libraries that are provided by the prelink cache receive a trailing ".#prelink#.xyTMjC (deleted)"
> 
> This leads jinfo to fail parsing the maps file.
> 
> The problem can be fixed by means of the attached patch (java-1.7.0-openjdk-debug-prelink.patch).
> 
> Changes in function nfo_fd (file openjdk/hotspot/agent/src/os/linux/ps_proc.c):
> 
>   - Discard libraries that must be ignored.
>   - Remove the the trailing ".#prelink#.xyTMjC (deleted)" from the names of libraries that must not be discarded
>   - Add debug messages about discarded and kept shared objects.
> 
> Changes in function add_lib_info_fd (file openjdk/hotspot/agent/src/os/linux/libproc_impl.c):
> 
>   - Save library base address at newlib->base. It was being left as null, which led to failures searching for symbols in the shared objects.
>   - Fixed/enhanced debug messages.
> 
> I attempted to open an account in the OpenJDK bug tracking system to submit the report there but did not find a way. The instructions at
> 
>     http://openjdk.java.net/contribute/
> 
> say that I need to submit a signed OCA, but I was told that Red Hat employees are already covered by the OCA.
> 
> Thanks in advance for your help.
> 
> Carlos Santos (casantos)
> Senior *Software* Maintenance Engineer
> (no, I'm not going to fix your roof)
> Red Hat, Inc
> 
> 


-- 
Dmitry Samersoff
Oracle Java development team, Saint Petersburg, Russia
* I would love to change the world, but they won't give me the sources.


More information about the serviceability-dev mailing list