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

Infinite loop with recursive JSR #85

Open
samczsun opened this issue Apr 8, 2016 · 3 comments
Open

Infinite loop with recursive JSR #85

samczsun opened this issue Apr 8, 2016 · 3 comments

Comments

@samczsun
Copy link

samczsun commented Apr 8, 2016

Yes, I realize that the bytecode is technically illegal because of the recursive JSR, but when decompiling a JAR if an unused class contains this sequence then the entire decompilation will halt.

If you decide that this is out of scope I respect that decision. However, I do feel that this should be fixed

.method public static main : ([Ljava/lang/String;)V 
    .code stack 1024 locals 10
    jsr L1
L1:
    jsr L2
    jsr L1
    return
L2:
    astore_1
    pop
    ret 1
    .end code 
.end method 
@Storyyeller
Copy link
Owner

The ironic part is that Krakatau originally did strict verification of the bytecode prior to decompilation, but I later took that out since there was little point and it slowed things down slightly. But I guess this is the downside of that.

Note that there are already lots of ways to DOS Krakatau, even with valid bytecode. For example, deeply nested JSRs leads to exponential complexity, as do large highly connected control flow graphs. Luckily those never happen in practice.

@Janmm14
Copy link

Janmm14 commented Apr 15, 2016

Can you maybe add a per-class max-loop counter or a max-decompilation time for a class, so the ongoing decompilation of a jar file can continue?

@Storyyeller
Copy link
Owner

What kind of use case would there be and is it general enough to merit inclusion in Krakatau?

@Storyyeller Storyyeller reopened this May 22, 2022
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

3 participants