Bug 162153 - Java Logger.log(Level, String, Object) always fails
Java Logger.log(Level, String, Object) always fails
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2005-06-30 09:04 EDT by Richard Bullington-McGuire
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-06-30 09:48:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 21775 None None None Never

  None (edit)
Description Richard Bullington-McGuire 2005-06-30 09:04:42 EDT
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):

How reproducible:

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");
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 09:44:33 EDT
The upstream project has fixed this very recently:


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:


The GCC maintainers have fixed this in CVS.
Comment 2 Jakub Jelinek 2005-06-30 09:48:44 EDT
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.