-
Notifications
You must be signed in to change notification settings - Fork 172
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
Files test fails with latest openjdk 7 #76
Comments
Turns out this is because of a recent change in the jdk7 dev branch: changeset: 5501:bcba89ce0a8c The change replaced the read()| native method with a read0()|, and implemented read()I to defer to read0()I, with some instrumentation. The fix to make avian compatible is simple: diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp
index 0cf5e3b..b8173d3 100644
--- a/src/classpath-openjdk.cpp
+++ b/src/classpath-openjdk.cpp
@@ -2002,7 +2002,7 @@ interceptFileOperations(Thread* t, bool updateRuntimeData)
intercept(t, fileInputStreamClass, "open", "(Ljava/lang/String;)V",
voidPointer(openFile), updateRuntimeData);
- intercept(t, fileInputStreamClass, "read", "()I",
+ intercept(t, fileInputStreamClass, "read0", "()I",
voidPointer(readByteFromFile), updateRuntimeData);
intercept(t, fileInputStreamClass, "readBytes", "([BII)I", The trick will be making avian compatible with both the old version and the new version of openjdk. |
@dicej, any thoughts on how we can fix this, while (hopefully) maintaining compatibility with both versions? |
On Fri, 6 Dec 2013, Joshua Warner wrote:
The intercept function will just do nothing if it can't find the method, |
The The current implementation of |
On Fri, 6 Dec 2013, Joshua Warner wrote:
Then call findMethodOrNull before calling intercept to see if it's native |
That would make too much sense. (mild face palm) Expect a pull request coming your way soon... |
The files test fails thusly:
java/lang/UnsatisfiedLinkError: java/io/FileInputStream.read()I
at java/io/FileInputStream.read (native)
at java/io/FileInputStream.read (native)
at Files.main (line 64)
Note that this was originally discussed in #74
The text was updated successfully, but these errors were encountered: