Skip to content

[Bug] #13458

@angjuLin

Description

@angjuLin

Search before asking

  • I had searched in the issues and found no similar issues.

Apache SkyWalking Component

OAP server (apache/skywalking)

What happened

After using SkyWalking version 9.2, I get a java.lang.UnsupportedOperationException: class redefinition failed: attempted to change superclass or interfaces exception when trying to trace a method of a class using Arthas. I've searched for similar issues and found a similar problem when using version 8.X. I solved it by adding the parameters -Dskywalking.agent.is_cache_enhanced_class=true and -Dskywalking.agent.class_cache_mode=MEMORY. Because SkyWalking enhances bytecode information dynamically when used with other probes, the names of newly added fields or methods are dynamic. I noticed that the CacheableTransformerDecorator class was removed after version 9.X. I saw in the commit notes that upgrading the byte-buddy version resolved the dynamic enhancement issue, but this doesn't seem to be the case.

First, taking the okhttp3.RealCall enhancement as an example, I used the jad command on arthas to discover that the source code doesn't contain the SkyWalking enhancement logic. Its implementation logic is simply a wrapper around RealCall, with an additional class named okhttp3/RealCall$auxiliary$7KNXUqCR. ​​However, executing the trace okhttp3.RealCall enqueue command on arthas resulted in a java.lang.UnsupportedOperationException: class redefinition failed: attempted to change superclass or interfaces exception. Even my probe retransformed it, resulting in the same exception. I suspect this is a problem.

Secondly, while upgrading byte-buddy resolved the dynamic enhancement issue, I'm also concerned because the generated enhancement class name, such as okhttp3/RealCall$auxiliary$7KNXUqCR, changes with each generation. Does this indicate instability? I've found that retransformation fails for any class with this name, and okhttp3.RealCall is just one example.

What you expected to happen

Classes enhanced with SkyWalking should not be unable to retransform

How to reproduce

Other probes do not work in many classes enhanced by retransform skywalking

Anything else

Image
Image
Image

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working and you are sure it's a bug!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions