-
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
IllegalStateException during indexing #175
Comments
I'd gladly investigate the issue, if you provided a way to reproduce. Since the stack trace starts at |
The Scala library, at least the one I'm looking at ( Your screenshot is unfortunately useless. The |
We are decided to filter out indexing scala jars. Now the indexing is ok |
The Function is inside the: scala-library-2.9.1.jar |
Thank you! Indeed running
I'll look into it. In the meantime, I believe what you did seems right, indexing the Scala classes would most likely be useless for you. |
Reopening, I can reproduce the issue by indexing a single file: It also turns out that the hint at 2 different Looking more into it. |
One more thing: I recall we adjusted |
The changes we did to account for |
OK so |
(Side note: to be completely fair, implementing |
So the 1st
The same The 2nd The generic signature parser first finds a type name of
Then, the generic signature parser finds and parses the type arguments, and then it looks for nested types. Those are delimited by
Each case makes perfect sense when taken in isolation. However, looking at both of them at the same time, I'm starting to believe that |
It is possible to somehow resolve this? |
It is possible. I'm still working on how to do it best. |
Hi @n1hility, could you please comment on how |
I realized yesterday evening that the generic signature parser is probably at fault, because it does not componentize the inner class name. I'll check today. |
I came up with a relatively simple change that makes the generic signature parser componentize the inner class name and end up with the following
This is almost identical to the Fixing that will likely affect the treatment of |
I think I just got enlightened :-) The problem with a descriptor like We eliminated empty local names previously (as I mentioned several times, by treating The only question is, well, now what :-) |
I have a patch locally that allows (not sure if correctly :-) ) indexing However, looking more at |
@Ladicek sorry for the delay I will take a look it this tomorrow (today for you). Skimming it sounds like you are on the right track. The intention is that it's not precise (since not enough info), but it should be deterministic. |
@n1hility thanks, I think I've got it now. I need to fix |
I have a fixed version of |
Reproducing the additional failure is possible by indexing one file ( Of course, it's once again caused by a piece of code that assumes that componentization is canonical. This time, it's the code that reads/writes the name table. Specifically, these 2 names are serialized next to each other:
The first is componentized like this:
While the second is componentized like this:
The code that constructs componentized Will think about a fix next week. |
(Adding here just for the fun: after the index reader miscalculates the name depths, it even creates non-existing names such as |
@Ladicek ok thanks. it's all yours. One thing to check out is the sorting is correct, since these names are written in a radix tree order where each branch is preceded by its peers and finally the immediate parent (prefix()) |
Yea the sorting is correct. It's the assumption that it's possible, when deserializing a name, to get the correct prefix by taking the previously deserialized name and call I realized over the weekend that there's a simple fix. Instead of writing a depth of the name, which will later be used to find the prefix, we can just store an index of the prefix in the name table. Since names are written in order, the prefix must have already been written, so we can simply look it up from the table, instead of inspecting the previously deserialized name. In case of huge JARs with 1000s classes, indices can be large numbers and the total index size could increase. That can be mitigated relatively easily: instead of storing an [absolute] index, we can store a [relative] offset. Since offsets would always be negative, we would actually store the offset modified like this: That obviously requires a new persistent format version, so can't be fixed in 2.4. EDIT: the offset format described above actually can't be used, because a prefix of |
Aaaand with the 2 changes described above (fixed |
I could write a test for the package test
trait Func[-T1, -T2, +R] {
def apply(v1: T1, v2: T2): R
def curried: T1 => T2 => R = {
(x1: T1) => (x2: T2) => apply(x1, x2)
}
} But I'm struggling to write an equivalent Java code that would also exhibit the issue. Will continue digging for some time, not sure what to do if I'm not successful. |
I just realized that I could just put the Scala source code into the |
OK this is embarrassing. I spent more than a day trying to find a reproducer for the name prefix serialization/deserialization issue, and it looks like my test for |
Fixes are in #176. Due to the need to change persistent format, this can't be backported to 2.x, unfortunately. |
Fixed in #176. |
I got the next exception from Jandex library:
Caused by: java.lang.IllegalStateException: Class not found in class table:scala.Function18$$anonfun$curried$1
at org.jboss.jandex.IndexWriterV2.positionOf (IndexWriterV2.java:507)
at org.jboss.jandex.IndexWriterV2.writeTypeEntry (IndexWriterV2.java:789)
at org.jboss.jandex.IndexWriterV2.writeTypeTable (IndexWriterV2.java:271)
at org.jboss.jandex.IndexWriterV2.write (IndexWriterV2.java:211)
at org.jboss.jandex.IndexWriter.write (IndexWriter.java:110)
at org.jboss.jandex.IndexWriter.write (IndexWriter.java:74)
at org.jboss.jandex.JarIndexer.createJarIndex (JarIndexer.java:193)
Please investigate this issue. thanks
The text was updated successfully, but these errors were encountered: