question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FD leak causes invalid ScanResults when run on large classpath

See original GitHub issue

After upgrading Atomix to ClassGraph i’m seeing that it fails to load public inner classes yet I haven’t changed anything wrt class loaders…

java.lang.IllegalArgumentException: Could not load class io.atomix.protocols.backup.MultiPrimaryProtocol$Type

	at io.github.classgraph.ScanResult.loadClass(ScanResult.java:720)
	at io.github.classgraph.ScanResultObject.loadClass(ScanResultObject.java:145)
	at io.github.classgraph.ClassInfo.loadClass(ClassInfo.java:1691)
	at io.atomix.core.impl.ClasspathScanningAtomixRegistry.lambda$new$0(ClasspathScanningAtomixRegistry.java:56)
	at java.util.ArrayList.forEach(ArrayList.java:1249)
	at io.atomix.core.impl.ClasspathScanningAtomixRegistry.<init>(ClasspathScanningAtomixRegistry.java:52)
	at io.atomix.core.impl.ClasspathScanningAtomixRegistry.<init>(ClasspathScanningAtomixRegistry.java:41)
	at io.atomix.core.AtomixRegistry.registry(AtomixRegistry.java:49)
	at io.atomix.core.Atomix.builder(Atomix.java:288)
	at io.atomix.core.Atomix.builder(Atomix.java:275)
	at io.atomix.core.AbstractAtomixTest.buildAtomix(AbstractAtomixTest.java:76)
	at io.atomix.core.AbstractAtomixTest.createAtomix(AbstractAtomixTest.java:110)
	at io.atomix.core.AbstractAtomixTest.createAtomix(AbstractAtomixTest.java:103)
	at io.atomix.core.AbstractPrimitiveTest.setupCluster(AbstractPrimitiveTest.java:82)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.IllegalArgumentException: No classloader was able to load class io.atomix.protocols.backup.MultiPrimaryProtocol$Type
	at io.github.classgraph.ScanResult.loadClass(ScanResult.java:682)
	at io.github.classgraph.ScanResult.loadClass(ScanResult.java:715)
	... 28 more

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:40 (40 by maintainers)

github_iconTop GitHub Comments

2reactions
lukehutchcommented, Aug 1, 2018

@johnou Great, and yes, you’re absolutely right about that. What was happening is that the inner interface class was being referenced somewhere else on the classpath, and since the class itself had not been scanned (because it couldn’t be, because all the fds were used up), it was created as a placeholder ClassInfo for an “external class” (just as with class references for superclasses that are not in a whitelisted path).

I really appreciate you catching this, and for helping me track down the cause. It was a very serious bug!

0reactions
johnoucommented, Aug 2, 2018

Cheers, comes with experience I think, I’ve lost count the amount of times I have had to attach Spring / Hibernate sources to our projects to debug problems… I must also thank you again for being so responsive and thorough.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An uber-fast parallelized Java classpath scanner and module scanner.
FD leak causes invalid ScanResults when run on large classpath. java.lang.IllegalArgumentException: Could not load class io.atomix.protocols.backup.
Read more >
Long Java classpath solution - Stack Overflow
And runs the application. This works fine in Linux but it explodes in windows because the classpath is too long.
Read more >
Diff - platform/cts - Google Git
public void testDeviceContainsExpectedConfig() throws Exception ... doesn't garbage collect it - // and cause our fd to become invalid. http://b/35927643 .
Read more >
Sub-task - Release Notes - Red Hat Issue Tracker
[JBAS-3148] - Unified JGroups MBean to configure the channel running inside the JBoss AS. [JBAS-3203] - Delegate for Authorization Interceptor for RMIAdaptor ...
Read more >
QRadar APARs 101 - IBM
Installing High Availability (HA) on 7.5.0 GA can cause the partition ... This incorrect value results in the following comnan error in /var/log/qradar.log:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found