JDK-5033302 : (process) Can't execute Solaris NFS programs with uid>64k on Linux-amd64
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_suse_sles_8
  • CPU: x86
  • Submitted: 2004-04-16
  • Updated: 2006-06-08
  • Resolved: 2006-04-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b81Fixed
Related Reports
Relates :  
Relates :  
Description
Name: kaR10181			Date: 04/16/2004


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.5.0-b47 (also fails with jdk1.4.2-fcs)
Testbase       : Regression-test
Platform[s]    : Sles8 on AMD64 (passes on other platforms)
switch/Mode    : generic
Falling test[s]: 
java/awt/dnd/MotifDnDAcceptanceTest/MotifDnDAcceptanceTest.html

The test tries to run a program using Runtime.exec(). The program has 
the following permissions:

-r-xr--r--    1 ka94536  green       15992 Apr 16  2004 motif-child

The problem is Runtime.exec() cannot run a program with such permissions 
on AMD64 platform.
It needs at least ug+x.

Test source location:
=====================
/java/re/jdk/1.5.0/promoted/all/b47/ws/j2se/test/java/awt/dnd/MotifDnDAcceptanceTest/MotifDnDAcceptanceTest.java

jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b47/regtest/linux/SuSE_SLES_8_jck-amd1/workDir/test/java/awt/dnd/MotifDnDAcceptanceTest/MotifDnDAcceptanceTest.jtr

How to reproduce:
=================
Run the following script (you may need to change its variables)

--- script start ---
#!/bin/sh
RESULT_DIR=`pwd`
WORK_DIR=$RESULT_DIR/workDir/test
REPORT_DIR=$RESULT_DIR/reportDir

JT_HOME="/net/koori.sfbay/onestop/jct-tools/3.1.2/archive/fcs/binaries"
JEMMY_JAR="/net/jdk.sfbay/export/jpse04/Jemmy/jemmy.jar"
JAVA_HOME="/net/koori.sfbay/onestop/jdk/1.5.0/promoted/all/b45/binaries/linux-i586"
TEST_BASE_PATH="/net/jtgb4u4c/export/sail1/testarea/regression1.5/test"

TESTVMOPTS="-client"
CLASSPATH="$JT_HOME/classes:$JT_HOME/lib/javatest.jar:$JT_HOME/lib/jtreg.jar"

TEST="java/awt/dnd/MotifDnDAcceptanceTest/MotifDnDAcceptanceTest.html"

mkdir -p $WORK_DIR/scratch 2>&1
mkdir -p $WORK_DIR/jtData 2>&1
mkdir -p $REPORT_DIR 2>&1

#rm $WORK_DIR/jtData/ResultCache.jtw 2>&1

cd $WORK_DIR/scratch

$JAVA_HOME/bin/java -showversion -server -cp $CLASSPATH 
-DenvVars=TESTJAVAHOME=$JAVA_HOME,TESTVMOPTS=$TESTVMOPTS,DISPLAY=$DISPLAY,HOME=$HOME/.regtest,PATH=/bin:/usr/bin,CPAPPEND=$JEMMY_JAR,TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= 
-DDISPLAY=$DISPLAY -DlocalHost=`uname -n` -Dprogram=jtreg 
com.sun.javatest.regtest.Main -a -v default -batch -params -w 
"$WORK_DIR" -r "$REPORT_DIR" -t "$TEST_BASE_PATH" "$TEST_BASE_PATH/$TEST"

--- script end ---

Script output:
==============

java version "1.5.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b45)
Java HotSpot(TM) Server VM (build 1.5.0-beta2-b45, mixed mode)

JavaTest HTTPd - Success, active on port 1903
JavaTest HTTPd server available at http://10.5.17.252:1903/
runner starting test: 
java/awt/dnd/MotifDnDAcceptanceTest/MotifDnDAcceptanceTest.html
runner finished test: 
java/awt/dnd/MotifDnDAcceptanceTest/MotifDnDAcceptanceTest.html
Failed. Execution failed: Applet thread threw exception: 
java.lang.RuntimeException: Incorrect drop data: null
Test results: failed: 1
Report written to /home/ka94536/test/reportDir/report.html
Results written to /home/ka94536/test/workDir/test
Error: Some tests failed or other problems occurred.

Test output (jtr part):
=======================

java.io.IOException: java.io.IOException: ./motif-child: cannot execute
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
    at java.lang.ProcessImpl.start(ProcessImpl.java:65)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
    at java.lang.Runtime.exec(Runtime.java:590)
    at java.lang.Runtime.exec(Runtime.java:428)
    at java.lang.Runtime.exec(Runtime.java:325)
    at MotifDnDAcceptanceTest.start(MotifDnDAcceptanceTest.java:161)
    at 
com.sun.javatest.regtest.AppletWrapper$AppletThread.run(AppletWrapper.java:133)
    at java.lang.Thread.run(Thread.java:570)
java.lang.RuntimeException: Incorrect drop data: null
    at MotifDnDAcceptanceTest.start(MotifDnDAcceptanceTest.java:184)
    at 
com.sun.javatest.regtest.AppletWrapper$AppletThread.run(AppletWrapper.java:133)
    at java.lang.Thread.run(Thread.java:570)
STATUS:Failed.Applet thread threw exception: java.lang.RuntimeException: 
Incorrect drop data: null
result: Failed. Execution failed: Applet thread threw exception: 
java.lang.RuntimeException: Incorrect drop data: null


test result: Failed. Execution failed: Applet thread threw exception: 
java.lang.RuntimeException: Incorrect drop data: null

Specific machine info:
======================
Hostname: jck-amd1
OS: Sles8



======================================================================

Comments
EVALUATION I finally fixed the long-suffering 4052517: (process) Solaris Runtime.exec won't execute programs belonging to other groups and this bug (5033302) was also magically fixed, as predicted by the previous evaluator.
23-03-2006

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
14-06-2004

WORK AROUND Runtime.exec(new String[]{"/bin/sh", "-c", ...}) ###@###.### 2004-04-21
21-04-2004

EVALUATION I have been able to reproduce the problem. If you have a Solaris user with uid>64k, and if the home directory is NFS-mounted on Linux-AMD64, then accesses to the NFS-mounted drive from Linux will see truncations of the uid. Linux-amd64 is a system with 32-bit uids, but evidently there are still remnants of 16-bit uid code in the system that may take another Linux kernel cycle to fully resolve. The implementation checks the uid of the executable file in statExecutable. This is a design error. Hopefully both this bug and 4052517: (process) Solaris Runtime.exec won't execute programs belonging to other groups can be fixed by trying to execute the program without trying to predict its success ahead of time. ###@###.### 2004-04-21
21-04-2004