Comments (6)
Turns out this is because of a recent change in the jdk7 dev branch:
changeset: 5501:bcba89ce0a8c
user: sla
date: Tue Nov 27 09:23:54 2012 +0100
summary: 8003322: Add instrumentation points for tracing of I/O calls
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.
from avian.
@dicej, any thoughts on how we can fix this, while (hopefully) maintaining compatibility with both versions?
from avian.
On Fri, 6 Dec 2013, Joshua Warner wrote:
@dicej, any thoughts on how we can fix this, while (hopefully) maintaining
compatibility with both versions?
The intercept function will just do nothing if it can't find the method,
so we should be able to just have two calls to intercept: one for read and
another for read0.
from avian.
The read()I
method will always be present - the difference is whether it's a native method (old) or a Java method that delegates to read0()I
.
The current implementation of intercept
won't work because it doesn't pay any attention to the ACC_NATIVE
flag; in fact, it unconditionally sets it.
from avian.
On Fri, 6 Dec 2013, Joshua Warner wrote:
The read()I method will always be present - the difference is whether it's a
native method (old) or a Java method that delegates to read0()I.The current implementation of intercept won't work because it doesn't pay
any attention to the ACC_NATIVE flag; in fact, it unconditionally sets it.
Then call findMethodOrNull before calling intercept to see if it's native
or not.
from avian.
That would make too much sense. (mild face palm)
Expect a pull request coming your way soon...
from avian.
Related Issues (20)
- getParentFile() behavior HOT 1
- Building embedded avian with openjdk class library without buliding the whole openjdk package HOT 2
- Error trying to run tomcat hello server HOT 5
- Avian does not support constructor references. HOT 1
- What Java/JVM subset does Avian support? HOT 3
- Travis build is failing for "bootimage-test=true" HOT 2
- Unable to compile Lambda/default method HOT 10
- Is it possible to embed Avian in C/C++ ? HOT 1
- UnsetisfiedLinkError HOT 3
- openjdk8 - java/lang/SecurityException: Cannot locate policy or framework files! HOT 2
- NoSuchMethodError unmodifiableCollection HOT 4
- Collectors.joining: don't know how to auto-unbox to V HOT 1
- Is possible to build a GUI using Swing/JavaFX or at least AWT??
- avian fails to build with java 10.0.1 due to java version parsing HOT 2
- Getting a ClassCastException when trying to get class annotations
- Yet another lambda problem
- invokedynamic leads to accessing null dynamicTable in addDynamic.
- java/lang/annotation/AnnotationFormatError: Unexpected end of annotations.
- File Descriptor Leak in NIO
- Fails to compile on a modern Linux system, fixed via PR
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from avian.