Bug 218394 - Java compiler and interpreter fail on non-English file names.
Java compiler and interpreter fail on non-English file names.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: java-1.6.0-openjdk (Show other bugs)
rawhide
i386 Linux
high Severity medium
: ---
: ---
Assigned To: Thomas Fitzsimmons
Fedora Extras Quality Assurance
bzcl34nup
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-04 20:29 EST by Björn Persson
Modified: 2008-04-19 16:06 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-04-19 16:06:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test script – tests ten combinations (1.09 KB, application/octet-stream)
2006-12-05 20:07 EST, Björn Persson
no flags Details

  None (edit)
Description Björn Persson 2006-12-04 20:29:15 EST
Description of problem:

When given a Java file with a non-English letter in the filename, the Java
compiler (javac, which is a link to ecj) claims that the file is missing.

If the filename has only English letters but the current directory has a
non-English letter, then the compiler gives the message "No .class file created
for file [...] in [...] because of an IOException: [...] (No such file or
directory)"

If all file and directory names have only English letters but the class name
inside the Java file has a non-English letter, then the resulting class file
gets its name encoded in UTF-8, which is wrong in my locale.

GIJ crashes when given a .class file with a non-English name, which is probably
related to the errors above. The stack trace is simply:
Exception in thread "main" java.lang.NullPointerException
   at gnu.java.lang.MainThread.run(libgcj.so.7rh)

My locale is sv_SE, which means the correct encoding is ISO 8859-1.

My first guess is that the problem is in GIJ. I'm setting Component to "gcc",
hoping that that includes GIJ and GCJ.

Version-Release number of selected component (if applicable):

eclipse-ecj-3.2.1-4.fc6
gcc-java-4.1.1-30
libgcj-4.1.1-30

How reproducible:

Always.
Comment 1 Jakub Jelinek 2006-12-05 02:50:56 EST
ecj is a separate package.
Comment 2 Andrew Overholt 2006-12-05 09:08:30 EST
We'll need to try ecj with a proprietary JVM to see whether or not it's a
problem with libgcj's locale handling.
Comment 3 Andrew Overholt 2006-12-05 10:29:39 EST
Can you provide an example source file?  Preferably something small.
Comment 4 Björn Persson 2006-12-05 20:07:55 EST
Created attachment 142908 [details]
test script – tests ten combinations

I found yet another case: An English-named .class file in a non-English
directory causes GIJ to throw a NoClassDefFoundError.
Java_filename_encoding.tar.gz contains a set of files to test ten combinations
of file, directory and class names.

The test case is written in ISO 8859-1. I don't know how it might behave in
other locales. If running the test in another locale, don't forget to convert
both the filenames and the files' contents to the local character encoding!
Comment 5 Björn Persson 2006-12-06 19:16:37 EST
This is a dummy comment which I'm adding in an attempt to get this bug out of
NEEDINFO status, as that apparently didn't happen when I submitted the requested
example.
Comment 6 Ben Konrath 2007-02-06 14:54:09 EST
Since ecj is now being used in GCJ this should be investigated. Changing to
priority to high.
Comment 7 Tom Tromey 2007-04-30 12:58:14 EDT
I think this is a libgcj bug.
AFAIK we only encode file names using utf-8.
Comment 8 Bug Zapper 2008-04-04 01:06:21 EDT
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.
http://fedoraproject.org/wiki/LifeCycle/EOL

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers
Comment 9 Andrew Overholt 2008-04-04 09:23:52 EDT
I just tried the attachment with IcedTea on F8 and get failures.  Moving over to
openjdk.

$ javac -version
java javac 1.7.0-internal
$ java -version
java version "1.7.0"
IcedTea Runtime Environment (build 1.7.0-b21)
IcedTea Client VM (build 1.7.0-b21, mixed mode)
Comment 10 Thomas Fitzsimmons 2008-04-19 16:06:11 EDT
This works fine on Rawhide OpenJDK after I set the correct locale encoding:

$ export LANG=en_US.ISO-8859-1
$ readlink -f `which java` && readlink -f `which javac`
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/bin/java
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/bin/javac
$ ./run_test
Compiling hello_world/hello_world.java:
PASSED
Compiling hello_world/hej_v�rld.java:
PASSED
Compiling hello_world/different_name.java:
PASSED
Running hello_world/ett:
precompiled one
PASSED
Running hello_world/tv
precompiled two
PASSED
Compiling hej_v�rld/hello_world.java:
PASSED
Compiling hej_v�rld/hej_v�rld.java:
PASSED
Compiling hej_v�rld/different_name.java:
PASSED
Running hej_v�rld/ett:
precompiled one
PASSED
Running hej_v�rld/tv
precompiled two
PASSED

Note You need to log in before you can comment on or make changes to this bug.