Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.VerifyError in bytecode produced by CodeGen #407

Closed
rohanpadhye opened this issue Mar 11, 2018 · 8 comments
Closed

java.lang.VerifyError in bytecode produced by CodeGen #407

rohanpadhye opened this issue Mar 11, 2018 · 8 comments

Comments

@rohanpadhye
Copy link

Input to Rhino 1.7.8:

(function(g_0, h_1, q_2, q_2){ try { while ((null)){ var j_3;;throw ((null)[(g_0)]);throw ((j_3) && (e_4));{ for((u_5);;(e_4)){ var g_0 };try { break;;([((++ (s_6)).g_0)]) }catch (h_1) { return;(g_0);var k_7 } } } }catch (s_6) { var d_8; } })

Compilation fails with:

java.lang.VerifyError: Stack map does not match the one at exception handler 206
Exception Details:
  Location:
    org/mozilla/javascript/gen/input_1._c_anonymous_1(Lorg/mozilla/javascript/gen/input_1;Lorg/mozilla/javascript/Context;Lorg/mozilla/javascript/Scriptable;Lorg/mozilla/javascript/Scriptable;[Ljava/lang/Object;)Ljava/lang/Object; @206: nop
  Reason:
    Type top (current frame, locals[6]) is not assignable to 'org/mozilla/javascript/Scriptable' (stack map, locals[6])
  Current Frame:
    bci: @123
    flags: { }
    locals: { 'org/mozilla/javascript/gen/input_1', 'org/mozilla/javascript/Context', 'org/mozilla/javascript/Scriptable', 'org/mozilla/javascript/Scriptable', '[Ljava/lang/Object;' }
    stack: { 'org/mozilla/javascript/JavaScriptException' }
  Stackmap Frame:
    bci: @206
    flags: { }
    locals: { 'org/mozilla/javascript/gen/input_1', 'org/mozilla/javascript/Context', 'org/mozilla/javascript/Scriptable', 'org/mozilla/javascript/Scriptable', '[Ljava/lang/Object;', top, 'org/mozilla/javascript/Scriptable' }
    stack: { 'java/lang/Throwable' }
  Bytecode:
    0x0000000: 2ab9 0075 0100 4d2a 2c19 0403 b800 794d
    0x0000010: 2b2c b800 7c2c 3a06 a700 ce01 2b2c 124e
    0x0000020: b800 812b 2cb8 0085 bb00 875a 5f12 8803
    0x0000030: b700 8bbf 0000 0000 0000 0000 0000 0000
    0x0000040: 0000 0000 0000 0000 00bf 0000 0000 0000
    0x0000050: 0000 0000 00bf 0000 0000 0000 0000 0000
    0x0000060: bf00 0000 0000 0000 bf00 0000 0000 0000
    0x0000070: 0000 0000 bf00 0000 0000 bf00 0000 0000
    0x0000080: 0000 0000 0000 0000 0000 0000 0000 0000
    0x0000090: 0000 0000 0000 0000 0000 00bf 0000 0000
    0x00000a0: 0000 0000 0000 0000 0000 0000 0000 0000
    0x00000b0: 0000 0000 00bf 0000 0000 0000 0000 0000
    0x00000c0: 0000 0000 00bf 0000 0000 bf00 00bf 0000
    0x00000d0: 0000 0000 00bf 0000 0000 0000 00bf 0000
    0x00000e0: 0000 0000 00bf 01b8 008f 9aff 31a7 0003
    0x00000f0: a700 2419 0501 129b 2b2c b800 af3a 0719
    0x0000100: 072b 2cb8 00b3 4d2c b800 b74d a700 0800
    0x0000110: 0000 00bf a700 1b3a 0519 064d a7ff d73a
    0x0000120: 0519 064d a7ff cf3a 0519 064d a7ff c7b2
    0x0000130: 006d a700 032b b800 bbb0 3a05 2bb8 00bb
    0x0000140: 1905 bf                                
  Exception Handler Table:
    bci [120, 156] => handler: 206
    bci [120, 156] => handler: 214
    bci [120, 156] => handler: 222
    bci [24, 243] => handler: 279
    bci [24, 243] => handler: 287
    bci [24, 243] => handler: 295
    bci [21, 309] => handler: 314
  Stackmap Table:
    append_frame(@27,Top,Object[#20])
    same_locals_1_stack_item_frame(@52,Object[#189])
    same_locals_1_stack_item_frame(@74,Object[#189])
    same_locals_1_stack_item_frame(@86,Object[#189])
    same_locals_1_stack_item_frame(@97,Object[#189])
    same_locals_1_stack_item_frame(@105,Object[#189])
    same_locals_1_stack_item_frame(@117,Object[#189])
    full_frame(@123,{Object[#2],Object[#22],Object[#20],Object[#20],Object[#64]},{Object[#189]})
    full_frame(@156,{Object[#2],Object[#22],Object[#20],Object[#20],Object[#64],Top,Object[#20]},{Object[#189]})
    same_locals_1_stack_item_frame(@182,Object[#189])
    same_locals_1_stack_item_frame(@198,Object[#189])
    same_locals_1_stack_item_frame(@203,Object[#189])
    same_locals_1_stack_item_frame(@206,Object[#189])
    same_locals_1_stack_item_frame(@214,Object[#189])
    same_locals_1_stack_item_frame(@222,Object[#189])
    same_frame(@230)
    same_frame(@240)
    full_frame(@243,{Object[#2],Object[#22],Object[#20],Object[#20],Object[#64],Object[#191],Object[#20]},{})
    full_frame(@271,{Object[#2],Object[#22],Object[#20],Object[#20],Object[#64]},{Object[#189]})
    append_frame(@276,Top,Object[#20])
    same_locals_1_stack_item_frame(@279,Object[#135])
    same_locals_1_stack_item_frame(@287,Object[#169])
    same_locals_1_stack_item_frame(@295,Object[#171])
    same_frame(@303)
    same_locals_1_stack_item_frame(@309,Object[#45])
    full_frame(@314,{Object[#2],Object[#22],Object[#20],Object[#20],Object[#64]},{Object[#189]})

Sorry for the cryptic test case. It was generated automatically by JQF.

@sainaen
Copy link
Contributor

sainaen commented Mar 27, 2018

Here’s a somewhat clearer reproducer in case anyone wants to take a stab at this issue:

try {
    while (false) {
        throw 1;
        try {
            break;
        } catch (_) {}
    }
} catch (_) {}

(tag: "good first issue" 😜 )

@gbrail gbrail added the good first issue Great place to start if you're looking to start an open source "resume" label Mar 27, 2018
@GauravMishra13
Copy link

hey i am in interested in your project! From which folder i should or from where should i begin.

@morfav
Copy link

morfav commented Nov 18, 2020

Hi, is this still a relevant first issue? I am looking for a project to contribute to and was wondering if there are any tasks that would be useful for this project?

Thanks.

@gbrail
Copy link
Collaborator

gbrail commented Nov 18, 2020

If that is still an issue (sorry, someone should re-test and I haven't had the time), then I'm not as sure as I was two years ago that this is an easy place to start.

An easier place might be the set of recent issues created by "NWU-NISL" -- they have found a long list of subtle spec compliance issues, and in some cases fixing them has only taken a small amount of code. (Finding that small amount of code, however, is the trick, isn't it?)

@gbrail gbrail removed the good first issue Great place to start if you're looking to start an open source "resume" label Nov 18, 2020
@p-bakker
Copy link
Collaborator

@morfav @GauravMishra13 let me know if you're still interested in contributing to Rhino

@morfav
Copy link

morfav commented Jun 30, 2021

@p-bakker Hi Paul, I did make a few contributions around half a year ago. I enjoyed it but eventually I bit off too big of a chunk with the unit-tests and then by the time the discussion got going on that I started working on other projects...
The conclusion I made is that since I don't use Rhino (and never have really) it's a bit challenging for me to work independently on it.
If you have some well-defined issues that need picking off I'd be happy to work on them when I need to procrastinate on something else :) however it would probably be a few hours per week.

@p-bakker
Copy link
Collaborator

p-bakker commented Jun 30, 2021

@morfav sorry to hear that it took a while for the discussions to get going, but great to hear you enjoyed working on the project.

We currently have several issues tagged with the good first issue which should be good picks to procrastinate some 😂. We've also updated the docs related to running the tests recently, hopefully making things a bit easier.

Can't wait to see some of your contributions appearing in our PR list!

@p-bakker
Copy link
Collaborator

p-bakker commented Jul 5, 2021

Duplicate of #915

Closing this one in favor of #915 as that case has more info in its comments and is linked to a feature-related PR

@p-bakker p-bakker closed this as completed Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants