Issue2067

classification
Title: NullPointerException running under latest JRockit JVM
Type: crash Severity: normal
Components: Core Versions: Jython 2.7, Jython 2.5
process
Status: closed Resolution: invalid
Dependencies: Superseder:
Assigned To: Nosy List: jeff.allen, kmac
Priority: Keywords:

Created on 2013-07-09.17:32:20 by kmac, last changed 2013-07-18.05:46:03 by jeff.allen.

Messages
msg8060 (view) Author: Kyle MacLeod (kmac) Date: 2013-07-09.17:32:19
Running jython under the latest JRockit JVM I run into a NPE on startup.
Reproducible on jython-2.5.3, jython-2.5.4-rc1, and jython-2.7-b1.

% java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Oracle JRockit(R) (build R28.2.7-7-155314-1.6.0_45-20130329-0641-linux-x86_64, compiled mode)

Exception on startup:

Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:48:36) 
[Oracle JRockit(R) (Oracle Corporation)] on java1.6.0_45
error importing site
Traceback (most recent call last):
  File "/opt/jython/Lib/site.py", line 421, in <module>
    main()
  File "/opt/jython/Lib/site.py", line 414, in main
    execsitecustomize()
  File "/opt/jython/Lib/site.py", line 395, in execsitecustomize
    import sitecustomize
  File "/opt/jython/Lib/site.py", line 395, in execsitecustomize
    import sitecustomize
java.lang.NullPointerException
        at java.io.File.<init>(File.java:222)
        at java.lang.Package$1.run(Package.java:527)
        at java.lang.Package.defineSystemPackage(Package.java:520)
        at java.lang.Package.getSystemPackages(Package.java:511)
        at java.lang.ClassLoader.getPackages(ClassLoader.java:1513)
        at java.lang.ClassLoader.getPackages(ClassLoader.java:1511)
        at java.lang.Package.getPackages(Package.java:281)
        at org.python.core.JavaImportHelper.buildLoadedPackages(JavaImportHelper.java:161)
        at org.python.core.JavaImportHelper.tryAddPackage(JavaImportHelper.java:60)
        at org.python.core.imp.import_next(imp.java:723)
        at org.python.core.imp.import_module_level(imp.java:827)
        at org.python.core.imp.importName(imp.java:917)
        at org.python.core.ImportFunction.__call__(__builtin__.java:1220)
        at org.python.core.PyObject.__call__(PyObject.java:357)
        at org.python.core.__builtin__.__import__(__builtin__.java:1174)
        at org.python.core.imp.importOne(imp.java:938)
        at site$py.execsitecustomize$27(/opt/jython/Lib/site.py:397)
        at site$py.call_function(/opt/jython/Lib/site.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:165)
        at org.python.core.PyBaseCode.call(PyBaseCode.java:120)
        at org.python.core.PyFunction.__call__(PyFunction.java:307)
        at site$py.main$28(/opt/jython/Lib/site.py:419)
        at site$py.call_function(/opt/jython/Lib/site.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:165)
        at org.python.core.PyBaseCode.call(PyBaseCode.java:120)
        at org.python.core.PyFunction.__call__(PyFunction.java:307)
        at site$py.f$0(/opt/jython/Lib/site.py:430)
        at site$py.call_function(/opt/jython/Lib/site.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:165)
        at org.python.core.PyCode.call(PyCode.java:18)
        at org.python.core.imp.createFromCode(imp.java:391)
        at org.python.core.imp.createFromSource(imp.java:354)
        at org.python.core.imp.loadFromSource(imp.java:581)
        at org.python.core.imp.find_module(imp.java:478)
        at org.python.core.imp.import_next(imp.java:718)
        at org.python.core.imp.import_first(imp.java:740)
        at org.python.core.imp.load(imp.java:631)
        at org.python.util.jython.run(jython.java:178)
        at org.python.util.jython.main(jython.java:130)

java.lang.NullPointerException: java.lang.NullPointerException


Other notes:

* creating Lib/sitecustomize.py allows jython to startup. However, 'import logging' results in a similar traceback.

* similar traceback when running on solaris:
java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Oracle JRockit(R) (build R28.2.7-7-155314-1.6.0_45-20130329-0642-solaris-sparcv9, compiled mode)
msg8061 (view) Author: Jeff Allen (jeff.allen) Date: 2013-07-12.19:19:21
Thanks for posting, and for the stack dump. I found this:
https://forums.oracle.com/thread/2557048
which looks like the same error. (No responses at the time of this post.)

However, the last line of Jython's code that is involved here is:
http://hg.python.org/jython/file/3d2dbae23c52/src/org/python/core/JavaImportHelper.java#l161
and it simply calls java.lang.Package.getPackages() (no arguments).

In java.lang.Package, null is passed as the file name to a File(String) constructor, and this file name comes from a list of system packages in the JVM. It's difficult to see how Jython could pollute that. I half suspect a JVM bug. Or a badly-behaving custom class loader?
msg8067 (view) Author: Kyle MacLeod (kmac) Date: 2013-07-16.20:42:16
I can confirm this is a jrockit bug.

The issue can be found on the Oracle support site (registration required)

To find it, search for:
java.lang.NullPointerException at java.lang.Package$1.run error during AIA FP installation using JRockit [ID 1553496.1]

The Bug is fixed in JRockit  28.2.8


Oracle has a patch for it:
Patch 16569812: REGRESSION-JDBC SDP TEST FAILURES WITH JROCKIT R28.2.7 BASED ON 6U45

Use My Oracle Support Portal to download the Patch: 16569812 for accordant OS Platform.


I downloaded and tested with the patch and the issue goes away. 

Can you close this off Jeff? thanks very much.
msg8068 (view) Author: Jeff Allen (jeff.allen) Date: 2013-07-18.05:46:03
That's the kind of bug we like. Thanks for getting back to us.
History
Date User Action Args
2013-07-18 05:46:03jeff.allensetstatus: open -> closed
resolution: invalid
messages: + msg8068
2013-07-16 20:42:16kmacsetmessages: + msg8067
2013-07-12 19:19:22jeff.allensetnosy: + jeff.allen
messages: + msg8061
2013-07-09 17:34:00kmacsettype: crash
2013-07-09 17:32:20kmaccreate