-
Bug
-
Resolution: Fixed
-
P3
-
7-pool, 8u5
-
b02
-
x86
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8063766 | 8u45 | Peter Levart | P3 | Resolved | Fixed | b01 |
JDK-8070219 | emb-8u47 | Peter Levart | P3 | Resolved | Fixed | team |
JDK-8072329 | 7u85 | Sean Coffey | P3 | Resolved | Fixed | b01 |
JDK-8055301 | 7u80 | Sean Coffey | P3 | Resolved | Fixed | b04 |
FULL PRODUCT VERSION :
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Darwin **************************** 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
A DESCRIPTION OF THE PROBLEM :
Java 8 switched to using posix_spawn by default to launch external processes on OS X (and other BSD-like systems). When java is running on a system with a default locale such as Turkish that uses non-ascii characters, this fails with an exception. The root cause is attempting to convert the lowercase system property to an uppercase enum constant using the default locale (in Turkish, this converts lowercase 'i' to unicode character U+0130) which results in the constant not being found.
REGRESSION. Last worked in version 7u60
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Set the default locale to e.g. Turkish
2. Use Runtime.exec() to launch an external process
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The call to Runtime.exec() should return normally.
ACTUAL -
An exception is thrown.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.Error: posix_spawn is not a supported process launch mechanism on this platform.
at java.lang.UNIXProcess$1.run(UNIXProcess.java:105)
at java.lang.UNIXProcess$1.run(UNIXProcess.java:94)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.UNIXProcess.<clinit>(UNIXProcess.java:92)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Test {
public static void main(final String[] args) {
Locale.setDefault(new Locale("tr", ""));
try {
Process exec = Runtime.getRuntime().exec("ls");
}
catch (IOException e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use an alternative locale.
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Darwin **************************** 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
A DESCRIPTION OF THE PROBLEM :
Java 8 switched to using posix_spawn by default to launch external processes on OS X (and other BSD-like systems). When java is running on a system with a default locale such as Turkish that uses non-ascii characters, this fails with an exception. The root cause is attempting to convert the lowercase system property to an uppercase enum constant using the default locale (in Turkish, this converts lowercase 'i' to unicode character U+0130) which results in the constant not being found.
REGRESSION. Last worked in version 7u60
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Set the default locale to e.g. Turkish
2. Use Runtime.exec() to launch an external process
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The call to Runtime.exec() should return normally.
ACTUAL -
An exception is thrown.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.Error: posix_spawn is not a supported process launch mechanism on this platform.
at java.lang.UNIXProcess$1.run(UNIXProcess.java:105)
at java.lang.UNIXProcess$1.run(UNIXProcess.java:94)
at java.security.AccessController.doPrivileged(Native Method)
at java.lang.UNIXProcess.<clinit>(UNIXProcess.java:92)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Test {
public static void main(final String[] args) {
Locale.setDefault(new Locale("tr", ""));
try {
Process exec = Runtime.getRuntime().exec("ls");
}
catch (IOException e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Use an alternative locale.
- backported by
-
JDK-8055301 (process) Runtime.exec() fails in Turkish locale
- Resolved
-
JDK-8063766 (process) Runtime.exec() fails in Turkish locale
- Resolved
-
JDK-8070219 (process) Runtime.exec() fails in Turkish locale
- Resolved
-
JDK-8072329 (process) Runtime.exec() fails in Turkish locale
- Resolved
- relates to
-
JDK-8000975 (process) Merge UNIXProcess.java.bsd & UNIXProcess.java.linux
- Closed