-
Bug
-
Resolution: Fixed
-
P3
-
7
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2152398 | 6u10 | Martin Buchholz | P3 | Resolved | Fixed | b10 |
WindowsXP(SP2, Japanese)
JDK : 6.0u2/JDK7b16
REPRODUCE :
1) Compile the attached test program
2) Invoke "java Command"
3) Please look at the message when IOException occurs in java.lang.Runtime#exec
(The test program tests other cases. The licensee focus on the IOException message.)
This does not occur in 1.3.1, 1.4.2_XX and 5.0ux.
NOTE :
The test program checks several cases. The above issues occurs in IOException check.
INVESTIGATION :
[j2se/src/solaris/native/java.lang/UNIXProcess_md.c]
.....
static void
throwIOException(JNIEnv *env, int errnum, const char *defaultDetail)
{
static const char * const format = "error=%d, %s";
const char *detail = defaultDetail;
char *errmsg;
if (errnum != 0) {
const char *s = strerror(errnum);
if (strcmp(s, "Unknown error") != 0)
detail = s;
}
/* ASCII Decimal representation uses 2.4 times as many bits as binary. */
errmsg = NEW(char, strlen(format) + strlen(detail) + 3 * sizeof(errnum));
sprintf(errmsg, format, errnum, detail);
JNU_ThrowIOException(env, errmsg);
free(errmsg);
}
.....
The return value(Japanese EUC encoding ) from strerr() is used in UTF-8.
That's why the error message can not be displayed correctly.
OTHERS:
Please see the strong requests in "comment section".
- backported by
-
JDK-2152398 (process) Decode system error messages using platform encoding (unix)
-
- Resolved
-
- relates to
-
JDK-4811767 (process) Runtime.exec should throw IOException when workdir does not exist (Unix)
-
- Resolved
-
-
JDK-6601230 (attach) Decode system error messages using platform encoding (unix)
-
- Closed
-
-
JDK-4258198 Can't display localized exception messages of the native method correctly
-
- Closed
-
-
JDK-6927425 (process) Decode system error messages (win)
-
- Closed
-
-
JDK-4052517 (process) Runtime.exec won't execute programs belonging to other groups on Unix
-
- Resolved
-