Yelijah opened a new issue, #10001:
URL: https://github.com/apache/skywalking/issues/10001

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache SkyWalking Component
   
   Java Agent (apache/skywalking-java)
   
   ### What happened
   
   Deadlock happened when start tomcat with skywalking agent. But it just 
happened once, then never happened after that time.
   
   here is jstack :
   ```
   Found one Java-level deadlock:
   =============================
   "SkywalkingAgent-12-GRPCChannelManager-0":
     waiting to lock monitor 0x00005624750588a8 (object 0x00000005800666a0, a 
java.util.jar.JarFile),
     which is held by "main"
   "main":
     waiting to lock monitor 0x0000562475f7a308 (object 0x000000059d482db0, a 
java.lang.Object),
     which is held by "FileHandlerLogFilesCleaner-1"
   "FileHandlerLogFilesCleaner-1":
     waiting to lock monitor 0x00005624750588a8 (object 0x00000005800666a0, a 
java.util.jar.JarFile),
     which is held by "main"
   
   Java stack information for the threads listed above:
   ===================================================
   "SkywalkingAgent-12-GRPCChannelManager-0":
        at java.util.zip.ZipFile.getEntry(ZipFile.java:314)
        - waiting to lock <0x00000005800666a0> (a java.util.jar.JarFile)
        at java.util.jar.JarFile.getEntry(JarFile.java:241)
        at java.util.jar.JarFile.getJarEntry(JarFile.java:224)
        at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1056)
        at sun.misc.URLClassPath.getResource(URLClassPath.java:249)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        - locked <0x00000005d671fdb8> (a java.lang.Object)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at 
org.apache.skywalking.apm.dependencies.io.grpc.Metadata.<clinit>(Metadata.java:114)
        at 
org.apache.skywalking.apm.agent.core.remote.AgentIDDecorator.<clinit>(AgentIDDecorator.java:43)
        at 
org.apache.skywalking.apm.agent.core.remote.GRPCChannelManager.run(GRPCChannelManager.java:145)
        at 
org.apache.skywalking.apm.util.RunnableWithExceptionProtection.run(RunnableWithExceptionProtection.java:33)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
   "main":
        at java.lang.ClassLoader.loadClass(ClassLoader.java:400)
        - waiting to lock <0x000000059d482db0> (a java.lang.Object)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.pool.TypePool$Default$LazyTypeDescription$TokenizedGenericType$TokenList.<init>(TypePool.java:6904)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.pool.TypePool$Default$LazyTypeDescription$GenericTypeToken$Resolution$ForType$Tokenized.resolveInterfaceTypes(TypePool.java:4078)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.pool.TypePool$Default$LazyTypeDescription.getInterfaces(TypePool.java:2780)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDescription$Generic$OfParameterizedType.getInterfaces(TypeDescription.java:4927)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDescription$Generic$LazyProjection$WithEagerNavigation.getInterfaces(TypeDescription.java:6502)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.HasSuperTypeMatcher.doMatch(HasSuperTypeMatcher.java:67)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.HasSuperTypeMatcher.doMatch(HasSuperTypeMatcher.java:32)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$ForNonNullValues.matches(ElementMatcher.java:249)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Conjunction.matches(ElementMatcher.java:146)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Disjunction.matches(ElementMatcher.java:214)
        at 
org.apache.skywalking.apm.agent.core.plugin.match.ProtectiveShieldMatcher.matches(ProtectiveShieldMatcher.java:47)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RawMatcher$ForElementMatchers.matches(AgentBuilder.java:1833)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:11880)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:11838)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.access$1700(AgentBuilder.java:11555)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:12238)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:12178)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doPrivileged(AgentBuilder.java)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:11747)
        at 
sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at 
sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
        at sun.security.util.DerOutputStream.<clinit>(DerOutputStream.java:359)
        at sun.security.util.NamedCurve.<init>(NamedCurve.java:60)
        at sun.security.util.CurveDB.add(CurveDB.java:138)
        at sun.security.util.CurveDB.<clinit>(CurveDB.java:181)
        at 
sun.security.util.DisabledAlgorithmConstraints$Constraints.<init>(DisabledAlgorithmConstraints.java:311)
        at 
sun.security.util.DisabledAlgorithmConstraints.<init>(DisabledAlgorithmConstraints.java:128)
        at 
sun.security.util.DisabledAlgorithmConstraints.<init>(DisabledAlgorithmConstraints.java:95)
        at 
sun.security.util.SignatureFileVerifier.<clinit>(SignatureFileVerifier.java:62)
        at java.util.jar.JarFile.initializeVerifier(JarFile.java:371)
        at java.util.jar.JarFile.ensureInitialization(JarFile.java:615)
        - locked <0x00000005800666a0> (a java.util.jar.JarFile)
        at 
java.util.jar.JavaUtilJarAccessImpl.ensureInitialization(JavaUtilJarAccessImpl.java:69)
        at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:993)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:451)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        - locked <0x000000058db3d4a0> (a java.lang.Object)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)
   "FileHandlerLogFilesCleaner-1":
        at java.util.zip.ZipFile.getEntry(ZipFile.java:314)
        - waiting to lock <0x00000005800666a0> (a java.util.jar.JarFile)
        at java.util.jar.JarFile.getEntry(JarFile.java:241)
        at java.util.jar.JarFile.getJarEntry(JarFile.java:224)
        at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:1056)
        at sun.misc.URLClassPath.getResource(URLClassPath.java:249)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        - locked <0x000000059d482db0> (a java.lang.Object)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.pool.TypePool$Default$LazyTypeDescription$TokenizedGenericType$TokenList.<init>(TypePool.java:6904)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.pool.TypePool$Default$LazyTypeDescription$GenericTypeToken$Resolution$ForType$Tokenized.resolveInterfaceTypes(TypePool.java:4078)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.pool.TypePool$Default$LazyTypeDescription.getInterfaces(TypePool.java:2780)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDescription$Generic$OfParameterizedType.getInterfaces(TypeDescription.java:4927)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.description.type.TypeDescription$Generic$LazyProjection$WithEagerNavigation.getInterfaces(TypeDescription.java:6502)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.HasSuperTypeMatcher.doMatch(HasSuperTypeMatcher.java:67)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.HasSuperTypeMatcher.doMatch(HasSuperTypeMatcher.java:32)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$ForNonNullValues.matches(ElementMatcher.java:249)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Conjunction.matches(ElementMatcher.java:146)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.matcher.ElementMatcher$Junction$Disjunction.matches(ElementMatcher.java:214)
        at 
org.apache.skywalking.apm.agent.core.plugin.match.ProtectiveShieldMatcher.matches(ProtectiveShieldMatcher.java:47)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$RawMatcher$ForElementMatchers.matches(AgentBuilder.java:1833)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:11880)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:11838)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.access$1700(AgentBuilder.java:11555)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:12238)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:12178)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doPrivileged(AgentBuilder.java)
        at 
org.apache.skywalking.apm.dependencies.net.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:11747)
        at 
sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at 
sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
        at 
java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(FileSystems.java:95)
        at 
java.nio.file.FileSystems$DefaultFileSystemHolder.<clinit>(FileSystems.java:90)
        at java.nio.file.FileSystems.getDefault(FileSystems.java:176)
        at java.io.File.toPath(File.java:2234)
        - locked <0x000000059d453680> (a java.io.File)
        at 
org.apache.juli.FileHandler.streamFilesForDelete(FileHandler.java:557)
        at org.apache.juli.FileHandler.lambda$clean$0(FileHandler.java:544)
        at org.apache.juli.FileHandler$$Lambda$17/439925336.run(Unknown Source)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
   
   Found 1 deadlock.
   
   ```
   
   ### What you expected to happen
   
   The deadlock never happened when use tomcat with skywalking agent.
   
   
   ### How to reproduce
   
   it happened only once.
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to