Bug 218394

Summary: Java compiler and interpreter fail on non-English file names.
Product: [Fedora] Fedora Reporter: Björn Persson <listor2.rombobeorn>
Component: java-1.6.0-openjdkAssignee: Thomas Fitzsimmons <fitzsim>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: rawhideCC: triage
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-19 20:06:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
test script – tests ten combinations none

Description Björn Persson 2006-12-05 01:29:15 UTC
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 07:50:56 UTC
ecj is a separate package.

Comment 2 Andrew Overholt 2006-12-05 14:08:30 UTC
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 15:29:39 UTC
Can you provide an example source file?  Preferably something small.

Comment 4 Björn Persson 2006-12-06 01:07:55 UTC
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-07 00:16:37 UTC
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 19:54:09 UTC
Since ecj is now being used in GCJ this should be investigated. Changing to
priority to high.

Comment 7 Tom Tromey 2007-04-30 16:58:14 UTC
I think this is a libgcj bug.
AFAIK we only encode file names using utf-8.


Comment 8 Bug Zapper 2008-04-04 05:06:21 UTC
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 13:23:52 UTC
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 20:06:11 UTC
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