question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JVM crash: java.lang.VerifyError: Bad type on operand stack

See original GitHub issue

Compiler version

3.1.0

Minimized code

It seems that a combination of two factors trigger this bug:

  1. skipping a parameter via named parameters
  2. using for comprehension / lambda
class Base(a: String = "x", param: String = "")

class Child extends Base(param = {
  (for(x <- Seq("a")) yield x)
  "param"
})

new Child

Output

java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    Playground$Child.<init>()V @25: invokedynamic
  Reason:
    Type uninitializedThis (current frame, stack[1]) is not assignable to 'Playground$Child'

Looks somewhat siliar to https://github.com/lampepfl/dotty/issues/2163

Expectation

Code runs with no output.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
oderskycommented, Apr 13, 2022

I found the root cause: We forgot about lifted parameters when hoisting out supercall arguments.

1reaction
griggtcommented, Mar 13, 2022

@som-snytt go for it!

It seems to me that the failure only occurs in presence of the wrapper object injected by the REPL / Scastie?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: java.lang.VerifyError: Bad type on operand stack
I am currently in the middle of installing a shiteload of modes and i had error after error after error and finally this...
Read more >
Error: java.lang.VerifyError: Bad type on operand stack #1778
I got a lot of fabric mods but I keep getting this error message help? ---- Minecraft Crash Report ---- // Who set...
Read more >
Reason for the exception java.lang.VerifyError: Bad type on ...
The below simple java code sends the java.lang.VerifyError: Bad type on operand stack exception public class TestJavaCodes { int parentData ...
Read more >
Bad type on operand stack on calling inner class of inherited ...
java.lang.VerifyError: Bad type on operand stack on calling inner class of inherited class in super class when casting to inherited class ; Project,...
Read more >
My game keeps on crashing :( - Minecraft Server and Maps
this is what it said: The game crashed whilst initializing game Error: java.lang.VerifyError: Bad type on operand stack Exit Code: -1.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found