United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 4465334 System.exit value from class file is not sent back to the shell
4465334 : System.exit value from class file is not sent back to the shell

Details
Type:
Bug
Submit Date:
2001-06-01
Status:
Closed
Updated Date:
2001-06-08
Project Name:
JDK
Resolved Date:
2001-06-08
Component:
hotspot
OS:
linux_2.2
Sub-Component:
runtime
CPU:
x86
Priority:
P3
Resolution:
Won't Fix
Affected Versions:
1.3.1
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description
Running a java program that exits with a non-zero System.exit value results in
an exit value of zero with java1.3.1 on the linux 2.2.16 kernel (RedHat 7.0).
java 1.3 on all other unix kernels works as expected.  Determining the exit
status of a program is important in determining the success or failure of that
program.  By defaulting to 0, one might interpret that a program always runs
successfully when in fact it has failed.

                                    

Comments
EVALUATION

This problem is not reproducible on Redhat 6.2 or Redhat 7.1. It's only
reproducible on Redhat 7.0.

hui.huang@Eng 2001-06-07

----------------------------------------------------------------

This is a glibc bug. See detailed discussion at Redhat bugzilla:
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=23758
Basically, if the thread that does exit() is not the main thread,
the parent process (or shell) will always get 0 as exit value.
As happened in this testcase, the VM thread which handles VM_Exit
is not the main thread, so the exit code was not properly carried
to its parent. The fix is in glibc-2.2.1-2.

hui.huang@Eng 2001-06-07
                                     
2001-06-07



Hardware and Software, Engineered to Work Together