Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
asm
asm
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 3
    • Merge Requests 3
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • asm
  • asmasm
  • Issues
  • #317905

Closed
Open
Opened May 21, 2020 by Andres Luuk@mysticel

Issues with JSRInlinerAdapter and LocalVariableTable size

A client of mine got a following error: java.lang.ClassFormatError: LocalVariableTable has wrong length in class file cfdump2ecfm851157132$funcDUMPOBJECT I tracked the issue down to the JSRInlinerAdapter we use. The issue is that the failing class is a generated class (made by ColdFusion) with old file format that contains a lot of jsr/ret instructions and a lot of local variables that are all defined though the entire class. for example:

0   27121   114  t114   Ljava/lang/Throwable;

So after the inlining 478 will became 116513 items. For example:

4   27427   114  t114   Ljava/lang/Throwable;
27431      10   114  t114   Ljava/lang/Throwable;
27441      10   114  t114   Ljava/lang/Throwable;
27451      10   114  t114   Ljava/lang/Throwable;
...

My current fix is that I simply cap the size of LocalVariableTable to 65565 after JSRInlinerAdapter:

if (localVariables != null && localVariables.size() > 65535) {
  localVariables = localVariables.subList(0, 65535);
}

I think it would also be possible to try to merge the new frames because currently they still cover the entire method, but they are split into pieces. We can still have the old frame and add only a single new one for the inlined part (this would reduce the number a lot), inside JSRInlinerAdapter, but this will probably be more complex.

The fix of capping the number of lines is currently sufficient fix for us. But I made this case, in case you want to make some fix into ASM for other users of the JSRInlinerAdapter.

Edited May 21, 2020 by Andres Luuk
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: asm/asm#317905