JDK-8210527 : JShell: NullPointerException in jdk.jshell.Eval.translateExceptionStack
  • Type: Bug
  • Component: tools
  • Sub-Component: jshell
  • Affected Version: 9,10,11,12
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: x86_64
  • Submitted: 2018-09-09
  • Updated: 2020-12-23
  • Resolved: 2019-12-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 14 JDK 15
11.0.11-oracleFixed 13.0.6Fixed 14 b27Fixed 15Fixed
Related Reports
Duplicate :  
Duplicate :  
Description
ADDITIONAL SYSTEM INFORMATION :
openjdk version "11-ea" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11-ea+26)
OpenJDK 64-Bit Server VM 18.9 (build 11-ea+26, mixed mode)

A DESCRIPTION OF THE PROBLEM :
When creating an extremely large LinkedList in JShell, a NullPointerException is thrown

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
launch jshell:
jshell -R-Xmx9G

run the command:
IntStream.rangeClosed(0, Integer.MAX_VALUE).mapToObj(i -> (byte) 0).collect(Collectors.toCollection(LinkedList::new))

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
either no exception occurs, or an OutOfMemoryError is reported
ACTUAL -
a NullPointerException occurs


Comments
Fix request (13u) Requesting backport to 13u for parity with 11u. The patch contains JDK-8210527 and JDK-8232855 fixes and applies cleanly. Tested with tier1 and jdk/jshell.
23-12-2020

Fix Request (11u) This fixes a jshell bug in 11u. Patch applies to 11u cleanly, new test fails without the patch, passes with it. Additional tier{1,2} and jdk/jshell tests pass. Note the changeset also contains JDK-8232855.
04-08-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/fd6d857ec82f User: rfield Date: 2019-12-11 22:39:17 +0000
11-12-2019

Out for review -- RFR JShell: NPE in translateExceptionStack and /help /help Please review ... Bugs: https://bugs.openjdk.java.net/browse/JDK-8210527 https://bugs.openjdk.java.net/browse/JDK-8232855 Webrev: http://cr.openjdk.java.net/~rfield/8210527v1.webrev/ Thanks, Robert
08-12-2019

There is a patch by Steven Schlansker in jdk-dev [JDK-8210527] NullPointerException in jstack exception rendering
20-08-2019

This issue is not a regression, it is reproducible in 9 GA as well.
10-09-2018

This is an issue, reproducible on latest ea builds of 11 and 12 jshell> IntStream.rangeClosed(0, Integer.MAX_VALUE).mapToObj(i -> (byte) 0).collect(Collectors.toCollection(LinkedList::new)); Exception in thread "main" java.lang.NullPointerException at jdk.jshell/jdk.jshell.Eval.translateExceptionStack(Eval.java:1098) at jdk.jshell/jdk.jshell.Eval.asEvalException(Eval.java:896) at jdk.jshell/jdk.jshell.Eval.declare(Eval.java:855) at jdk.jshell/jdk.jshell.Eval.eval(Eval.java:140) at jdk.jshell/jdk.jshell.JShell.eval(JShell.java:493) at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSource(JShellTool.java:3547) at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processSourceCatchingReset(JShellTool.java:1301) at jdk.jshell/jdk.internal.jshell.tool.JShellTool.processInput(JShellTool.java:1203) at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1176) at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:975) at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.start(JShellToolBuilder.java:254) at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:120)
10-09-2018