-
Notifications
You must be signed in to change notification settings - Fork 93
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
Comparison method violates its general contract! #349
Comments
That is weird, Jandex 3.1.5 should include the fix. Can you by any chance share the deployment that causes the issue? |
Hi, |
Understood. I will look at the comparator implementation again, perhaps I will spot a mistake, but I'm not holding my breath. If you have some time, it should be possible to trim down your deployment to a minimal reproducer like this:
It should be possible to trim down the JAR to a small number of files that cause the problem. Then, you should be able to recreate a small JAR with mostly empty classes that exhibit the problem. If you could do that, I'd be grateful, but I understand you most likely don't have the time for that. |
Hi, #:~/Downloads> java --version #:~/Downloads> java -jar ~/install/wildfly-30.0.0.Final/modules/system/layers/base/io/smallrye/jandex/main/jandex-3.1.5.jar myear.ear #:~/Downloads> java -jar ~/install/wildfly-30.0.0.Final/modules/system/layers/base/io/smallrye/jandex/main/jandex-3.1.5.jar interface.war #:~/Downloads> java -jar ~/install/wildfly-30.0.0.Final/modules/system/layers/base/io/smallrye/jandex/main/jandex-3.1.5.jar services.war Br |
I don't think that |
Hi, Thank's |
Is that dependency an opensource library? I would still like to find out the cause and fix the bug (because it is a Jandex bug). |
Hi, |
OK, understood. Please note that this is truly a Jandex bug, that dependency cannot (and should not) do anything to fix this problem. Now that you know which JAR exhibits the issue, you could possibly apply the "trial and error" method I described above to create a minimal failing JAR. I assume such minimal failing JAR will likely contain not more than 5 classes (based on my previous experiments with minimizing JARs that demonstrate Jandex bugs). Then, a reproducer could be created with mostly empty classes. What matters is class names, class nesting and type variables, everything else should be irrelevant. If you (or the other team, or perhaps a 3rd party vendor?) can do that, that would be great! |
Hi, |
Interesting, I tried to download the ZIP from their website and index the |
Yes we also notice that. |
Hi @yosvanyllr, I have a Jandex branch here https://github.com/Ladicek/jandex/commits/index-postprocessing-sort/ that tries to avoid the problem altogether by sorting classes in a completely different way. I'm running tests myself, but if you could build Jandex from that branch, replace the Jandex JAR in your WildFly with that build and test, that would help. Thank you! |
Thanks! |
Hi, sorry for not getting to this sooner, I was busy with a few other things. Also, it took me a while to actually understand the problem -- the suggestions in my previous comments here were rather useless in this particular case. I eventually had to resort to a brute force approach and write a checker that verifies whether given It also turns out that the experiment with a different comparator was actually a good idea, because that implementation in fact does provide a total order. Fix is in #352. |
Hi @yosvanyllr, this should be fixed now in Jandex 3.1.7. I don't know when WildFly picks it up, but you should be able to replace any Jandex 3.1 release with 3.1.7 if you want to verify that the fix is effective. |
Thank you @Ladicek for the update. |
Hi,
WildFly 30 includes version 3.1.5
There on startup we can see a bug like #289
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0156: Failed to index deployment root for annotations
at org.jboss.as.server@22.0.1.Final//org.jboss.as.server.deployment.annotation.ResourceRootIndexer.indexResourceRoot(ResourceRootIndexer.java:93)
at org.jboss.as.server@22.0.1.Final//org.jboss.as.server.deployment.annotation.AnnotationIndexProcessor.deploy(AnnotationIndexProcessor.java:34)
at org.jboss.as.server@22.0.1.Final//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:171)
... 8 more
Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.base/java.util.TimSort.mergeLo(TimSort.java:781)
at java.base/java.util.TimSort.mergeAt(TimSort.java:518)
at java.base/java.util.TimSort.mergeCollapse(TimSort.java:448)
at java.base/java.util.TimSort.sort(TimSort.java:245)
at java.base/java.util.Arrays.sort(Arrays.java:1307)
at java.base/java.util.ArrayList.sort(ArrayList.java:1721)
at io.smallrye.jandex//org.jboss.jandex.Indexer.propagateTypeParameterBounds(Indexer.java:2570)
at io.smallrye.jandex//org.jboss.jandex.Indexer.complete(Indexer.java:2550)
at org.jboss.as.server@22.0.1.Final//org.jboss.as.server.deployment.annotation.ResourceRootIndexer.indexResourceRoot(ResourceRootIndexer.java:89)
... 10 more
BR
The text was updated successfully, but these errors were encountered: