-
Notifications
You must be signed in to change notification settings - Fork 747
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
NoSuchMethodError exception java.nio.MappedByteBuffer.position in ELF analyzer #2815
Comments
The code in question in 106 public String parseELF(FileChannel fch) throws IOException {
107 MappedByteBuffer fmap = fch.map(FileChannel.MapMode.READ_ONLY, 0, fch.size());
108 ELFHeader eh = new ELFHeader(fmap);
...
185 private static class ELFHeader {
...
211 ELFHeader(MappedByteBuffer fmap) throws IllegalArgumentException {
212 if (fmap.get(ELFIdentification.EI_MAG0.value()) != 0x7f ||
213 fmap.get(ELFIdentification.EI_MAG1.value()) != 'E' ||
214 fmap.get(ELFIdentification.EI_MAG2.value()) != 'L' ||
215 fmap.get(ELFIdentification.EI_MAG3.value()) != 'F') {
216 throw new IllegalArgumentException("Not an ELF file");
217 }
218
219 ei_class = EI_Class.valueOf(fmap.get(ELFIdentification.EI_CLASS.value()));
...
229 fmap.position(ELFIdentification.EI_NIDENT.value()); So, the |
Actually, what is "system provided Java 8" exactly ? |
I'm using the |
Just to be sure, could you run the indexer with |
Also, I wonder how many ELF files do you have in your projects and whether all of the suffer from this problem. |
verbose output:
There's only one jar file
|
ELF files do show up in a fair number of projects... |
For reference on my laptop with Ubuntu 18.04 and Oracle Java 8 (build 1.8.0_181-b13) I stepped through the |
The verbose output should look like this:
i.e. the |
Hence, your indexer line should look like this:
|
So then the output is this?
|
From the
|
My OpenJDK version from Ubuntu:
|
Could you post the complete output w.r.t. the |
Attached: opengrok-index-run.txt |
Hm, I don't see anything wrong there. |
@vladak Have you tried running 1.2.14 with Ubuntu's OpenJDK? |
Nope. The Travis builds run with xenial+OpenJdk8 tho.
Dne st 19. 6. 2019 15:34 uživatel Neal Gompa (ニール・ゴンパ) <
[email protected]> napsal:
… @vladak <https://github.com/vladak> Have you tried running 1.2.14 with
Ubuntu's OpenJDK?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2815?email_source=notifications&email_token=AAWMMDD2IT7SOJDFXZ7RBQDP3IYW7A5CNFSM4HZCCVMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYB4F6Y#issuecomment-503563003>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAWMMDB3CGKZQP6CXBVE2PLP3IYW7ANCNFSM4HZCCVMA>
.
|
Is there any additional data I can provide on this, as I'm seeing something similar? (referenced from #2122) CentOS Linux release 7.6.1810 (Core) [Loaded java.nio.MappedByteBuffer from /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre/lib/rt.jar] |
Maybe you could try to find out if this is data driven, i.e. try to reduce the indexed data to the point when the issue is still happening. I wonder if this happens with just a single ELF file under source root. |
So I previously had 10-12 different source codes in my src folder. Cut out all but one to reduce the possible data. If I ignore any line from std out that's just loading code in verbose mode: this is standard out" 18:17:39 WARNING: Error from ctags: ctags: Warning: Language "clojure" already defined 18:17:52 SEVERE: ERROR addFile(): 18:17:52 WARNING: An error occurred while finishing writer and completer 18:17:52 WARNING: An error occurred while finishing writer and completer 18:17:52 SEVERE: Failed with unexpected RuntimeException 18:17:52 SEVERE: Problem updating index database in directory /usr/opengrok/data-2/index/index-test: I'll see if I can scrub and attach the opengrok0.0.log |
I'm experiencing this problem also. Searching around shows other applications experiencing the problem on Java 8 when built with Java 9 or greater. I'm new to Opengrok, but did I see the releases are built using Java 11? Hopefully what I found helps. Source: [https://github.com/lmdbjava/lmdbjava/issues/116]
|
And it looks like a better option would be to add the flag --release 8 to javac when building. Source: plasma-umass/doppio#497 |
This might be it. The deploy stage in Travis basically builds the whole distribution from scratch (which is another problem of its own) using JDK 11 (e.g. https://travis-ci.org/oracle/opengrok/jobs/548094045 for 1.2.15). Curiously, Maven's has the |
I changed the deploy build in cset 54bbf93, will trigger new release. |
relevant comment on the setting the compile target: plasma-umass/doppio#497 (comment) |
It seems the ultimate cure for this problem is to use |
@Conan-Kudo , @IamTHEvilONE, @carbonrobin once 1.2.16 is out please give it a try. |
I have no parallel-indexing errors on 1.2.16 on a single source code repo, nor MappedByteBuffer errors. Testing with my 12+ code bases I'd index. |
It seems to be okay for me so far... |
Cool, closing then. Many thanks @carbonrobin ! |
I'm trying to run OpenGrok 1.2.14 on Ubuntu 16.04 on Java 8 using the system provided Java 8 and Tomcat 8 stack.
When running the indexer, I got the following tracebacks:
The text was updated successfully, but these errors were encountered: