Improving the Identication of Linux Distributions when Dumping

Robert Ottenhag robert.ottenhag at oracle.com
Sun Apr 3 18:51:46 PDT 2011


I am about to improve the identification of popular Linux distros during dumping, see bug [1] and [2], that states that we should "correctly identify Ubuntu as the operating system in crash report instead of 'Debian'".

 

I am somewhat reluctant to directly apply the suggested patch though which only adds to the existing problematic implementation where some distros not are identified at all, or are identified as a different distro.

 

The current implementation [4] relies on the fact that most Linux distros have /etc/XXX-release files, where some distros have multiple files (see [3]). It then checks a fixed set of these files in order, and stops at the first matching file, so the order is important.

 

(0) the current order is "/etc/mandrake-release", "/etc/sun-release", "/etc/redhat-release", "/etc/SuSE-release", "/etc/turbolinux-release", "/etc/gentoo-release", "/etc/debian_version", "/etc/ltib-release", "/etc/angstrom-version", and the proposed patch is to insert "/etc/lsb-release" right before "/etc/debian_version".

 

If we instead of (0) replace it by (1) and (2) below it will be improved in many ways.

    

(1) call the "lsb_release" tool, if it exists, which returns distro specific info based on either /etc/lsb_release or /etc/XXX-release, and that also knows which of multiple /etc/XXX-release files to check first, e.g. /etc/enterprise-linux before /etc/redhat-linux.

    

(2) list all /etc/*-release and /etc/*_version files, headed by the respective file names

 

The problem with (1) is that it calls an external process during a phase with might be very critical on resources, and it might not be available on specific old or embedded distros.  Thus we still need (2) for which we need to verify that directory listing does not violate similar resource contraints.  Regarding (2) the order of listed files should also be considered if it simplifies parsing of the dump output.

 

The new solution would look something like

  OS:

    /etc/debian_version

       <content>

    /etc/lsb-release

       <content>

 

Fundamentally, instead of having the JVM to try identify the Linux distro, it becomes up to the reader/parser of the dump output, but with the benefit of having all data available.

 

References:

 

[1] https://bugs.openjdk.java.net/show_bug.cgi?id=100137

[2] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6986195

[3] http://linuxmafia.com/faq/Admin/release-files.html

[4] hotspot/src/os/linux/vm/os_linux.cpp:os::print_os_info().

 

I appreciate any comments and ideas.

 

Thanks

 

/Robert

 

-- 
HYPERLINK "http://www.oracle.com" \nOracle
Robert Ottenhag | Senior Member of Technical Staff
Phone: HYPERLINK "tel:+46850630961"+46850630961 | | Fax: HYPERLINK "fax:+46850630911"+46850630911 | | Mobile: HYPERLINK "tel:+46707106161"+46707106161 
Oracle Oracle Java VM
ORACLE Sweden | Folkungagatan 122 | SE-116 30 Stockholm

Oracle Svenska AB, Kronborgsgränd 17, S-164 28 KISTA, reg.no. 556254-6746 

HYPERLINK "http://www.oracle.com/commitment" \nGreen Oracle

Oracle is committed to developing practices and products that help protect the environment

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20110403/cf2e0f83/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 658 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20110403/cf2e0f83/attachment.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.gif
Type: image/gif
Size: 356 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20110403/cf2e0f83/attachment-0001.gif 


More information about the hotspot-runtime-dev mailing list