Code review request for Linux version id fix (6986195)

Daniel D. Daugherty daniel.daugherty at oracle.com
Thu Sep 12 13:00:39 PDT 2013


Greetings,

I am sponsoring the following code review for Jerry Thornbrugh.
Since this code review request is going to two aliases, please make
sure you include BOTH aliases in your replies.

Dan



OpenJDK bug:

6986195 correctly identify Ubuntu as the operating system in crash
                report instead of "Debian"
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6986195

Internal (for now) bug:

JDK-6986195 correctly identify Ubuntu as the operating system in crash
                       report instead of "Debian"
https://bugs.openjdk.java.net/browse/JDK-6986195


External Webrev:

http://cr.openjdk.java.net/~dcubed/for_gthornbr/6986195-webrev/

Internal Webrev:

http://javaweb.us.oracle.com/~gthornbr/6986195-webrev/


Background:

The current Linux print_distro_info() function incorrectly reports an 
Ubuntu OS as a Debian
OS because it does not look for the Ubuntu release information file 
(/etc/lsb-release) and
instead finds the Debian release information file (/etc/debian_version). 
Because of this
Ubuntu releases are identified as Debian releases.

Here are some other issues that I have found:

The "lsb-release" file is the new Linux standard so it is now in the list.

Some Debian OS's have very poor /etc/debian_version files that report 
something like "wheesy/sid".
Now a "Debian " in printed before the contents of the 
/etc/debian_version file is printed for better
identification.

Some Linuxes based on Redhat have their own "xxx-release" files. Because 
of this "xxx-release" files
for Redhat based linuxes should be looked for before the 
"redhat-release" file.

Since Redhat has a "lsb-release" file that is not very descriptive the 
"redhat-release" file needs
to be looked for before the "lsb-release" file.

I also added the "system-release" and "os-release" files since they are 
an old standard.

I have complete some testing on all major Linux distributions and some 
minor ones.
The differences I have found between the new and old algorithm are below:

Ubuntu Linux Mint 15

Before (using /etc/debian_version):
.
.
.
---------------  S Y S T E M  ---------------

OS:wheezy/sid
.
.
.

After (using /etc/lsb-release):
.
.
.
---------------  S Y S T E M  ---------------

OS:DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=15
DISTRIB_CODENAME=olivia
DISTRIB_DESCRIPTION="Linux Mint 15 Olivia"
.
.
.



Oracle Linux

Before (using /etc/redhat-release)
.
.
.
---------------  S Y S T E M  ---------------

OS:Red Hat Enterprise Linux Server release 6.3 (Santiago)
.
.
.

After (using /etc/oracle-release)
.
.
.
---------------  S Y S T E M  ---------------

OS:Oracle Linux Server release 6.3
.
.
.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20130912/f9ad0876/attachment.html 


More information about the hotspot-runtime-dev mailing list