Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 162153 - Java Logger.log(Level, String, Object) always fails
Summary: Java Logger.log(Level, String, Object) always fails
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL: http://gcc.gnu.org/bugzilla/show_bug....
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-30 13:04 UTC by Richard Bullington-McGuire
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-06-30 13:48:44 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
GNU Compiler Collection 21775 None None None Never

Description Richard Bullington-McGuire 2005-06-30 13:04:42 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050524 Fedora/1.0.4-4 Firefox/1.0.4

Description of problem:
Programs that use of the method java.util.logging.Logger.log(java.util.logging.Level, java.lang.String, java.lang.Object) always fail when executed by gij.

This happens both when ecj compiles the bytecode and when Sun JDK 1.4.2 javac compiles the bytecode, so it's probably not an ecj compiler bug, but rather a bug in the class library that gij is using for java.util.logging.Logger.

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

How reproducible:
Always

Steps to Reproduce:
Create the HelloLogFails.java source file, compile it with ecj, and run it with gij:

cat <<EOF > HelloLogFails.java
import java.util.logging.*;

public class HelloLogFails {

        public static final void main (String [] argv) {
                Logger log = Logger.getLogger("");
                log.info("Some simple logging statements work");
                log.log(Level.INFO, "{0} fails here, though", "gij");
        }
}
EOF
ecj HelloLogFails.java && gij HelloLogFails


Actual Results:  30-Jun-05 8:56:36 AM HelloLogFails main
INFO: Some simple logging statements work
Exception in thread "main" java.lang.NullPointerException
   at java.lang.Class.getName() (/usr/lib/libgcj.so.6.0.0)
   at java.util.logging.Logger.getCallerStackFrame() (/usr/lib/libgcj.so.6.0.0)
   at java.util.logging.Logger.log(java.util.logging.Level, java.lang.String, java.lang.Object) (/usr/lib/libgcj.so.6.0.0)
   at HelloLogFails.main(java.lang.String[]) (Unknown Source)
   at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)


Expected Results:  The expected output when the above program is compiled and run with Sun's JDK 1.4.2 is as follows:

Jun 30, 2005 8:56:40 AM java.util.logging.LogManager$RootLogger log
INFO: Some simple logging statements work
Jun 30, 2005 8:56:40 AM java.util.logging.LogManager$RootLogger log
INFO: gij fails here, though



Additional info:

Comment 1 Richard Bullington-McGuire 2005-06-30 13:44:33 UTC
The upstream project has fixed this very recently:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21775

The bug was severity "critical" in GCC. 
I've added this URL to this bug to the bug report.

The patch is very simple, a one-liner:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21775#c3

The GCC maintainers have fixed this in CVS.

Comment 2 Jakub Jelinek 2005-06-30 13:48:44 UTC
PR21775 is fixed in GCC 4.0.0-10 and above. FC4 GCC errata is planned in a
2-3 weeks timeframe.


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